# SSH Utility Configuration # This file defines smart aliases that automatically choose between local and remote connections # Logging configuration logging: enabled: true # Levels: debug, info, warn, error level: "info" # Formats: console, json format: "console" smart_aliases: desktop: primary: "desktop-local" fallback: "desktop" check_host: "192.168.1.254" timeout: "2s" laptop: primary: "laptop-local" fallback: "laptop" check_host: "192.168.1.253" timeout: "2s" # Background SSH Tunnel Definitions tunnels: # Example: Desktop database tunnel desktop-database: type: local local_port: 5432 remote_host: database remote_port: 5432 ssh_host: desktop # Uses smart alias logic (desktop-local/desktop) # Example: Development API tunnel dev-api: type: local local_port: 8080 remote_host: api remote_port: 80 ssh_host: dev-server # Example: SOCKS proxy tunnel socks-proxy: type: dynamic local_port: 1080 ssh_host: bastion # Modem web interface tunnel modem-web: type: local local_port: 8443 remote_host: 192.168.1.1 remote_port: 443 ssh_host: desktop # Tunnel Management Commands: # ssh --tunnel --open desktop-database (or ssh -TO desktop-database) # ssh --tunnel --close desktop-database (or ssh -TC desktop-database) # ssh --tunnel --list (or ssh -TL) # # Ad-hoc tunnels (not in config): # ssh -TO temp-api --local 8080:api:80 --via server # Logging options: # - enabled: true/false - whether to show any logs # - level: debug (verbose), info (normal), warn (warnings only), error (errors only) # - format: console (human readable), json (structured) # Logs are written to stderr so they don't interfere with SSH output # How it works: # 1. When you run: ssh desktop # 2. The utility pings 192.168.86.22 with a 2s timeout # 3. If ping succeeds: runs "ssh desktop-local" instead # 4. If ping fails: runs "ssh desktop" instead # 5. All other SSH usage (flags, user@host, etc.) passes through unchanged # Your SSH config should contain the actual host definitions: # Host desktop # HostName mennos-cachyos-desktop # User menno # Port 400 # ForwardAgent yes # AddKeysToAgent yes # # Host desktop-local # HostName 192.168.86.22 # User menno # Port 400 # ForwardAgent yes # AddKeysToAgent yes