Getting startedWritten by GLWS7 min readUbuntu 24.04 LTS / AlmaLinux 9
Commands run on your server unless a section says otherwise. Replace example usernames, addresses and paths with your own values. Keep a working session open when changing remote access.

Before you connect

You need your server's IP address, SSH port, login username, and either a password or the private key matching an installed public key. These details come from the server administrator or your provider's provisioning information. An operating system image may use an account such as ubuntu or almalinux; there is no universal VPS username.

Run the following check on your own computer. Windows users can use PowerShell; macOS and most Linux desktops include an SSH client. If Ubuntu does not have one, install the openssh-client package locally. This guide applies when the destination runs Ubuntu 24.04 LTS or AlmaLinux 9.

Check the SSH client on your computer
ssh -V

Open the connection

Replace admin and 203.0.113.10 with your actual account and server address. The address shown here is reserved for documentation and will not connect to your VPS. SSH uses port 22 unless the server has a different listening port.

Run one of these examples on your computer. Use the second form only when your connection details explicitly specify port 2222; substitute your actual port if it differs.

Server using the default SSH port
ssh [email protected]
Server using a custom SSH port
ssh -p 2222 [email protected]

Verify the server and authenticate

On your first connection, SSH displays a host-key fingerprint. Compare it with a fingerprint obtained from the administrator or through a trusted server console before accepting it. This identifies the server, while your password or key identifies you.

Password entry intentionally displays no characters. Type the password and press Enter. For key authentication, supply the local path to your private key; a passphrase prompt unlocks that local key. Never upload or paste the private key into a website.

Connect using a private key and default port
ssh -i ~/.ssh/id_ed25519 [email protected]
A changed host-key warning can follow a server reinstall, but it can also indicate a different server. Verify the new fingerprint before changing your saved host-key record.

Confirm which machine you reached

After login, your prompt belongs to the remote server. Check the current account, hostname, and operating system before running administrative commands. Expect whoami to show the username you requested, and the operating system information to match your intended installation.

Run on the remote server
whoami
hostname
cat /etc/os-release

Disconnect and troubleshoot

Use exit to return to your computer's terminal. A connection timeout usually points to an incorrect address, port, routing problem, or firewall. Connection refused means the destination responded but no service accepted that connection. Permission denied means authentication failed; check the username and credential first. Adding -v to your SSH command displays connection diagnostics.

End the remote session
exit

Official documentation

These upstream references provide more detail on the commands and workflows in this guide.

Your first VPS: Next lesson: Create and test an administrator account. View all nine lessons.