Z
ZetrikCloud Docs
⌘K
Support Dashboard
Server Management

Change Password — Ubuntu

The same core command as AlmaLinux, with Ubuntu's sudo conventions if you're logged in as a non-root user.

1

Connect to your VPS via SSH

Log in to your Ubuntu VPS using PuTTY or your preferred SSH client.

2

Run the passwd command

If you're logged in as root, run the command directly. If you're logged in as a regular user, prefix it with sudo:

bash
# As root
passwd

# As a sudo-enabled user, changing your own password
sudo passwd $USER

# As a sudo-enabled user, changing another user's password
sudo passwd username
3

Enter and confirm the new password

Type the new password when prompted, then retype it to confirm. Ubuntu will show a success message once it's updated.

output
New password: 
Retype new password: 
passwd: password updated successfully

Ubuntu's password policy (via PAM) may reject passwords that are too short or based on dictionary words. If rejected, try a longer, more random password.

Test your new password in a fresh SSH session before closing your current one, to avoid getting locked out of your VPS.