How do you connect to a remote Linux server via SSH?
Run ssh user@host — SSH (Secure Shell) opens an encrypted connection and drops you into a shell on the remote machine as if you were sitting at it.
SSH is the standard way to administer Linux servers, which usually have no GUI and live in a datacentre you'll never physically touch. Everything between you and the server is encrypted, so even on an untrusted network nobody can read your commands or the server's responses.
ssh student@192.168.1.100 # connect as 'student' to that host
ssh -i key.pem user@hostname # authenticate with a specific private key
You prove who you are in one of two ways:
| Method | Notes |
|---|---|
| Password | The server prompts for the account's password — simple, but phishable/brute-forceable. |
| Key pair | You hold a secret private key; the server holds the matching public key. No password crosses the wire, and it can't be brute-forced. Preferred for automation and production. |
The very first time you connect to a host you'll see:
The authenticity of host 'server' can't be established.
Are you sure you want to continue connecting (yes/no)?
This isn't noise — it's SSH showing you the server's fingerprint and asking you to vouch for it. Saying yes pins that fingerprint in ~/.ssh/known_hosts. Gotcha: if that same warning reappears later for a host you've already trusted, the key changed — it could be a reinstalled server, or it could be a man-in-the-middle attack. Don't blindly accept it; find out why.
Go deeper:
ssh(1) — OpenSSH client man page — authoritative reference for
ssh user@host, the-ikey option, and host-key verification.