Changing the password of a VPS install the operating system Centos, Ubuntu, Debian is actually very easy to understand and implement, in fact, changing the password of a VPS Linux is even faster than changing the password of a VPS Windows. Below is an article on how to change Linux VPS passwords in the easiest-to-understand ways.
Of course, in order to change the password of VPS Linux, first of all, you must have the right to access VPS Linux by logging into VPS Linux. If you do not know how to log into VPS Linux, you can see the article on instructions for logging into a Linux VPS then come back to this article.
Talking about changing the Linux VPS password, because the Linux environment allows the creation of many users and the user named ROOT is the person with the highest level of rights in the VPS.
Therefore, you can change the password for the root user or guest user depending on your choice, and do as below.
Why Change Your VPS Linux Password?
Changing your VPS password regularly is crucial for maintaining security. It helps:
- Prevent unauthorized access.
- Mitigate the risk of brute-force attacks.
- Secure your sensitive data.
Prerequisites
Before we start, ensure you have:
- SSH access to your VPS.
- Administrative privileges (root access or sudo user).
Change the password for user Root in VPS Linux
To set a new password for the root user, type in the Cmd or SSH console the following:
sudo passwd root
Note: root above is the username in VPS, if you change the password for yourself, just enter the following command :
passwd
The screen displays a new line New Password: Now please enter a new strong password here. Note, on Linux when entering a password it will not be displayed on the screen for you to see (for security reasons) so it’s best to type it out in a text file and then Copy and right-click on the cmd interface, SSH to paste the password. This will reduce errors when typing the password directly.
In the Retype new password: You continue to re-enter the password or continue to -click to paste the password to confirm. The following image will illustrate the above operations.
If you enter the new password twice as described and receive the message “all authentication tokens updated successfully,” congratulations, you have successfully changed your Linux VPS password.
Change the password for any user in VPS Linux
If your VPS Linux has multiple users, you have root privileges, and you want to change the password for a user with the login name userName, do the following:
Still on the Cmd or SSH control panel, you type the following command line:
sudo passwd userName
Please remember to replace userName with the username you want to change the VPS password for. If you enter the correct username, Linux will allow you to change the password in a similar way as above. You enter your password in New password and continue re-entering your password in Retype new password and you’re done.
How to remove a user’s password in VPS Linux
If your VPS Linux has multiple users, you have root privileges, and you want to delete the password of a specific user, this is the solution. We can delete the user’s password and make it empty. This is a quick way to disable the password for the account. For example, to set the user with the account name ‘vivek’ to have no password, type the following command:
sudo passwd -d vivek
Remember to change Vivek above with the username you want. Even root is fine, but it’s best not to leave the root password blank for VPS security reasons.
Additional Tips for Securing Your VPS
- Use Strong Passwords: Ensure your new password is strong, containing a mix of uppercase, lowercase, numbers, and special characters.
- Regular Updates: Regularly update your system and installed packages to protect against vulnerabilities.
- Enable SSH Key Authentication: For added security, use SSH key authentication instead of passwords.
Conclusion
Changing your VPS Linux password on CentOS, Ubuntu, or any other distribution is a simple yet essential task for maintaining server security. By following the steps outlined in this guide, you can ensure your VPS remains secure. Always use strong passwords and consider additional security measures to further protect your server.
For more tips and tutorials on VPS management and Linux administration, stay tuned to our blog. If you have any questions or need further assistance, feel free to reach out to our support team.
CATEGORY:Linux VPS