Configuring ~/.ssh/config for Multiple Hosts, Jump Hosts, Keepalives and Per-Host Keys
The article explains how a well-structured ~/.ssh/config file can replace long command-line invocations with short host aliases that scale as server lists grow. It stresses that the first matching value wins, so specific host blocks must come before wildcard blocks, with Host * placed last. The guide covers ProxyJump for reaching machines through a bastion, which supersedes the older ProxyCommand approach introduced in OpenSSH 7.3. It also describes keepalive settings to avoid sessions dying from NAT or firewall timeouts, and connection multiplexing with ControlMaster, including the stale-socket problem and its fix. Finally, it shows how IdentitiesOnly and per-host keys let users manage several accounts, such as separate work and personal GitHub keys, and how to set host-key checking and agent forwarding sensibly.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in