How to Change the Root Password in Linux

Press Ctrl+Alt+T to open a terminal window.As long as you know the current root password, you can change it right from the desktop., Type su at the command prompt, then hit ↵ Enter.A new line will open beneath the command prompt that says...

13 Steps 1 min read Medium

Step-by-Step Guide

  1. Step 1: Press Ctrl+Alt+T to open a terminal window.As long as you know the current root password

    This keyboard shortcut will open a new terminal window with a command prompt in all Linux desktop environments.

    If you don’t have the current root password, see this method.

    If you’re not using a desktop environment, you’re already at a command prompt, so just continue to the next step.
  2. Step 2: you can change it right from the desktop.

    , When the password is accepted, you’ll be brought back to the command prompt as the root user.

    If you type the password incorrectly, just run su again and retry.

    Passwords are case-sensitive. , A new line will open beneath the command that says, “Enter new UNIX password:” , The password you type will not appear on the screen, but you’ll be prompted to type it a second time to confirm. , You will see a message that says “password updated successfully.” , This will log you out of the root account.
  3. Step 3: Type su at the command prompt

  4. Step 4: then hit ↵ Enter.A new line will open beneath the command prompt that says “Password:”

  5. Step 5: Type the current root password

  6. Step 6: then press ↵ Enter.

  7. Step 7: Type passwd

  8. Step 8: then press ↵ Enter.

  9. Step 9: Type a new password

  10. Step 10: then press ↵ Enter.

  11. Step 11: Retype the new password

  12. Step 12: then press ↵ Enter.

  13. Step 13: Type exit and then press ↵ Enter.

Detailed Guide

This keyboard shortcut will open a new terminal window with a command prompt in all Linux desktop environments.

If you don’t have the current root password, see this method.

If you’re not using a desktop environment, you’re already at a command prompt, so just continue to the next step.

, When the password is accepted, you’ll be brought back to the command prompt as the root user.

If you type the password incorrectly, just run su again and retry.

Passwords are case-sensitive. , A new line will open beneath the command that says, “Enter new UNIX password:” , The password you type will not appear on the screen, but you’ll be prompted to type it a second time to confirm. , You will see a message that says “password updated successfully.” , This will log you out of the root account.

About the Author

S

Sarah Cole

Committed to making pet care accessible and understandable for everyone.

93 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: