Beginner's Guide: Connecting to a Linux VPS via SSH

After getting a Linux VPS, the first step is to log in remotely over SSH. This guide walks you through it the simple way.

What you need

  • The server's public IP;
  • The login username (usually root or ubuntu);
  • A password or SSH key.

Option 1: password login

In a macOS/Linux terminal, or Windows PowerShell, type:

ssh root@your-ip

On first connect you'll confirm the fingerprint — type yes, then enter the password. Note the screen shows no characters as you type the password; that's normal.

Option 2: key login (more secure)

Generate a key pair locally: ssh-keygen -t ed25519, add the public key (.pub contents) to the server's ~/.ssh/authorized_keys, and log in without a password thereafter. Key login is safer than passwords and strongly recommended for production.

Common issues

  • Connection timeout: check the IP, that the server is on, and that local network/firewall allows port 22;
  • Permission denied: verify the username and password/key.

See "What to do when your VPS won't connect" for more troubleshooting.

本記事は SharkCloud 編集チームが AI を活用して作成し、人による確認を経て公開しています。