Console9

SSH config directives reference

Complete reference for ~/.ssh/config directives including Host, HostName, Port, IdentityFile, ProxyJump, and ForwardAgent.

Complete reference for SSH client configuration directives in ~/.ssh/config covering connection, authentication, tunneling, and proxy settings.

SSH Connection Directives

DirectiveSSH behaviorDefaultExample
HostSSH defines a named alias that matches against the hostname argument; supports wildcards ( *, ?)RequiredHost production
HostNameSSH connects to this hostname or IP address when the alias matchesAlias nameHostName 203.0.113.50
PortSSH connects to this TCP port on the remote server22Port 2222
UserSSH authenticates as this username on the remote serverLocal usernameUser admin
AddressFamilySSH uses IPv4 only ( inet), IPv6 only ( inet6), or both ( any)anyAddressFamily inet

SSH Authentication Directives

DirectiveSSH behaviorDefaultExample
IdentityFileSSH uses this private key file for public key authentication~/.ssh/id_rsa, ~/.ssh/id_ed25519IdentityFile ~/.ssh/prod_key
IdentitiesOnlySSH offers only the keys specified by IdentityFile, ignoring the agent's key listnoIdentitiesOnly yes
PreferredAuthenticationsSSH attempts authentication methods in this orderpublickey,keyboard-interactive,passwordPreferredAuthentications publickey
PasswordAuthenticationSSH allows password authentication to the serveryesPasswordAuthentication no

SSH Tunneling and Proxy Directives

DirectiveSSH behaviorDefaultExample
LocalForwardSSH binds a local port and forwards traffic to a remote destination through the SSH tunnelNoneLocalForward 3306 localhost:3306
RemoteForwardSSH binds a port on the remote server and forwards traffic back to the local machineNoneRemoteForward 8080 localhost:80
DynamicForwardSSH creates a local SOCKS5 proxy that routes all traffic through the SSH connectionNoneDynamicForward 1080
ProxyJumpSSH routes the connection through an intermediate SSH host (bastion/jump host) before reaching the targetNoneProxyJump bastion
ForwardAgentSSH forwards the local SSH agent to the remote server, allowing onward SSH connections using local keysnoForwardAgent yes

SSH Session Directives

DirectiveSSH behaviorDefaultExample
ServerAliveIntervalSSH sends a keepalive message every N seconds to prevent idle connection drops0 (disabled)ServerAliveInterval 60
ServerAliveCountMaxSSH disconnects after this many unanswered keepalive messages3ServerAliveCountMax 5
ConnectTimeoutSSH limits the TCP connection phase to this many secondsSystem defaultConnectTimeout 10
CompressionSSH enables zlib compression on the connection — useful for slow linksnoCompression yes
LogLevelSSH sets the verbosity of client-side loggingINFOLogLevel DEBUG