Client Area →
Hosting Insights

Change Linux Server Root Password

TS

TOSHOST Team

Sep 12, 2017 · 3 min read

Change Linux Server Root Password

When a new server comes online and if you get it from us or any provider they give you a root access and When you start using your server then one of the first things you'll notice is if you have ssh running and are exposed to the outside world is that you'll probably log attempts by hackers to guess your username/password. Typically a hacker will scan for port 22 (the default port on which ssh listens) to find machines with ssh running, and then attempt a brute-force attack against it. With strong passwords in place, hopefully, any attack will be logged and noticed before it can succeed. Now we discuss how to change passwords via SSH in Linux/Centos/Almalinux/Ubunutu  

First, you need to log in SSH to your Linux server, then use command passwd to change the password. Below example is change root password for a Centos:

-bash-3.2# su - root  - you don't need to do this if you already login ssh as root
[root @ ComfortVPS.com ~]# passwd root - usage: passwd <accountName> , passwd root means change password for accountname root
Changing password for user root.
New UNIX password:   (You should type your new password here)
Retype new UNIX password:   (You should retype your new password again)
passwd: all authentication tokens updated successfully.

Done, you have successfully changed your password!

➤ Check Also: How to change Hostname in Linux server!

SSH Change password Failed example:

[root @ toshost.com ~]# passwd
Changing password for user root.
New UNIX password: 
BAD PASSWORD: it is WAY too short
Retype new UNIX password: 
Sorry, passwords do not match.
New UNIX password: 
Retype new UNIX password: 
Sorry, passwords do not match.
New UNIX password: 
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password: 
Sorry, passwords do not match.
passwd: Authentication information cannot be recovered

Hopefully, you already use strong passwords, but if you are not then try to choose passwords that contain:

  • Minimum of 8 characters
  • Mix of upper and lower case letters
  • Mix of letters and numbers
  • Non alphanumeric characters (e.g. special characters such as ! " £ $ % ^ etc)

If you are a TOS HOST client and if you forgot your root password of VPS or Dedicated server then consider to open a support ticket and waiting a few moments for get your reply.

Put this into practice today

Launch on fast, managed, DDoS-protected hosting — free migration, free SSL, 30-day guarantee.

Ready to make your website faster?

Launch on managed, DDoS-protected hosting today — free migration, free SSL, and a 30-day money-back guarantee.