Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login

POZE MRRRR'S FORUM (VIEW ONLY)

Nu sunteti logat.
Nou pe simpatie:
Alexanndra1994 pe Simpatie.ro
Femeie
23 ani
Bucuresti
cauta Barbat
23 - 42 ani
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [WINDOWS] Reset WSL Linux Password if You've Forgot It Moderat de TRaP, TonyTzu
Autor
Mesaj Pagini: 1
Mrrrr
AdMiN

Inregistrat: acum 17 ani
Postari: 2186
I've installed WSL about 3 weeks ago and haven't had time to use it yet. Now I see I cannot access it since when I installed it I didn't remember the password. Typed a sudo command and it asked for password. 

How to reset the password?

Check the amazing and simple explanation in source video. All credits to him.

I'm just going to reproduce the same steps in text, for keeps:

1. Open Start and look for a Linux release like, for example, Ubuntu

2. Once found, right click it and select More - Share
- This opens Microsoft Store on your Linux release app

3. In the description of the app, look for "Installation tips"
- You need to find what's written after "To launch, use", for example: To launch, use "ubuntu"

4. Open Command Prompt (CMD) as administrator and at the prompt type the following command, replacing ubuntu with your command word obtained in step 3, and press enter

ubuntu config --default-user root

- Once enter pressed, there will be an empty row then it will reload the normal CMD path and prompt, eg: C:\Users\WindowsUserName>
- Do not close CMD

5. Open Start and click on your Linux release (eg. Ubuntu) to open the command window; it should display the command line for the root user:

root@YOUR-PC-NAME:~#

- Now you have admin powers, if you type for example whoami and press enter, you will be identified as root
- Type the following command to identify the exact USERNAME listed in the home directory: ls /home

6. Type the following command and press enter, then at the prompt insert New password and then Retype it then press enter

passwd USERNAME

- Note that the password won't show as typed, cursor won't move, but you will be typing it nonetheless

7. Upon entering the new password twice you will be prompted with a message and you will be back at the Linux cursor:

passwd: password updated successfully
root@YOUR-PC-NAME:~#

- Now what remains to do is to change back from root to your normal user

8. Close the Linux command window and activate the CMD window from step 4 which we left open, then retype the command from step 4 replacing the user root with your username, then press enter

ubuntu config --default-user USERNAME

- Once again, there will be an empty row then it will reload the normal CMD path and prompt, eg: C:\Users\WindowsUserName>

If you open start and click on your Linux release (eg. Ubuntu) it should display the command line for your user:

USERNAME@YOUR-PC-NAME:~#


Now whatever sudo command you want to run, you will have a changed password.


Source:


_______________________________________


pus acum 1 an
   
Pagini: 1  

Mergi la