A modern, interactive TUI (Terminal User Interface) for managing SSH tunnels with sshuttle. Built with Go and Bubble Tea.
- 🔍 Interactive Selection: Browse and select servers using a beautiful TUI
- 🔄 Active Tunnel Management: View and terminate running tunnels
- 🔗 Dual Mode Operation: Choose between sshuttle tunnels or direct SSH connections
- 📝 YAML Configuration: Simple configuration file format
- 🚀 Quick Launch: Start tunnels or SSH connections with a single keypress
- 🐛 Debug Mode: Verbose logging for troubleshooting
- 💾 Daemon Mode: Tunnels run in background by default
- 🎯 Smart SSH Key Handling: Automatically uses SSH keys from config
- 🏷️ Hostname Display: Show server hostnames alongside names for easy identification
# Install sshuttle (dependency)
brew install sshuttle
# Add tap and install sshuttle-selector
brew tap tgigli/sshuttle-selector
brew install sshuttle-selectorsshuttleinstalled via Homebrew- SSH access to your servers
Binary releases are available for:
- amd64:
sshuttle-selector-linux-amd64.tar.gz - arm64:
sshuttle-selector-linux-arm64.tar.gz - 386:
sshuttle-selector-linux-386.tar.gz
- Intel (amd64):
sshuttle-selector-darwin-amd64.tar.gz - Apple Silicon (arm64):
sshuttle-selector-darwin-arm64.tar.gz
This project follows semantic versioning starting from 0.0.1:
- 0.x.x: Development versions with potential breaking changes
- 1.x.x: Stable releases (future)
Download the latest release from the GitHub Releases page.
Create the configuration directory and file:
mkdir -p ~/.config/sshuttle-selectorCreate ~/.config/sshuttle-selector/config.yaml:
tunnels:
- name: "Development Server"
host: "dev.example.com"
user: "ubuntu"
subnets: "10.0.0.0/8"
extra_args: "-i ~/.ssh/dev-key.pem"
- name: "Production Server"
host: "prod.example.com"
user: "ubuntu"
subnets: "10.1.0.0/16"
extra_args: "-i ~/.ssh/prod-key.pem"
- name: "AWS VPC"
host: "bastion.example.com"
user: "ec2-user"
subnets: "172.16.0.0/12"
extra_args: "-i ~/.ssh/aws-key.pem --dns"| Field | Description | Required |
|---|---|---|
name |
Display name for the tunnel | Yes |
host |
SSH server hostname | Yes |
user |
SSH username | Yes |
subnets |
CIDR ranges to tunnel (comma-separated) | Yes |
extra_args |
Additional sshuttle arguments | No |
# Start the selector (tunnel mode)
sshuttle-selector
# Start in SSH direct connection mode
sshuttle-selector --ssh
# Start with debug mode (verbose logging, no daemon)
sshuttle-selector --debug
# Combine flags
sshuttle-selector --ssh --debug- Tunnel Mode (default): Creates sshuttle tunnels for secure network access
- SSH Mode (
--ssh): Connects directly via SSH without creating tunnels
Add new tunnel configurations directly from command line:
# Add a new tunnel configuration
sshuttle-selector -add \
-name "Production Server" \
-host "prod.example.com" \
-user "ubuntu" \
-subnets "10.0.0.0/8" \
-extra-args "-i ~/.ssh/prod-key.pem"
# Add tunnel with multiple subnets
sshuttle-selector -add \
-name "Corporate VPN" \
-host "vpn.company.com" \
-user "employee" \
-subnets "10.0.0.0/8,172.16.0.0/12" \
-extra-args "--dns"
# Simple tunnel without extra arguments
sshuttle-selector -add \
-name "Dev Server" \
-host "dev.example.com" \
-user "developer" \
-subnets "192.168.1.0/24"| Parameter | Required | Description |
|---|---|---|
-add |
Yes | Enable CLI add mode |
-name |
Yes | Tunnel display name |
-host |
Yes | SSH server hostname |
-user |
Yes | SSH username |
-subnets |
Yes | CIDR ranges (comma-separated) |
-extra-args |
No | Additional sshuttle arguments |
The CLI mode performs the following validations:
- Required Parameters: Ensures all mandatory fields are provided
- CIDR Validation: Validates subnet format (e.g.,
10.0.0.0/8) - SSH Connectivity Test: Attempts to connect to verify access
- Duplicate Check: Prevents duplicate tunnel names
- Configuration Backup: Creates config directory if needed
# Valid examples
sshuttle-selector -add -name "Test" -host "test.com" -user "root" -subnets "10.0.0.0/8"
# Invalid examples (will show error)
sshuttle-selector -add -name "Test" # Missing required parameters
sshuttle-selector -add -name "Test" -host "test.com" -user "root" -subnets "invalid" # Bad CIDR
# Exit codes
# 0: Success
# 1: Error (missing params, validation failed, etc.)The TUI is organized into sections:
- Shows the currently running sshuttle process (only one tunnel can be active)
- Click to terminate the active tunnel
- Starting a new tunnel automatically stops the existing one
- Shows configured tunnels from your YAML file
- Click to start a new tunnel
↑/↓- Navigate through optionsEnter- Select/execute action/- Search/filter tunnelsqorCtrl+C- Quit
- name: "Simple Tunnel"
host: "server.example.com"
user: "myuser"
subnets: "192.168.1.0/24"- name: "Secure Tunnel"
host: "secure.example.com"
user: "admin"
subnets: "10.0.0.0/8"
extra_args: "-i ~/.ssh/secure-key.pem"- name: "Corporate VPN"
host: "vpn.company.com"
user: "employee"
subnets: "10.0.0.0/8,172.16.0.0/12"
extra_args: "--dns"sshuttle-selector --debugThis is useful for troubleshooting connection issues.
- Configuration Loading: Reads
~/.config/sshuttle-selector/config.yaml - Process Detection: Uses
ps auxto find running sshuttle processes - Command Building: Constructs sshuttle commands with proper SSH options
- Execution: Runs commands via shell for proper quote handling
-
"sshuttle: command not found"
- Install sshuttle:
brew install sshuttle
- Install sshuttle:
-
SSH key not found
- Check the path in
extra_args - Ensure proper permissions:
chmod 600 ~/.ssh/key.pem
- Check the path in
-
Permission denied
- Verify SSH access:
ssh -i ~/.ssh/key.pem user@host - Check SSH agent:
ssh-add ~/.ssh/key.pem
- Verify SSH access:
-
No tunnels showing
- Check config file location:
~/.config/sshuttle-selector/config.yaml - Validate YAML syntax
- Check config file location:
Use debug mode to see detailed connection logs:
sshuttle-selector --debug
# Select a tunnel to see verbose SSH and sshuttle output- Bubble Tea - TUI framework
- Lipgloss - Styling
- Bubbles - TUI components
- YAML v3 - Configuration parsing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details.
- sshuttle - The underlying VPN tool
- fzf - Command-line fuzzy finder inspiration
- Bubble Tea - TUI framework
Note: This tool is a wrapper around sshuttle. Make sure you understand the security implications of SSH tunneling in your environment.
