Purpose
Configure SSH connections, key management, jump hosts, and tmux sessions for reliable remote workflows.
When to use this skill
- setting up
~/.ssh/configwith host aliases, ProxyJump, and multiplexing - creating persistent tmux sessions for long-running remote work
- syncing files between local and remote with
rsync - debugging SSH connection failures or key issues
Do not use this skill when
- writing systemd unit files on the remote host — prefer
systemd-services - the task is container orchestration — different domain
- doing local terminal debugging — prefer
terminal-debugging
Procedure
- Generate keys —
ssh-keygen -t ed25519 -C "user@machine". Copy:ssh-copy-id user@host. - Configure SSH — edit
~/.ssh/configwith host blocks for aliases, jump hosts, multiplexing. - Enable multiplexing —
ControlMaster auto,ControlPath ~/.ssh/sockets/%r@%h-%p,ControlPersist 600. - Jump hosts — use
ProxyJump bastionto reach internal hosts through a bastion. - Persistent tmux —
ssh host -t 'tmux new -s work || tmux attach -t work'. - Sync files —
rsync -avz --exclude .git/ ./src/ host:~/project/src/. - Port forwarding —
ssh -L 8080:localhost:3000 hostfor local access to remote services. - Debug —
ssh -vvv hostfor verbose output; check/var/log/auth.logon server.
SSH config example
Host *
AddKeysToAgent yes
IdentityFile ~/.ssh/id_ed25519
ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 600
ServerAliveInterval 60
Host bastion
HostName bastion.example.com
User deploy
Host internal
HostName 10.0.1.50
User deploy
ProxyJump bastion
tmux essentials
tmux new -s dev # new named session
tmux attach -t dev # reattach
# Ctrl-b d detach Ctrl-b c new window
# Ctrl-b % vsplit Ctrl-b " hsplit
Decision rules
- Use
ed25519keys — faster and more secure than RSA. - Use
ProxyJumpoverssh -J— config is version-controllable. - Create
~/.ssh/sockets/directory — missing dir causes silent multiplexing failure. - Set
ServerAliveInterval 60to prevent dropped idle connections. - Use
tmux new -s name || tmux attach -t nameto be idempotent.
References
Related skills
linux-ubuntu-ops— server management after SSH accessbash— scripting remote commandsterminal-debugging— debugging remote processes
