How do you change the root password on Debian?

Clash Royale CLAN TAG#URR8PPP
up vote
37
down vote
favorite
I want to change the password I assigned to root on my Debian webserver to something longer and more secure.
How do I do that? I havenâÂÂt forgotten/lost the current password, I just want to change it.
debian root password
add a comment |Â
up vote
37
down vote
favorite
I want to change the password I assigned to root on my Debian webserver to something longer and more secure.
How do I do that? I havenâÂÂt forgotten/lost the current password, I just want to change it.
debian root password
4
To find this out for yourself, runapropos password: you'll get a list of commands that contain âÂÂpasswordâ in their short description. You can narrow the search a little withapropos -s 1 password:-s 1restricts to section 1 of the manual, which contains user commands.
â Gilles
Mar 25 '11 at 19:55
@Gilles: thatâÂÂs fantastic, I had no idea.
â Paul D. Waite
Mar 25 '11 at 20:01
Have you considered, instead,sudo.
â ctrl-alt-delor
Sep 6 at 17:48
add a comment |Â
up vote
37
down vote
favorite
up vote
37
down vote
favorite
I want to change the password I assigned to root on my Debian webserver to something longer and more secure.
How do I do that? I havenâÂÂt forgotten/lost the current password, I just want to change it.
debian root password
I want to change the password I assigned to root on my Debian webserver to something longer and more secure.
How do I do that? I havenâÂÂt forgotten/lost the current password, I just want to change it.
debian root password
debian root password
edited Aug 21 at 3:22
Rui F Ribeiro
36.7k1271116
36.7k1271116
asked Mar 25 '11 at 14:08
Paul D. Waite
1,53241520
1,53241520
4
To find this out for yourself, runapropos password: you'll get a list of commands that contain âÂÂpasswordâ in their short description. You can narrow the search a little withapropos -s 1 password:-s 1restricts to section 1 of the manual, which contains user commands.
â Gilles
Mar 25 '11 at 19:55
@Gilles: thatâÂÂs fantastic, I had no idea.
â Paul D. Waite
Mar 25 '11 at 20:01
Have you considered, instead,sudo.
â ctrl-alt-delor
Sep 6 at 17:48
add a comment |Â
4
To find this out for yourself, runapropos password: you'll get a list of commands that contain âÂÂpasswordâ in their short description. You can narrow the search a little withapropos -s 1 password:-s 1restricts to section 1 of the manual, which contains user commands.
â Gilles
Mar 25 '11 at 19:55
@Gilles: thatâÂÂs fantastic, I had no idea.
â Paul D. Waite
Mar 25 '11 at 20:01
Have you considered, instead,sudo.
â ctrl-alt-delor
Sep 6 at 17:48
4
4
To find this out for yourself, run
apropos password: you'll get a list of commands that contain âÂÂpasswordâ in their short description. You can narrow the search a little with apropos -s 1 password: -s 1 restricts to section 1 of the manual, which contains user commands.â Gilles
Mar 25 '11 at 19:55
To find this out for yourself, run
apropos password: you'll get a list of commands that contain âÂÂpasswordâ in their short description. You can narrow the search a little with apropos -s 1 password: -s 1 restricts to section 1 of the manual, which contains user commands.â Gilles
Mar 25 '11 at 19:55
@Gilles: thatâÂÂs fantastic, I had no idea.
â Paul D. Waite
Mar 25 '11 at 20:01
@Gilles: thatâÂÂs fantastic, I had no idea.
â Paul D. Waite
Mar 25 '11 at 20:01
Have you considered, instead,
sudo.â ctrl-alt-delor
Sep 6 at 17:48
Have you considered, instead,
sudo.â ctrl-alt-delor
Sep 6 at 17:48
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
67
down vote
accepted
Ah, use the passwd program as root:
sudo passwd root
Or, if youâÂÂre running as root already (which you shouldnâÂÂt be), just:
passwd
The root argument can be omitted, because when you execute passwd it defaults to the current user (which is root, as only root can change the root password).
1
Obvious in hindsight, really. :)
â Shadur
Mar 25 '11 at 14:15
@Shadur: painfully :) IâÂÂd just never done it before, and the Google links I found first were for folks who had forgotten the root password.
â Paul D. Waite
Mar 25 '11 at 14:18
1
Should besudo passwd, or just plainpasswdif you are running with root privileges.
â phunehehe
Mar 25 '11 at 14:33
1
@Paul I took liberty in editing your answer. There are a few ways to run things as root, and whenpasswdis run as root, it defaults to modify therootuser.
â phunehehe
Mar 25 '11 at 16:11
1
@Katerberg You can just use su -c "passwd"
â 12431234123412341234123
Nov 16 '16 at 15:27
 |Â
show 7 more comments
up vote
4
down vote
If you're going to be doing a lot of command-line administration, you might find it useful to check out the man pages for usermod(8), chfn(1), chsh(1), passwd(1), crypt(3), gpasswd(8), groupadd(8),
add a comment |Â
up vote
-2
down vote
You have to boot in Recovery Mode before using Paul D. Waite's suggestion:
- Right after booting your Debian system choose "boot in Recovery Mode"
Right after booting into "Recovery Mode" right at the command prompt simply
type:sudo password rootthen the system will ask for the new Root's password once and twice to verify and you ARE done.
âÂÂYou have to boot in Recovery Mode before using Paul D. Waite's suggestionâ â Really? I donâÂÂt remember doing that. Is this a new thing in a new version of Debian?
â Paul D. Waite
Sep 17 '14 at 15:56
add a comment |Â
protected by Community⦠Sep 6 at 19:11
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
67
down vote
accepted
Ah, use the passwd program as root:
sudo passwd root
Or, if youâÂÂre running as root already (which you shouldnâÂÂt be), just:
passwd
The root argument can be omitted, because when you execute passwd it defaults to the current user (which is root, as only root can change the root password).
1
Obvious in hindsight, really. :)
â Shadur
Mar 25 '11 at 14:15
@Shadur: painfully :) IâÂÂd just never done it before, and the Google links I found first were for folks who had forgotten the root password.
â Paul D. Waite
Mar 25 '11 at 14:18
1
Should besudo passwd, or just plainpasswdif you are running with root privileges.
â phunehehe
Mar 25 '11 at 14:33
1
@Paul I took liberty in editing your answer. There are a few ways to run things as root, and whenpasswdis run as root, it defaults to modify therootuser.
â phunehehe
Mar 25 '11 at 16:11
1
@Katerberg You can just use su -c "passwd"
â 12431234123412341234123
Nov 16 '16 at 15:27
 |Â
show 7 more comments
up vote
67
down vote
accepted
Ah, use the passwd program as root:
sudo passwd root
Or, if youâÂÂre running as root already (which you shouldnâÂÂt be), just:
passwd
The root argument can be omitted, because when you execute passwd it defaults to the current user (which is root, as only root can change the root password).
1
Obvious in hindsight, really. :)
â Shadur
Mar 25 '11 at 14:15
@Shadur: painfully :) IâÂÂd just never done it before, and the Google links I found first were for folks who had forgotten the root password.
â Paul D. Waite
Mar 25 '11 at 14:18
1
Should besudo passwd, or just plainpasswdif you are running with root privileges.
â phunehehe
Mar 25 '11 at 14:33
1
@Paul I took liberty in editing your answer. There are a few ways to run things as root, and whenpasswdis run as root, it defaults to modify therootuser.
â phunehehe
Mar 25 '11 at 16:11
1
@Katerberg You can just use su -c "passwd"
â 12431234123412341234123
Nov 16 '16 at 15:27
 |Â
show 7 more comments
up vote
67
down vote
accepted
up vote
67
down vote
accepted
Ah, use the passwd program as root:
sudo passwd root
Or, if youâÂÂre running as root already (which you shouldnâÂÂt be), just:
passwd
The root argument can be omitted, because when you execute passwd it defaults to the current user (which is root, as only root can change the root password).
Ah, use the passwd program as root:
sudo passwd root
Or, if youâÂÂre running as root already (which you shouldnâÂÂt be), just:
passwd
The root argument can be omitted, because when you execute passwd it defaults to the current user (which is root, as only root can change the root password).
edited Apr 13 '17 at 12:36
Communityâ¦
1
1
answered Mar 25 '11 at 14:08
Paul D. Waite
1,53241520
1,53241520
1
Obvious in hindsight, really. :)
â Shadur
Mar 25 '11 at 14:15
@Shadur: painfully :) IâÂÂd just never done it before, and the Google links I found first were for folks who had forgotten the root password.
â Paul D. Waite
Mar 25 '11 at 14:18
1
Should besudo passwd, or just plainpasswdif you are running with root privileges.
â phunehehe
Mar 25 '11 at 14:33
1
@Paul I took liberty in editing your answer. There are a few ways to run things as root, and whenpasswdis run as root, it defaults to modify therootuser.
â phunehehe
Mar 25 '11 at 16:11
1
@Katerberg You can just use su -c "passwd"
â 12431234123412341234123
Nov 16 '16 at 15:27
 |Â
show 7 more comments
1
Obvious in hindsight, really. :)
â Shadur
Mar 25 '11 at 14:15
@Shadur: painfully :) IâÂÂd just never done it before, and the Google links I found first were for folks who had forgotten the root password.
â Paul D. Waite
Mar 25 '11 at 14:18
1
Should besudo passwd, or just plainpasswdif you are running with root privileges.
â phunehehe
Mar 25 '11 at 14:33
1
@Paul I took liberty in editing your answer. There are a few ways to run things as root, and whenpasswdis run as root, it defaults to modify therootuser.
â phunehehe
Mar 25 '11 at 16:11
1
@Katerberg You can just use su -c "passwd"
â 12431234123412341234123
Nov 16 '16 at 15:27
1
1
Obvious in hindsight, really. :)
â Shadur
Mar 25 '11 at 14:15
Obvious in hindsight, really. :)
â Shadur
Mar 25 '11 at 14:15
@Shadur: painfully :) IâÂÂd just never done it before, and the Google links I found first were for folks who had forgotten the root password.
â Paul D. Waite
Mar 25 '11 at 14:18
@Shadur: painfully :) IâÂÂd just never done it before, and the Google links I found first were for folks who had forgotten the root password.
â Paul D. Waite
Mar 25 '11 at 14:18
1
1
Should be
sudo passwd, or just plain passwd if you are running with root privileges.â phunehehe
Mar 25 '11 at 14:33
Should be
sudo passwd, or just plain passwd if you are running with root privileges.â phunehehe
Mar 25 '11 at 14:33
1
1
@Paul I took liberty in editing your answer. There are a few ways to run things as root, and when
passwd is run as root, it defaults to modify the root user.â phunehehe
Mar 25 '11 at 16:11
@Paul I took liberty in editing your answer. There are a few ways to run things as root, and when
passwd is run as root, it defaults to modify the root user.â phunehehe
Mar 25 '11 at 16:11
1
1
@Katerberg You can just use su -c "passwd"
â 12431234123412341234123
Nov 16 '16 at 15:27
@Katerberg You can just use su -c "passwd"
â 12431234123412341234123
Nov 16 '16 at 15:27
 |Â
show 7 more comments
up vote
4
down vote
If you're going to be doing a lot of command-line administration, you might find it useful to check out the man pages for usermod(8), chfn(1), chsh(1), passwd(1), crypt(3), gpasswd(8), groupadd(8),
add a comment |Â
up vote
4
down vote
If you're going to be doing a lot of command-line administration, you might find it useful to check out the man pages for usermod(8), chfn(1), chsh(1), passwd(1), crypt(3), gpasswd(8), groupadd(8),
add a comment |Â
up vote
4
down vote
up vote
4
down vote
If you're going to be doing a lot of command-line administration, you might find it useful to check out the man pages for usermod(8), chfn(1), chsh(1), passwd(1), crypt(3), gpasswd(8), groupadd(8),
If you're going to be doing a lot of command-line administration, you might find it useful to check out the man pages for usermod(8), chfn(1), chsh(1), passwd(1), crypt(3), gpasswd(8), groupadd(8),
answered Mar 25 '11 at 20:30
Phil Lello
1413
1413
add a comment |Â
add a comment |Â
up vote
-2
down vote
You have to boot in Recovery Mode before using Paul D. Waite's suggestion:
- Right after booting your Debian system choose "boot in Recovery Mode"
Right after booting into "Recovery Mode" right at the command prompt simply
type:sudo password rootthen the system will ask for the new Root's password once and twice to verify and you ARE done.
âÂÂYou have to boot in Recovery Mode before using Paul D. Waite's suggestionâ â Really? I donâÂÂt remember doing that. Is this a new thing in a new version of Debian?
â Paul D. Waite
Sep 17 '14 at 15:56
add a comment |Â
up vote
-2
down vote
You have to boot in Recovery Mode before using Paul D. Waite's suggestion:
- Right after booting your Debian system choose "boot in Recovery Mode"
Right after booting into "Recovery Mode" right at the command prompt simply
type:sudo password rootthen the system will ask for the new Root's password once and twice to verify and you ARE done.
âÂÂYou have to boot in Recovery Mode before using Paul D. Waite's suggestionâ â Really? I donâÂÂt remember doing that. Is this a new thing in a new version of Debian?
â Paul D. Waite
Sep 17 '14 at 15:56
add a comment |Â
up vote
-2
down vote
up vote
-2
down vote
You have to boot in Recovery Mode before using Paul D. Waite's suggestion:
- Right after booting your Debian system choose "boot in Recovery Mode"
Right after booting into "Recovery Mode" right at the command prompt simply
type:sudo password rootthen the system will ask for the new Root's password once and twice to verify and you ARE done.
You have to boot in Recovery Mode before using Paul D. Waite's suggestion:
- Right after booting your Debian system choose "boot in Recovery Mode"
Right after booting into "Recovery Mode" right at the command prompt simply
type:sudo password rootthen the system will ask for the new Root's password once and twice to verify and you ARE done.
edited Sep 16 '14 at 5:20
Anthon
58.8k1796159
58.8k1796159
answered Sep 16 '14 at 5:12
Juan Blanco
1
1
âÂÂYou have to boot in Recovery Mode before using Paul D. Waite's suggestionâ â Really? I donâÂÂt remember doing that. Is this a new thing in a new version of Debian?
â Paul D. Waite
Sep 17 '14 at 15:56
add a comment |Â
âÂÂYou have to boot in Recovery Mode before using Paul D. Waite's suggestionâ â Really? I donâÂÂt remember doing that. Is this a new thing in a new version of Debian?
â Paul D. Waite
Sep 17 '14 at 15:56
âÂÂYou have to boot in Recovery Mode before using Paul D. Waite's suggestionâ â Really? I donâÂÂt remember doing that. Is this a new thing in a new version of Debian?
â Paul D. Waite
Sep 17 '14 at 15:56
âÂÂYou have to boot in Recovery Mode before using Paul D. Waite's suggestionâ â Really? I donâÂÂt remember doing that. Is this a new thing in a new version of Debian?
â Paul D. Waite
Sep 17 '14 at 15:56
add a comment |Â
protected by Community⦠Sep 6 at 19:11
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
4
To find this out for yourself, run
apropos password: you'll get a list of commands that contain âÂÂpasswordâ in their short description. You can narrow the search a little withapropos -s 1 password:-s 1restricts to section 1 of the manual, which contains user commands.â Gilles
Mar 25 '11 at 19:55
@Gilles: thatâÂÂs fantastic, I had no idea.
â Paul D. Waite
Mar 25 '11 at 20:01
Have you considered, instead,
sudo.â ctrl-alt-delor
Sep 6 at 17:48