How to Change Password in Linux?

Setting up a strong password is always recommended to manage the security of control panel or any management panel. So, it is important to have a strong password whether you are cPanel user or having multiple cPanel users. Today, in this tutorial we will go through in detail procedure to change password in Linux via SSH.

Change Password in Linux
Change Password in Linux

In the tutorial, we will discuss about the following.

#1. How to Change password as user via SSH?
#2. How to Change password as root user?
#3. How to Manage Force Password Change via SSH?

Let us go through the procedure in detail.

#1. How to Change password as user via SSH?

You can easily change the password of your cPanel account if you are having shell access by following the below mentioned steps.

  • Login to SSH with the required credentials.
  • Execute the below given command.
passwd
  • It will ask you to enter your current password.
  • After entering your old or existing password it prompts to enter the New Password and then Confirm it.

It will prints an output as:

[test@server1 ~]$ passwd
Changing password for the user “test” …
Changing password for “test”.
Current UNIX password:
New UNIX password:
Retype new UNIX password:
  • When you Re-type the New Password, you will receive a confirmation message.

*When you are a user with root access, then you did not have to enter your current or old password.

#2. How to Change Password as root user?

As a root user, you have access to manage all the cPanel accounts hosted within your server. So, you can easily change the password of any account.

  • Login to SSH with root credentials.
  • Execute the below given command.
passwd [username]

*Replace the [username] with the cPanel username of which you want to change the password.

  • It will ask you to enter the New Password for the particular user and then Confirm.
  • After re-entering the password, you will receive a conformation message.
password updated successfully

#3. How to Manage Force Password Change via SSH?

Sometimes, it is required to forcefully change the password of any user, i.e, you want user to change the password. To do the same, you can simply use the following command.

  • Execute the following command from root terminal.
passwd --expire [username]

*Replace [username] with cPanel username of which you want force password change.

  • You will receive the following message of confirmation.
Expiring password for user abc.
passwd: Success

On the next login, user will see the following message.

The user must enter their current password and then create a new one to continue.

That’s all !

Hope the article better explains the procedure to change password in Linux via SSH. Do share it with your colleagues if you find it working. Drop your queries if you have and share your suggestions as well. Connect with us on social media pages.

Facebook Page: https://facebook.com/redserverhost                                                                                       Twitter Page: https://twitter.com/redserverhost.com

Scroll to Top