# SSH Configuration Template (~/.ssh/config)
# Documentation:
#   man ssh_config
#   https://linux.die.net/man/5/ssh_config
# Common options and examples for SSH client configuration.

Host *
    # Use macOS Keychain for storing passphrases (macOS specific, but safe to keep)
    IgnoreUnknown UseKeychain,AddKeysToAgent
    UseKeychain yes
    AddKeysToAgent yes

    # Forward Agent for jump hosts (use with caution)
    ForwardAgent yes

    # Keep connections alive
    ServerAliveInterval 60
    ServerAliveCountMax 10

    # TCP keepalives to prevent disconnects on long-running operations
    TCPKeepAlive yes
    # IdentitiesOnly yes

    # Multiplexing: Reuse existing connections for faster subsequent connections
    ControlMaster auto
    ControlPath ~/.ssh/sockets/%r@%h-%p
    ControlPersist 10m

    # Security: Only use standard authentication methods
    # PasswordAuthentication no
    PubkeyAuthentication yes

# Include additional Host-specific configuration files placed in ~/.ssh/conf.d/
Include conf.d/*.conf