SSH and Remote Access
SSH is the normal way into Linux hosts. You should be comfortable connecting, copying files, and checking client-side config quickly.
Core commands
Section titled “Core commands”ssh user@hostssh -i ~/.ssh/key user@host # connect with a specific private keyscp file.txt user@host:/tmp/ # copy a local file to the remote hostscp user@host:/var/log/app.log . # copy a remote file back locallyrsync -av ./dir/ user@host:/srv/dir/ # sync a local directory to the remote hostssh-copy-id user@host # install your public key on the remote hostssh -v user@host # connect with verbose debug outputA simple SSH config
Section titled “A simple SSH config”Host web-01 HostName 10.0.0.25 User deploy IdentityFile ~/.ssh/id_ed25519 Port 2222Jump hosts
Section titled “Jump hosts”ssh -J bastion-user@bastion target-user@targetProxyJump bastion-user@bastionHigh-value checks
Section titled “High-value checks”See the effective SSH client config for a host:
ssh -G <host> # print the effective SSH client config for that hostTest with verbose output:
ssh -v user@hostClear a stale known_hosts entry after a host key change:
ssh-keygen -R <host>What matters
Section titled “What matters”- SSH keys are preferred over passwords.
~/.ssh/configsaves time if you use jump hosts, custom ports, or named identities.rsyncis usually the better default for repeated remote copies or directory syncs.ssh -vis often enough to tell whether the failure is DNS, TCP reachability, auth, or host key mismatch.- A “host key changed” error usually means the remote host was rebuilt, reprovisioned, or you hit the wrong host for that name or IP.
Common mistake
Section titled “Common mistake”Do not debug SSH only from the server side. Client-side config, wrong key selection, or a stale known host entry are common causes.