Networking // Remote Access
ssh
Encrypted remote shell — and a tunnel for everything else.
$ ssh [OPTIONS] [user@]hostname [command]
Key Flags
-i KEYIdentity file (private key path) -p PORTConnect on a non-default port -L l:h:rLocal port forward: local→remote -R r:h:lRemote port forward: remote→local -NNo remote command — for pure tunneling -AForward SSH agent (hop through servers) -vVerbose — debug connection issues
Examples
Connect with key
$ ssh -i ~/.ssh/id_ed25519 jirie@10.0.0.50
ed25519 is faster and more secure than RSA — use it for new keys
Generate a key pair
$ ssh-keygen -t ed25519 -C "work-laptop"
$ ssh-copy-id jirie@10.0.0.50
Copy your public key to the server — no more passwords
Local port forward (tunnel)
$ ssh -NL 5432:localhost:5432 jirie@10.0.0.50
Access the remote Postgres as if it were local — browse to localhost:5432