SSH/GPG
Config Commands
Configuration
12 commands
Commands
SSH config file
$ ~/.ssh/config
SSH client configuration file path.
SSH config entry
$ Host alias
HostName host
User user
Example SSH config entry.
Fix key permissions
$ chmod 600 ~/.ssh/id_*
Set correct key file permissions.
Fix SSH directory permissions
$ chmod 700 ~/.ssh
Set correct .ssh directory permissions.
Wildcard host pattern
$ Host *.example.com
User deploy
IdentityFile ~/.ssh/deploy_key
Apply config to matching hostnames.
ProxyJump config
$ Host internal
HostName 10.0.0.5
ProxyJump bastion
Configure jump host in SSH config.
IdentityFile per host
$ Host github.com
IdentityFile ~/.ssh/github_ed25519
Use specific key for a host.
ForwardAgent in config
$ Host bastion
ForwardAgent yes
Enable agent forwarding for a host.
AddKeysToAgent config
$ Host *
AddKeysToAgent yes
IdentityFile ~/.ssh/id_ed25519
Auto-add keys to agent on first use.
ServerAliveInterval config
$ Host *
ServerAliveInterval 60
ServerAliveCountMax 3
Keep connections alive with heartbeat.
Include directive
$ Include ~/.ssh/config.d/*
Include additional config files.
ControlMaster multiplexing
$ Host *
ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 600
Reuse SSH connections for speed.