SSH (Secure Shell) is the standard protocol for encrypted, authenticated access to remote Unix systems. It replaces the older, plaintext telnet, rlogin, and rsh, which sent passwords and data in the clear over the network. Virtually every Linux server on the Internet has an SSH daemon running on port 22, and virtually every Linux administrator begins their day by SSHing into one.
ssh user@host # connect
ssh -p 2222 user@host # non-default port
ssh -i ~/.ssh/id_ed25519 user@host # specific key
ssh -L 8080:localhost:80 user@host # local port forward
ssh -R 8080:localhost:80 user@host # remote port forward
ssh -D 1080 user@host # dynamic SOCKS proxy
ssh -J jumphost user@target # proxy jump
ssh user@host 'uptime; df -h' # one-shot command
Configuration lives in ~/.ssh/config for per-user aliases and defaults, and /etc/ssh/sshd_config on the server. Authentication uses passwords or public-key cryptography; key-based authentication is strongly preferred (and often required) because it is resistant to brute force.
Beyond interactive login, SSH is the transport for scp, sftp, rsync over ssh, git over ssh, and ansible. It is the Swiss Army knife of remote Linux work, and mastering it—config files, key management, agent forwarding, jump hosts—pays off many times over.
Discussed in:
- Chapter 12: Networking — SSH: The Most Important Command
Also defined in: Textbook of Linux