You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: WSL/user-support.md
+5-15Lines changed: 5 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,25 +29,15 @@ You will be asked to enter your current password, then asked to enter your new p
29
29
30
30
### Forgot your password
31
31
32
-
If you forgot the password for your Linux distribution, try this:
32
+
If you forgot the password for your Linux distribution:
33
33
34
-
For Ubuntu:
35
-
1. Open PowerShell and use it to change the default user name of your Ubuntu distribution to root with: `ubuntu config --default-user root`
34
+
1. Open PowerShell and enter the root of your default WSL distribution using the command: `wsl -u root`
36
35
37
-
2. Open your distribution (Ubuntu) and you should see that the prompt now lists `root@computername` rather than the user name you entered. Enter the command: `passwd <username>` (replacing the username you created for your account and forgot the password for).
36
+
-- If you need to update the forgotten password on a distribution that is not your default, use the command: `wsl -d Debian -u root`, replacing `Debian` with the name of your targeted distribution.
38
37
39
-
3. You will be prompted to enter a new UNIX password and then confirm that password. Once you're told that the password has updated successfully, close the Linux distribution (Ubuntu).
38
+
2. Once your WSL distribution has been opened at the root level inside PowerShell, you can use this command to update your password: `passwd`
40
39
41
-
4. Open PowerShell and use it to change the default user name of your Ubuntu distribution back to your username with: `ubuntu config --default-user <your username>`
42
-
43
-
5. Now re-open your Ubuntu distribution and you should see your username displayed as the prompt, rather than `root`. Now you can confirm that your password was correctly updated.
44
-
45
-
For other Linux distributions, follow the same instructions, but in Powershell, change the command to align with the correct distribution name:
3. You will be prompted to enter a new UNIX password and then confirm that password. Once you're told that the password has updated successfully, close WSL inside of PowerShell using the command: `exit`
51
41
52
42
> [!NOTE]
53
43
> If you are running an early version of Windows operating system, like 1703 (Creators Update) or 1709 (Fall Creators Update), see the [archived version of this user account update doc](../user-support-archived.md).
0 commit comments