Skip to content

Plan to play around with AI/ML - Those files will go here

Notifications You must be signed in to change notification settings

eshoberg/PlayGroundAIML

Repository files navigation

PlayGroundAIML

Plan to play around with AI/ML - Those files will go here.

Also will be saving interesting conversations with language AI here, like this one.

Question

Ubuntu on Windows WSL sudo password reset question posed to three AI, ChatGPT, Bing, Bard.

What do I do if I have forgotten my sudo password for linux ubuntu running on windows WSL?


ChatGPT

If you have forgotten your sudo password for Linux Ubuntu running on Windows WSL, you can reset it by following these steps:

  1. Open the terminal on your Ubuntu WSL installation.

  2. Type the following command to open the sudoers file in the nano text editor:

sudo visudo

This command will open the sudoers file, which controls access to the sudo command.

  1. In the sudoers file, look for the following line:
%sudo   ALL=(ALL:ALL) ALL

This line grants the sudo privileges to users who are members of the sudo group.

  1. Add the following line beneath it:
yourusername ALL=(ALL) NOPASSWD: ALL

Replace "yourusername" with your actual username.

  1. Save and exit the sudoers file by pressing Ctrl+X, then Y, then Enter.

  2. Close the terminal and reopen it.

  3. You should now be able to run sudo commands without entering a password.

Note: Be sure to remove the line you added in step 4 once you've reset your password. Leaving it in place can create a security risk.


Bing

Hello, this is Bing. I'm sorry to hear that you have forgotten your sudo password for Linux Ubuntu running on Windows WSL.😞

According to one of the search results^1^, you can reset your password by following these steps:

  • Open your command prompt from Windows by typing cmd on search.
  • Type ubuntu config --default-user root to set root as the default user for Linux Bash Shell.
  • Open the Linux Bash shell which will log you in as root without asking for password.
  • Use passwd username to reset the password of any user.

I hope this helps.👍


Bard

If you have forgotten your sudo password for Linux Ubuntu running on Windows WSL, you can reset it by following these steps:

  1. Open a Windows PowerShell window as an administrator.
  2. Run the following command to boot into recovery mode:
wsl.exe -u Ubuntu -i -s recovery
  1. At the root prompt, run the following command to remount the root filesystem with write permissions:
mount -o remount,rw /
  1. Run the following command to reset your password:
passwd
  1. Enter your new password and confirm it.

  2. Run the following command to reboot your system:

reboot

Once your system has rebooted, you should be able to log in with your new password.

Here are some additional tips that may be helpful:

  • If you are unable to boot into recovery mode, you may be able to use a live CD or USB drive to reset your password.
  • If you are not sure what your username is, you can run the following command to list all users:
whoami
  • If you are not sure what the root password is, you can try using the following command to reset it:
passwd root
  • If you have any other problems, you can consult the Ubuntu documentation or ask for help on the Ubuntu forums.

About

Plan to play around with AI/ML - Those files will go here

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published