Change Linux Server Root Password

blog background image

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 

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.

Related Blog Post

Create, collaborate, and turn your ideas into incredible products with the definitive platform for digital design.

How to create cPanel backup from command line

12 December 2022

How to create cPanel backup from command line

This article explains how you can create cPanel backup from the command line, using your own username and password.

Read More
How to install Webuzo Panel on linux Server

12 December 2022

How to install Webuzo Panel on linux Server

Webuzo is a popular alternative to cPanel, a widely used web hosting control panel developed by cPanel, Inc.

Read More
What are NFT Domains?

02 February 2022

What are NFT Domains?

NFT domains are new web extensions that are deployed using ERC 721 and Polygon Network, except .zil which uses Zilliqa.

Read More
How to Delete a MySQL® Database

01 January 2022

How to Delete a MySQL® Database

This document describes how to manually delete a MySQL® database from a cPanel & WHM server. This is useful if, for exa

Read More
How to get Transfer Authorization Code from GoDaddy

11 November 2021

How to get Transfer Authorization Code from GoDaddy

To transfer your domain with us then must need EPP Code.

Read More

Got a question!

Contact us at