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.
ssh -VOpen 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.
ssh [email protected]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.
ssh -i ~/.ssh/id_ed25519 [email protected]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.
whoami
hostname
cat /etc/os-releaseDisconnect 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.
exitOfficial documentation
These upstream references provide more detail on the commands and workflows in this guide.