How To Change Root Password In Linux

How To Change Root Password In Linux
How To Change Root Password In Linux

In Linux and other Unix-like operating systems the user "root" is the system super-user. Similar to the administrator account(s) in Windows, root has complete control over the system. You can change the Root Password in Linux. Follow the simple steps below.

Log on as root. This can be achieved by typing "su" or "su root" at the terminal prompt.

Enter the current root password. Don't be alarmed if as you type nothing is displayed at the prompt. This is intentional for security reasons.

Type the command "passwd" at the root prompt.

Enter your new password and repeat it at the confirmation prompt.

Logout using the "exit" command.


Some distributions (such as Ubuntu) lack a root account by default. If you are given an error as you try to log in as root this may be the case.

It is very dangerous to stay logged in as root for an extended period of time. Log out immediately after completing this process.

Help Us Grow

If you like this post, please share it with your friends.

You are free to copy and redistribute this article in any medium or format, as long as you keep the links in the articles or provide a link back to this page.

Subscribe to our mailing list

You may also like...