Unable to change the root password in Windows 10 WSL

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
4
down vote

favorite
1












I have tried both commands



sudo passwd


and



sudo -u root /bin/bash


But as soon as I enter the new password twice, it says password has been updated. You close the shell and open a new instance, it is still working on the old root password.



Please help.







share|improve this question



















  • you are likely confused about the difference between sudo and su, see askubuntu.com/questions/70534/…
    – anx
    Jul 5 '17 at 6:35











  • well sudo -u root can be a desperate attempt to get things working. but sudo passwd should change the password. and old one should not be required when i open a new WSL shell and try 'sudo apt-get install'
    – Dragonborn
    Jul 5 '17 at 6:48














up vote
4
down vote

favorite
1












I have tried both commands



sudo passwd


and



sudo -u root /bin/bash


But as soon as I enter the new password twice, it says password has been updated. You close the shell and open a new instance, it is still working on the old root password.



Please help.







share|improve this question



















  • you are likely confused about the difference between sudo and su, see askubuntu.com/questions/70534/…
    – anx
    Jul 5 '17 at 6:35











  • well sudo -u root can be a desperate attempt to get things working. but sudo passwd should change the password. and old one should not be required when i open a new WSL shell and try 'sudo apt-get install'
    – Dragonborn
    Jul 5 '17 at 6:48












up vote
4
down vote

favorite
1









up vote
4
down vote

favorite
1






1





I have tried both commands



sudo passwd


and



sudo -u root /bin/bash


But as soon as I enter the new password twice, it says password has been updated. You close the shell and open a new instance, it is still working on the old root password.



Please help.







share|improve this question











I have tried both commands



sudo passwd


and



sudo -u root /bin/bash


But as soon as I enter the new password twice, it says password has been updated. You close the shell and open a new instance, it is still working on the old root password.



Please help.









share|improve this question










share|improve this question




share|improve this question









asked Jul 4 '17 at 15:31









Dragonborn

12315




12315











  • you are likely confused about the difference between sudo and su, see askubuntu.com/questions/70534/…
    – anx
    Jul 5 '17 at 6:35











  • well sudo -u root can be a desperate attempt to get things working. but sudo passwd should change the password. and old one should not be required when i open a new WSL shell and try 'sudo apt-get install'
    – Dragonborn
    Jul 5 '17 at 6:48
















  • you are likely confused about the difference between sudo and su, see askubuntu.com/questions/70534/…
    – anx
    Jul 5 '17 at 6:35











  • well sudo -u root can be a desperate attempt to get things working. but sudo passwd should change the password. and old one should not be required when i open a new WSL shell and try 'sudo apt-get install'
    – Dragonborn
    Jul 5 '17 at 6:48















you are likely confused about the difference between sudo and su, see askubuntu.com/questions/70534/…
– anx
Jul 5 '17 at 6:35





you are likely confused about the difference between sudo and su, see askubuntu.com/questions/70534/…
– anx
Jul 5 '17 at 6:35













well sudo -u root can be a desperate attempt to get things working. but sudo passwd should change the password. and old one should not be required when i open a new WSL shell and try 'sudo apt-get install'
– Dragonborn
Jul 5 '17 at 6:48




well sudo -u root can be a desperate attempt to get things working. but sudo passwd should change the password. and old one should not be required when i open a new WSL shell and try 'sudo apt-get install'
– Dragonborn
Jul 5 '17 at 6:48










1 Answer
1






active

oldest

votes

















up vote
5
down vote



accepted










  1. in wsl, sudo passwd will change the password of the WSL root user.

  2. in wsl, passwd will change the password of the current WSL user

  3. in wsl, passwd [user] will change the password of any WSL user

  4. in wsl, sudo generally asks for the password of the current WSL user.

  5. in windows cmd.exe, youn can change what user you will login into when opening WSL - if that user is root, you will be able to use option 3.

    • creators update and earlier: lxrun /setdefaultuser [user]

    • fall creators update and later: ubuntu.exe config --default-user [user]


You probably want to change the password of the sudo-capable, non-root user.



You probably do not want to change the root users password (because in Ubuntu, the root user generally should not have a password, sudo should be used instead).
You probably also do not want to leave your default user as root. Even when working form windows, its still a bad practice.



Official Microsoft documentation on User Accounts and Permissions can be found here:
https://msdn.microsoft.com/en-us/commandline/wsl/user_support






share|improve this answer























  • yes am using a non-root as default user. this should work! thanks.
    – Dragonborn
    Jul 6 '17 at 7:24










  • lxrun /setdefaultuser no longer work :(
    – nowox
    Nov 9 '17 at 10:44










  • @nowox i have added the updated command to my answer. microsoft has updated their docs accordingly, you probably want to read the tutorial to understand how changing the default user can be (ab)used.
    – anx
    Nov 9 '17 at 15:45










  • lxrun /setdefaultuser [user] is working still in Windows 10, version 1709 (Fall Creators Update)
    – hrvoj3e
    Nov 26 '17 at 9:50










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f931940%2funable-to-change-the-root-password-in-windows-10-wsl%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
5
down vote



accepted










  1. in wsl, sudo passwd will change the password of the WSL root user.

  2. in wsl, passwd will change the password of the current WSL user

  3. in wsl, passwd [user] will change the password of any WSL user

  4. in wsl, sudo generally asks for the password of the current WSL user.

  5. in windows cmd.exe, youn can change what user you will login into when opening WSL - if that user is root, you will be able to use option 3.

    • creators update and earlier: lxrun /setdefaultuser [user]

    • fall creators update and later: ubuntu.exe config --default-user [user]


You probably want to change the password of the sudo-capable, non-root user.



You probably do not want to change the root users password (because in Ubuntu, the root user generally should not have a password, sudo should be used instead).
You probably also do not want to leave your default user as root. Even when working form windows, its still a bad practice.



Official Microsoft documentation on User Accounts and Permissions can be found here:
https://msdn.microsoft.com/en-us/commandline/wsl/user_support






share|improve this answer























  • yes am using a non-root as default user. this should work! thanks.
    – Dragonborn
    Jul 6 '17 at 7:24










  • lxrun /setdefaultuser no longer work :(
    – nowox
    Nov 9 '17 at 10:44










  • @nowox i have added the updated command to my answer. microsoft has updated their docs accordingly, you probably want to read the tutorial to understand how changing the default user can be (ab)used.
    – anx
    Nov 9 '17 at 15:45










  • lxrun /setdefaultuser [user] is working still in Windows 10, version 1709 (Fall Creators Update)
    – hrvoj3e
    Nov 26 '17 at 9:50














up vote
5
down vote



accepted










  1. in wsl, sudo passwd will change the password of the WSL root user.

  2. in wsl, passwd will change the password of the current WSL user

  3. in wsl, passwd [user] will change the password of any WSL user

  4. in wsl, sudo generally asks for the password of the current WSL user.

  5. in windows cmd.exe, youn can change what user you will login into when opening WSL - if that user is root, you will be able to use option 3.

    • creators update and earlier: lxrun /setdefaultuser [user]

    • fall creators update and later: ubuntu.exe config --default-user [user]


You probably want to change the password of the sudo-capable, non-root user.



You probably do not want to change the root users password (because in Ubuntu, the root user generally should not have a password, sudo should be used instead).
You probably also do not want to leave your default user as root. Even when working form windows, its still a bad practice.



Official Microsoft documentation on User Accounts and Permissions can be found here:
https://msdn.microsoft.com/en-us/commandline/wsl/user_support






share|improve this answer























  • yes am using a non-root as default user. this should work! thanks.
    – Dragonborn
    Jul 6 '17 at 7:24










  • lxrun /setdefaultuser no longer work :(
    – nowox
    Nov 9 '17 at 10:44










  • @nowox i have added the updated command to my answer. microsoft has updated their docs accordingly, you probably want to read the tutorial to understand how changing the default user can be (ab)used.
    – anx
    Nov 9 '17 at 15:45










  • lxrun /setdefaultuser [user] is working still in Windows 10, version 1709 (Fall Creators Update)
    – hrvoj3e
    Nov 26 '17 at 9:50












up vote
5
down vote



accepted







up vote
5
down vote



accepted






  1. in wsl, sudo passwd will change the password of the WSL root user.

  2. in wsl, passwd will change the password of the current WSL user

  3. in wsl, passwd [user] will change the password of any WSL user

  4. in wsl, sudo generally asks for the password of the current WSL user.

  5. in windows cmd.exe, youn can change what user you will login into when opening WSL - if that user is root, you will be able to use option 3.

    • creators update and earlier: lxrun /setdefaultuser [user]

    • fall creators update and later: ubuntu.exe config --default-user [user]


You probably want to change the password of the sudo-capable, non-root user.



You probably do not want to change the root users password (because in Ubuntu, the root user generally should not have a password, sudo should be used instead).
You probably also do not want to leave your default user as root. Even when working form windows, its still a bad practice.



Official Microsoft documentation on User Accounts and Permissions can be found here:
https://msdn.microsoft.com/en-us/commandline/wsl/user_support






share|improve this answer















  1. in wsl, sudo passwd will change the password of the WSL root user.

  2. in wsl, passwd will change the password of the current WSL user

  3. in wsl, passwd [user] will change the password of any WSL user

  4. in wsl, sudo generally asks for the password of the current WSL user.

  5. in windows cmd.exe, youn can change what user you will login into when opening WSL - if that user is root, you will be able to use option 3.

    • creators update and earlier: lxrun /setdefaultuser [user]

    • fall creators update and later: ubuntu.exe config --default-user [user]


You probably want to change the password of the sudo-capable, non-root user.



You probably do not want to change the root users password (because in Ubuntu, the root user generally should not have a password, sudo should be used instead).
You probably also do not want to leave your default user as root. Even when working form windows, its still a bad practice.



Official Microsoft documentation on User Accounts and Permissions can be found here:
https://msdn.microsoft.com/en-us/commandline/wsl/user_support







share|improve this answer















share|improve this answer



share|improve this answer








edited Nov 9 '17 at 16:11


























answered Jul 5 '17 at 7:01









anx

8961031




8961031











  • yes am using a non-root as default user. this should work! thanks.
    – Dragonborn
    Jul 6 '17 at 7:24










  • lxrun /setdefaultuser no longer work :(
    – nowox
    Nov 9 '17 at 10:44










  • @nowox i have added the updated command to my answer. microsoft has updated their docs accordingly, you probably want to read the tutorial to understand how changing the default user can be (ab)used.
    – anx
    Nov 9 '17 at 15:45










  • lxrun /setdefaultuser [user] is working still in Windows 10, version 1709 (Fall Creators Update)
    – hrvoj3e
    Nov 26 '17 at 9:50
















  • yes am using a non-root as default user. this should work! thanks.
    – Dragonborn
    Jul 6 '17 at 7:24










  • lxrun /setdefaultuser no longer work :(
    – nowox
    Nov 9 '17 at 10:44










  • @nowox i have added the updated command to my answer. microsoft has updated their docs accordingly, you probably want to read the tutorial to understand how changing the default user can be (ab)used.
    – anx
    Nov 9 '17 at 15:45










  • lxrun /setdefaultuser [user] is working still in Windows 10, version 1709 (Fall Creators Update)
    – hrvoj3e
    Nov 26 '17 at 9:50















yes am using a non-root as default user. this should work! thanks.
– Dragonborn
Jul 6 '17 at 7:24




yes am using a non-root as default user. this should work! thanks.
– Dragonborn
Jul 6 '17 at 7:24












lxrun /setdefaultuser no longer work :(
– nowox
Nov 9 '17 at 10:44




lxrun /setdefaultuser no longer work :(
– nowox
Nov 9 '17 at 10:44












@nowox i have added the updated command to my answer. microsoft has updated their docs accordingly, you probably want to read the tutorial to understand how changing the default user can be (ab)used.
– anx
Nov 9 '17 at 15:45




@nowox i have added the updated command to my answer. microsoft has updated their docs accordingly, you probably want to read the tutorial to understand how changing the default user can be (ab)used.
– anx
Nov 9 '17 at 15:45












lxrun /setdefaultuser [user] is working still in Windows 10, version 1709 (Fall Creators Update)
– hrvoj3e
Nov 26 '17 at 9:50




lxrun /setdefaultuser [user] is working still in Windows 10, version 1709 (Fall Creators Update)
– hrvoj3e
Nov 26 '17 at 9:50












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f931940%2funable-to-change-the-root-password-in-windows-10-wsl%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491