Unable to change the root password in Windows 10 WSL
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
4
down vote
favorite
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.
windows windows-subsystem-for-linux
add a comment |Â
up vote
4
down vote
favorite
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.
windows windows-subsystem-for-linux
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
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
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.
windows windows-subsystem-for-linux
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.
windows windows-subsystem-for-linux
asked Jul 4 '17 at 15:31
![](https://i.stack.imgur.com/uy9sl.jpg?s=32&g=1)
![](https://i.stack.imgur.com/uy9sl.jpg?s=32&g=1)
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
add a comment |Â
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
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
5
down vote
accepted
- in wsl,
sudo passwd
will change the password of the WSL root user. - in wsl,
passwd
will change the password of the current WSL user - in wsl,
passwd [user]
will change the password of any WSL user - in wsl,
sudo
generally asks for the password of the current WSL user. - 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]
- creators update and earlier:
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
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
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
- in wsl,
sudo passwd
will change the password of the WSL root user. - in wsl,
passwd
will change the password of the current WSL user - in wsl,
passwd [user]
will change the password of any WSL user - in wsl,
sudo
generally asks for the password of the current WSL user. - 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]
- creators update and earlier:
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
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
add a comment |Â
up vote
5
down vote
accepted
- in wsl,
sudo passwd
will change the password of the WSL root user. - in wsl,
passwd
will change the password of the current WSL user - in wsl,
passwd [user]
will change the password of any WSL user - in wsl,
sudo
generally asks for the password of the current WSL user. - 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]
- creators update and earlier:
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
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
add a comment |Â
up vote
5
down vote
accepted
up vote
5
down vote
accepted
- in wsl,
sudo passwd
will change the password of the WSL root user. - in wsl,
passwd
will change the password of the current WSL user - in wsl,
passwd [user]
will change the password of any WSL user - in wsl,
sudo
generally asks for the password of the current WSL user. - 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]
- creators update and earlier:
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
- in wsl,
sudo passwd
will change the password of the WSL root user. - in wsl,
passwd
will change the password of the current WSL user - in wsl,
passwd [user]
will change the password of any WSL user - in wsl,
sudo
generally asks for the password of the current WSL user. - 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]
- creators update and earlier:
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
edited Nov 9 '17 at 16:11
answered Jul 5 '17 at 7:01
![](https://i.stack.imgur.com/ejI23.png?s=32&g=1)
![](https://i.stack.imgur.com/ejI23.png?s=32&g=1)
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
add a comment |Â
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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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