Skip to content

SSH ​

SSH client configuration symlinked to ~/.ssh/config.

Location ​

FileSymlinked to
config/ssh/config~/.ssh/config

Global host settings (Host *) ​

Locale ​

macOS forwards LC_* and LANG variables to remote hosts by default. Remote servers (e.g. Debian) may not have the same locale installed, which causes warning messages on login. This is disabled globally:

SendEnv -LC_* -LANG

Connection multiplexing ​

Reuses existing SSH connections for faster subsequent logins to the same host.

SettingValueDescription
ControlMasterautoAutomatically start multiplexing
ControlPath~/.ssh/cm-%r@%h:%pSocket path per user/host/port
ControlPersist60sKeep master open 60 s after last session

Keepalive ​

Prevents idle connections from being dropped by firewalls or routers.

SettingValueDescription
ServerAliveInterval60Send keepalive packet every 60 s
ServerAliveCountMax3Disconnect after 3 missed responses

Key handling (passphrase) ​

SettingValueDescription
UseKeychainyesRead/store the key passphrase in the macOS keychain
AddKeysToAgentyesAdd keys to ssh-agent automatically on first use

Machine-specific hosts ​

Host blocks for specific machines (infra IPs, internal servers) live in ~/.ssh/config.d/*.conf, which is not tracked by git (this repo is public). They are included first so their settings take precedence:

ssh-config
Include ~/.ssh/config.d/*.conf

Example ~/.ssh/config.d/servers.conf:

ssh-config
Host my-server
  HostName 203.0.113.10
  User deploy
  IdentityFile ~/.ssh/id_ed25519
  IdentitiesOnly yes

GitHub needs no host block: config/git/.gitconfig rewrites git@github.com: remotes to HTTPS, authenticated by Git Credential Manager (see Git).