How to Change Passwords for Users on Linux

This guide explains how to change a user's password on a Linux server. Whether you use a Linux VPS or a dedicated server from Database Mart, you can follow these steps to update account credentials and maintain your server's security.

As a USA hosting provider, Database Mart offers server hosting solutions for Linux-based applications, websites, databases, and other workloads. Keeping server passwords secure is an important part of managing your hosting environment.

Step 1: Switch to the Root Account

Run the following command to switch to the root account:

sudo -i

sudo-i

This command opens a root shell, provided your current account has the required sudo privileges. On a Database Mart Linux hosting server, you may need to authenticate with your current user's password.

Step 2: Change the Password for a Specific User

Use the passwd command to change the password for a specific user:

passwd username

Replace username with the actual account name.

Examples:

passwd root
passwd administrator

To change your own password, run:

passwd

change password

The system will prompt you to enter the new password twice to confirm it.

When managing Linux VPS hosting or dedicated server hosting, use a strong, unique password and avoid sharing privileged credentials. If your server hosting environment supports SSH key authentication, consider using SSH keys for remote access as an additional security measure.

Step 3: Re-login to Verify the New Password

Log out of the current session and log in to the server again using the newly set password to confirm that it works.

If you connect remotely through SSH, open a new session and verify that the updated credentials work as expected. Keep an existing administrative session open until you have confirmed that you can log in successfully, where practical.

These steps help you maintain access to your Linux hosting environment and manage your server securely. Whether you operate a personal project or production workloads, Database Mart provides hosting infrastructure for customers who need control over their server configuration.

If you encounter issues changing your password or accessing your server, contact Database Mart Technical Support for assistance.

Last Updated:   10/30/2026
Outline