Posts Tagged ‘windows 10 bash reset password’

Forgot Linux Bash Password in Windows 10? How Can I Reset?

July 12th, 2018 by Admin

How can I reset the Bash password of Ubuntu Linux shell in Windows 10? When you install Ubuntu Bash shell on your Windows 10 PC, Windows will prompt you to create a UNIX user account. If you’ve forgotten the password, this tutorial can help you reset it easily.

How to Reset Linux Bash Shell Password in Windows 10?

  1. To get started, open a regular Command Prompt (or PowerShell). Just type cmd in Cortana search box on the taskbar, and you can then click “Command Prompt” from the result.

  2. Next, run the following command to set “root” as the default user for Linux Bash shell.
    ubuntu config --default-user root

    If you’re running Windows 10 Creators update or earlier, you can change the default Bash user to “root” by running this command:
    lxrun /setdefaultuser root

  3. The next time you open the Linux Bash shell, it will log you as root without asking a password. You can use the passwd command to set up a new password for any UNIX user account.
    passwd user_name

  4. The last step is to reset your default user back to your normal Linux account. Type this in the Command Prompt:
    ubuntu config --default-user user_name

    or execute this command:
    lxrun.exe /setdefaultuser user_name

    That’s it!