Host web-prod
HostName web01.example.com
User deploy
Port 22
IdentityFile ~/.ssh/id_ed25519Create a short alias in ~/.ssh/config.
Client-side SSH configuration examples for aliases, defaults, patterns, includes, ProxyJump, multiplexing, and effective config inspection.
Host entries, defaults, and matching.
Host web-prod
HostName web01.example.com
User deploy
Port 22
IdentityFile ~/.ssh/id_ed25519Create a short alias in ~/.ssh/config.
Host *
ServerAliveInterval 30
AddKeysToAgent yes
IdentitiesOnly yesSet defaults that apply to all hosts.
Host *.corp.internal
User ops
IdentityFile ~/.ssh/id_corpMatch groups of hosts with wildcard patterns.
Host *
CanonicalizeHostname yes
CanonicalDomains example.com corp.internalResolve short names into FQDNs automatically.
Include ~/.ssh/conf.d/*.confSplit config into multiple files.
ssh -G web-prodShow the effective configuration for a host.
Jump hosts, multiplexing, agent forwarding, and local commands in config.
Host private-*
ProxyJump bastion.example.comConfigure a jump host once for repeated use.
Host *
ControlMaster auto
ControlPath ~/.ssh/cm-%r@%h:%p
ControlPersist 10mEnable connection sharing globally or per host.
Host jumpbox
ForwardAgent yesEnable agent forwarding for specific hosts only.
Host db-tunnel
HostName bastion.example.com
LocalForward 5432 db.internal:5432Attach a local tunnel to a host alias.
Host secure-host
IdentityAgent ~/.ssh/agent-sockPoint a host entry at a chosen agent socket.
Host telemetry
PermitLocalCommand yes
LocalCommand echo connected to %hRun a local command after a successful connection.