Edit Ubuntu password on Windows10

You installed Ubuntu on your Windows 10 through App Store ? Great ! But if you have a good memory, you know you type your user password. This one is needed for every single « sudo » instruction. Do you want to change this password without knowing the old one ? It’s very easy. No need to follow all the (very long) tutorial on the net with cryptic Windows command. Just go to this folder :

C:\Users\<yourusername>\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\etc

Edit file « shadow » and find the line with your username. Line is like this :

mylogin:$1$D5z55fgf$SDOizClhr1t8t4.:17687:0:99999:7:::

Password is encrypted and is the second field (separator is « : »).

Generate a new password with the following command :

openssl passwd -1 -salt ARandomString yourSuperPassword

Replace old password hash with the output. No need to reload anything, just type « sudo » with your user, you get prompted with a password, type « yourSuperPassword » and voilà !

 

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *