Changing your root password on a CentOS server

You can change your root password on your CentOS server via SSH, with some simple commands;

1. First of all, log in to the server via SSH.
2. When logged in, if you are using the root user you just need to type:
sudo passwd root

If you already have root permissions, you will not need to type ‘sudo’. You can also change the ‘root’ to be a different user if you’ve set one up. If you type “passwd” alone, it will change the password for your current user. Here’s an example of a root user changing their own password with a shorter command:

Get in touch

If you need advice on CentOS, we’re here to help.

Call us on 0333 247 0222: Monday – Friday, 9am – 5.30pm.

Chat with us on LiveChat: Monday – Friday, 9am – 5.30pm.

Write to us: Send us a support ticket from your Simply portal and we’ll get back to you as soon as we can.

If you don’t have an account with Simply Hosting yet, you can also send our Sales team an enquiry and we’ll get back to you between 9am and 5.30pm, Monday to Friday.


Was this article helpful?

Related guides

Enabling Fail2Ban

  • 1
  • 1195
Once you have installed Fail2Ban, it needs to be enabled to start protecting specific services (daemons) of your server, so...