SSHM is a beautiful command-line tool that transforms how you manage and connect to your SSH hosts. Built with Go and featuring an intuitive TUI interface, it makes SSH connection management effortless and enjoyable.
Go
1,413
114 commits
updated Oct 4, 2026
A modern, interactive SSH Manager for your terminal π₯
SSHM is a beautiful command-line tool that transforms how you manage and connect to your SSH hosts. Built with Go and featuring an intuitive TUI interface, it makes SSH connection management effortless and enjoyable.
π±οΈ Click on the image to view in full size
sshm <host>hidden tag to exclude hosts from the list while keeping them connectable~/.ssh/config file-c flagHomebrew (Recommended for macOS):
brew install Gu1llaum-3/sshm/sshm
Unix/Linux/macOS (One-line install):
curl -sSL https://raw.githubusercontent.com/Gu1llaum-3/sshm/main/install/unix.sh | bash
Windows (PowerShell):
irm https://raw.githubusercontent.com/Gu1llaum-3/sshm/main/install/windows.ps1 | iex
Alternative methods:
Linux/macOS:
# Download specific release
wget https://github.com/Gu1llaum-3/sshm/releases/latest/download/sshm-linux-amd64.tar.gz
# Extract and install
tar -xzf sshm-linux-amd64.tar.gz
sudo mv sshm-linux-amd64 /usr/local/bin/sshm
Windows:
# Download and extract
Invoke-WebRequest -Uri "https://github.com/Gu1llaum-3/sshm/releases/latest/download/sshm-windows-amd64.zip" -OutFile "sshm-windows-amd64.zip"
Expand-Archive sshm-windows-amd64.zip -DestinationPath C:\tools\
# Add C:\tools to your PATH environment variable
Launch SSHM without arguments to enter the beautiful TUI interface:
sshm
Search (focused at startup):
β/β or Ctrl+P/Ctrl+N - Select a host without leaving the searchEnter - Connect to the selected hostEsc - Clear the search (quits when the search is empty)Tab - Switch to the host table, where the shortcuts below workHost table:
β/β or j/k - Navigate hostsEnter - Connect to selected hosta - Add new hoste - Edit selected hostd - Delete selected hostm - Move host to another config file (requires SSH Include directives)f - Port forwarding setupp - Check the status of all hosts againH - Toggle hidden hosts visibilityq - Quit/ or Tab - Back to the searchStatus Indicators (checked when the TUI starts, and again with p):
Sorting & Filtering:
s - Switch between sorting modes (name β last login)n - Sort by name (alphabetical)r - Sort by recent (last login time)The interactive forms will guide you through configuration:
-o format (e.g., -o Compression=yes -o ServerAliveInterval=60)SSHM provides an intuitive interface for setting up SSH port forwarding. Press f while selecting a host to open the port forwarding setup:
Forward Types:
Local (-L) - Forward a local port to a remote host/port through the SSH connection
localhost:5432 via local port 15432ssh -L 15432:localhost:5432 server β Database accessible on localhost:15432Remote (-R) - Forward a remote port back to a local host/port
8080ssh -R 8080:localhost:3000 server β Local app accessible from remote host's port 8080GatewayPorts yes to /etc/ssh/sshd_config and restart SSH serviceufw allow 8080 or equivalent)0.0.0.0 for external access, 127.0.0.1 for local-onlyDynamic (-D) - Create a SOCKS proxy for secure browsing
ssh -D 1080 server β Configure browser to use localhost:1080 as SOCKS proxy127.0.0.1 for security (local access only)Port Forwarding Interface:
Troubleshooting Port Forwarding:
Remote Forwarding Issues:
# Error: "remote port forwarding failed for listen port X"
# Solutions:
1. Check if port is already in use: ssh server "netstat -tln | grep :X"
2. Use a different port that's available
3. Enable GatewayPorts in SSH config for external access
SSH Server Configuration for Remote Forwarding:
# Edit SSH daemon config on the server:
sudo nano /etc/ssh/sshd_config
# Add or uncomment:
GatewayPorts yes
# Restart SSH service:
sudo systemctl restart sshd # Ubuntu/Debian/CentOS 7+
# OR
sudo service ssh restart # Older systems
Firewall Configuration:
# Ubuntu/Debian (UFW):
sudo ufw allow [port_number]
# CentOS/RHEL/Rocky (firewalld):
sudo firewall-cmd --add-port=[port_number]/tcp --permanent
sudo firewall-cmd --reload
# Check if port is accessible:
telnet [server_ip] [port_number]
Dynamic Forwarding (SOCKS) Browser Setup:
Firefox: about:preferences β Network Settings
- Manual proxy configuration
- SOCKS Host: localhost, Port: [your_port]
- SOCKS v5: β
- Proxy DNS when using SOCKS v5: β
Chrome: Launch with proxy
chrome --proxy-server="socks5://localhost:[your_port]"
SSHM provides both command-line operations and an interactive TUI interface:
# Launch interactive TUI mode for browsing and connecting to hosts
sshm
# Connect directly to a specific host (with history tracking)
sshm my-server
# Execute a command on a remote host
sshm my-server uptime
# Execute command with arguments
sshm my-server ls -la /var/log
# Force TTY allocation for interactive commands
sshm -t my-server sudo systemctl restart nginx
# Launch TUI with custom SSH config file
sshm -c /path/to/custom/ssh_config
# Connect directly with custom SSH config file
sshm my-server -c /path/to/custom/ssh_config
# Add a new host using interactive form
sshm add
# Add a new host with pre-filled hostname
sshm add hostname
# Add a new host with custom SSH config file
sshm add hostname -c /path/to/custom/ssh_config
# Edit an existing host configuration
sshm edit my-server
# Edit host with custom SSH config file
sshm edit my-server -c /path/to/custom/ssh_config
# Move a host to another SSH config file (requires Include directives)
sshm move my-server
# Move host with custom SSH config file (requires Include directives)
sshm move my-server -c /path/to/custom/ssh_config
# Search for hosts (interactive filter)
sshm search
# Print machine-readable info (JSON) for scripting
sshm info prod-server
sshm info prod-server --pretty
# With a custom SSH config file
sshm -c /path/to/custom/ssh_config info prod-server
# Pipe to jq
sshm info prod-server | jq -r '.result.target.hostname'
sshm info prod-server | jq -r '.result.target.user'
# Show version information
sshm --version
# Disable automatic update check (useful on air-gapped machines)
sshm --no-update-check
# Show help and available commands
sshm --help
sshm info <hostname> prints a single JSON object to stdout so you can script against it with jq.
# Extract fields
sshm info prod-server | jq -r '.result.target.hostname'
sshm info prod-server | jq -r '.result.target.port'
# Check not-found (exit code 2)
sshm info does-not-exist | jq -r '.error.code'
SSHM supports shell completion for host names, making it easy to connect to hosts without typing full names:
sshm <TAB> # Lists all available hosts
sshm pro<TAB> # Completes to hosts starting with "pro" (e.g., prod-server)
Setup Instructions:
Bash:
# Enable for current session
source <(sshm completion bash)
# Enable permanently (add to ~/.bashrc)
echo 'source <(sshm completion bash)' >> ~/.bashrc
Zsh:
# Enable for current session
source <(sshm completion zsh)
# Enable permanently (add to ~/.zshrc)
echo 'source <(sshm completion zsh)' >> ~/.zshrc
Fish:
# Enable for current session
sshm completion fish | source
# Enable permanently
sshm completion fish > ~/.config/fish/completions/sshm.fish
PowerShell:
# Enable for current session
sshm completion powershell | Out-String | Invoke-Expression
# Enable permanently (add to your PowerShell profile)
Add-Content $PROFILE 'sshm completion powershell | Out-String | Invoke-Expression'
SSHM supports direct connection to hosts via the command line, making it easy to integrate into your existing workflow:
# Connect directly to any configured host
sshm production-server
sshm db-staging
sshm web-01
# All direct connections are tracked in your history
# Use the TUI to see your most recently connected hosts
Features of Direct Connection:
-c flagExecute commands on remote hosts without opening an interactive shell:
# Execute a single command
sshm prod-server uptime
# Execute command with arguments
sshm prod-server ls -la /var/log
# Check disk usage
sshm prod-server df -h
# View logs (pipe to local commands)
sshm prod-server 'cat /var/log/nginx/access.log' | grep 404
# Force TTY allocation for interactive commands (sudo, vim, etc.)
sshm -t prod-server sudo systemctl restart nginx
Features:
-t flag for commands requiring terminal interactionSSHM automatically creates backups of your SSH configuration files before making any changes to ensure your configurations are safe.
Backup Location:
~/.config/sshm/backups/ (or $XDG_CONFIG_HOME/sshm/backups/ if set)%APPDATA%\sshm\backups\ (fallback: %USERPROFILE%\.config\sshm\backups\)Key Features:
Additional Storage:
Quick Recovery:
# Unix/Linux/macOS
cp ~/.config/sshm/backups/config.backup ~/.ssh/config
# Windows
copy "%APPDATA%\sshm\backups\config.backup" "%USERPROFILE%\.ssh\config"
By default, SSHM uses the standard SSH configuration file at ~/.ssh/config. You can specify a different configuration file using the -c flag:
# Use custom config file in TUI mode
sshm -c /path/to/custom/ssh_config
# Use custom config file with commands
sshm add hostname -c /path/to/custom/ssh_config
sshm edit hostname -c /path/to/custom/ssh_config
sshm move hostname -c /path/to/custom/ssh_config
SSHM provides a powerful move command to relocate SSH hosts between different configuration files. This feature requires SSH Include directives to be present in your SSH configuration.
# Move a host to another config file (requires Include directives)
sshm move my-server
# Move with custom config file (requires Include directives)
sshm move my-server -c /path/to/custom/ssh_config
β οΈ Important Requirements:
~/.ssh/config or the file specified with -c)Include statements referencing other SSH configuration filesFeatures:
Use Cases:
Example Setup Required: Your main SSH config file must contain Include directives like:
# ~/.ssh/config
Include ~/.ssh/config.d/*
Include work-servers.conf
Include projects/*.conf
Host personal-server
HostName personal.example.com
User myuser
SSHM features asynchronous SSH connectivity checking that provides visual indicators of host availability:
Status Indicators:
Features:
p to check again. Set ping_on_start to false to check only on demandSSHM includes built-in version checking that notifies you of available updates:
Features:
Update notifications appear:
Disabling update checks:
Via the CLI flag (one-time):
sshm --no-update-check
Via ~/.config/sshm/config.json (persistent):
{
"check_for_updates": false
}
SSHM remembers your port forwarding configurations for easy reuse:
Features:
Windows:
%USERPROFILE%\.ssh\configUnix/Linux/macOS:
~/.ssh/configSSHM works directly with your standard SSH configuration file (~/.ssh/config). It adds special comment tags for enhanced functionality while maintaining full compatibility with standard SSH tools.
SSHM fully supports SSH Include directives, allowing you to organize your SSH configurations across multiple files. This is particularly useful for managing large numbers of hosts or organizing configurations by environment, project, or team.
Include Examples:
# Main ~/.ssh/config file
Host personal-server
HostName personal.example.com
User myuser
# Include work-related configurations
Include work-servers.conf
# Include all configurations from a directory
Include projects/*
# Include with relative paths
Include ~/.ssh/configs/production.conf
Organization Examples:
work-servers.conf:
# Tags: work, production
Host prod-web-01
HostName 10.0.1.10
User deploy
ProxyJump bastion.company.com
# Tags: work, staging
Host staging-api
HostName staging-api.company.com
User developer
projects/client-alpha.conf:
# Tags: client, development
Host client-alpha-dev
HostName dev.client-alpha.com
User admin
Port 2222
Example configuration: Include ~/.ssh/conf.d/*
# Tags: production, web, frontend
Host web-prod-01
HostName 192.168.1.10
User deploy
Port 22
IdentityFile ~/.ssh/production_key
Compression yes
ServerAliveInterval 60
# Tags: development, database
Host db-dev
HostName dev-db.company.com
User admin
Port 2222
IdentityFile ~/.ssh/dev_key
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
# Tags: production, backend
Host backend-prod
HostName 10.0.1.50
User app
Port 22
ProxyJump bastion.company.com
ProxyCommand ssh -W %h:%p Jumphost
IdentityFile ~/.ssh/production_key
Compression yes
ServerAliveInterval 300
BatchMode yes
SSHM supports all standard SSH configuration options:
Built-in Fields:
HostName - Server hostname or IP addressUser - Username for SSH connectionPort - SSH port numberIdentityFile - Path to private key fileProxyJump - Jump server for connection tunneling (e.g., user@jumphost:port)ProxyCommand - Jump command for connection tunneling (e.g, ssh -W %h:%p Jumphost)Tags - Custom tags (SSHM extension); the special tag hidden hides the host from the TUI and sshm search while keeping it connectable via sshm <host>Additional SSH Options:
You can add any valid SSH option using the "SSH Options" field in the interactive forms. Enter them in command-line format (e.g., -o Compression=yes -o ServerAliveInterval=60) and SSHM will automatically convert them to the proper SSH config format.
Common SSH Options:
Compression - Enable/disable compression (yes/no)ServerAliveInterval - Interval in seconds for keepalive messagesServerAliveCountMax - Maximum number of keepalive messagesStrictHostKeyChecking - Host key verification (yes/no/ask)UserKnownHostsFile - Path to known hosts fileBatchMode - Disable interactive prompts (yes/no)ConnectTimeout - Connection timeout in secondsControlMaster - Connection multiplexing (yes/no/auto)ControlPath - Path for control socketControlPersist - Keep connection alive durationForwardAgent - Forward SSH agent (yes/no)LocalForward - Local port forwarding (e.g., 8080:localhost:80)RemoteForward - Remote port forwardingDynamicForward - SOCKS proxy port forwardingExample usage in forms:
SSH Options: -o Compression=yes -o ServerAliveInterval=60 -o StrictHostKeyChecking=no
This will be automatically converted to:
Compression yes
ServerAliveInterval 60
StrictHostKeyChecking no
SSHM supports a configuration file to customize its behavior, including key bindings and update checking.
Configuration File Location:
~/.config/sshm/config.json%APPDATA%\sshm\config.jsonExample Configuration:
{
"check_for_updates": false,
"focus_search_on_start": false,
"ping_on_start": false,
"key_bindings": {
"quit_keys": ["q", "ctrl+c"],
"disable_esc_quit": true
}
}
Available Options:
true. Set to false on air-gapped or offline machines to avoid connection delays.true (the search bar). Set to false to start on the host table; the -s / --search flag still starts on the search bar.true. Set to false to check only when you press p (for example with many hosts, or hosts behind a slow ProxyJump).["q", "ctrl+c"]falseFor Vim Users:
If you frequently press ESC accidentally causing the application to quit, set disable_esc_quit to true. This will disable ESC as a quit key while preserving all other functionality.
For Air-gapped Machines:
If SSHM is slow to start due to DNS timeouts when reaching GitHub, set check_for_updates to false. You can also use the --no-update-check CLI flag for a one-time override without editing the config file.
Default Configuration: If no configuration file exists, SSHM will automatically create one with default settings that maintain backward compatibility.
# Clone the repository
git clone https://github.com/Gu1llaum-3/sshm.git
cd sshm
# Build the binary
go build -o sshm .
# Run
./sshm
sshm/
βββ main.go # Application entry point
βββ cmd/ # CLI commands (Cobra)
β βββ root.go # Root command and interactive mode
β βββ add.go # Add host command
β βββ edit.go # Edit host command
β βββ move.go # Move host command
β βββ search.go # Search command
βββ internal/
β βββ config/ # SSH configuration management
β β βββ ssh.go # Config parsing and manipulation
β βββ connectivity/ # SSH connectivity checking
β β βββ ping.go # Asynchronous SSH ping functionality
β βββ history/ # Connection history tracking
β β βββ history.go # History management and last login tracking
β β βββ port_forward_test.go # Port forwarding history tests
β βββ version/ # Version checking and updates
β β βββ version.go # GitHub release checking and version comparison
β β βββ version_test.go # Version parsing and comparison tests
β βββ ui/ # Terminal UI components (Bubble Tea)
β β βββ tui.go # Main TUI interface and program setup
β β βββ model.go # Core TUI model and state
β β βββ update.go # Message handling and state updates
β β βββ view.go # UI rendering and layout
β β βββ table.go # Host list table component with status indicators
β β βββ add_form.go # Add host form interface
β β βββ edit_form.go# Edit host form interface
β β βββ move_form.go# Move host form interface
β β βββ port_forward_form.go # Port forwarding setup with history
β β βββ styles.go # Lip Gloss styling definitions
β β βββ sort.go # Sorting and filtering logic
β β βββ utils.go # UI utility functions
β βββ validation/ # Input validation
β βββ ssh.go # SSH config validation
βββ images/ # Documentation assets
β βββ logo.png # Project logo
β βββ sshm.gif # Demo animation
βββ install/ # Installation scripts
β βββ unix.sh # Unix/Linux/macOS installer
β βββ README.md # Installation guide
βββ .github/ # GitHub configuration
β βββ copilot-instructions.md # Development guidelines
β βββ workflows/ # CI/CD pipelines
β βββ build.yml # Multi-platform builds
βββ go.mod # Go module definition
βββ go.sum # Go module checksums
βββ LICENSE # MIT license
βββ README.md # Project documentation
Automated releases are built for multiple platforms:
| Platform | Architecture | Download |
|---|---|---|
| Linux | AMD64 | sshm-linux-amd64.tar.gz |
| Linux | ARM64 | sshm-linux-arm64.tar.gz |
| macOS | Intel | sshm-darwin-amd64.tar.gz |
| macOS | Apple Silicon | sshm-darwin-arm64.tar.gz |
| Windows | AMD64 | sshm-windows-amd64.zip |
| Windows | ARM64 | sshm-windows-arm64.zip |
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ by Guillaume
β Star this repo if you found it useful! β
165 followers Β· starred Jul 2026
104 followers Β· starred Sep 2025
38 followers Β· starred Sep 2025
30 followers Β· starred Aug 2026
SSHM is a beautiful command-line tool that transforms how you manage and connect to your SSH hosts. Built with Go and featuring an intuitive TUI interface, it makes SSH connection management effortless and enjoyable.
Go
1,413
114 commits
updated Oct 4, 2026
A modern, interactive SSH Manager for your terminal π₯
SSHM is a beautiful command-line tool that transforms how you manage and connect to your SSH hosts. Built with Go and featuring an intuitive TUI interface, it makes SSH connection management effortless and enjoyable.
π±οΈ Click on the image to view in full size
sshm <host>hidden tag to exclude hosts from the list while keeping them connectable~/.ssh/config file-c flagHomebrew (Recommended for macOS):
brew install Gu1llaum-3/sshm/sshm
Unix/Linux/macOS (One-line install):
curl -sSL https://raw.githubusercontent.com/Gu1llaum-3/sshm/main/install/unix.sh | bash
Windows (PowerShell):
irm https://raw.githubusercontent.com/Gu1llaum-3/sshm/main/install/windows.ps1 | iex
Alternative methods:
Linux/macOS:
# Download specific release
wget https://github.com/Gu1llaum-3/sshm/releases/latest/download/sshm-linux-amd64.tar.gz
# Extract and install
tar -xzf sshm-linux-amd64.tar.gz
sudo mv sshm-linux-amd64 /usr/local/bin/sshm
Windows:
# Download and extract
Invoke-WebRequest -Uri "https://github.com/Gu1llaum-3/sshm/releases/latest/download/sshm-windows-amd64.zip" -OutFile "sshm-windows-amd64.zip"
Expand-Archive sshm-windows-amd64.zip -DestinationPath C:\tools\
# Add C:\tools to your PATH environment variable
Launch SSHM without arguments to enter the beautiful TUI interface:
sshm
Search (focused at startup):
β/β or Ctrl+P/Ctrl+N - Select a host without leaving the searchEnter - Connect to the selected hostEsc - Clear the search (quits when the search is empty)Tab - Switch to the host table, where the shortcuts below workHost table:
β/β or j/k - Navigate hostsEnter - Connect to selected hosta - Add new hoste - Edit selected hostd - Delete selected hostm - Move host to another config file (requires SSH Include directives)f - Port forwarding setupp - Check the status of all hosts againH - Toggle hidden hosts visibilityq - Quit/ or Tab - Back to the searchStatus Indicators (checked when the TUI starts, and again with p):
Sorting & Filtering:
s - Switch between sorting modes (name β last login)n - Sort by name (alphabetical)r - Sort by recent (last login time)The interactive forms will guide you through configuration:
-o format (e.g., -o Compression=yes -o ServerAliveInterval=60)SSHM provides an intuitive interface for setting up SSH port forwarding. Press f while selecting a host to open the port forwarding setup:
Forward Types:
Local (-L) - Forward a local port to a remote host/port through the SSH connection
localhost:5432 via local port 15432ssh -L 15432:localhost:5432 server β Database accessible on localhost:15432Remote (-R) - Forward a remote port back to a local host/port
8080ssh -R 8080:localhost:3000 server β Local app accessible from remote host's port 8080GatewayPorts yes to /etc/ssh/sshd_config and restart SSH serviceufw allow 8080 or equivalent)0.0.0.0 for external access, 127.0.0.1 for local-onlyDynamic (-D) - Create a SOCKS proxy for secure browsing
ssh -D 1080 server β Configure browser to use localhost:1080 as SOCKS proxy127.0.0.1 for security (local access only)Port Forwarding Interface:
Troubleshooting Port Forwarding:
Remote Forwarding Issues:
# Error: "remote port forwarding failed for listen port X"
# Solutions:
1. Check if port is already in use: ssh server "netstat -tln | grep :X"
2. Use a different port that's available
3. Enable GatewayPorts in SSH config for external access
SSH Server Configuration for Remote Forwarding:
# Edit SSH daemon config on the server:
sudo nano /etc/ssh/sshd_config
# Add or uncomment:
GatewayPorts yes
# Restart SSH service:
sudo systemctl restart sshd # Ubuntu/Debian/CentOS 7+
# OR
sudo service ssh restart # Older systems
Firewall Configuration:
# Ubuntu/Debian (UFW):
sudo ufw allow [port_number]
# CentOS/RHEL/Rocky (firewalld):
sudo firewall-cmd --add-port=[port_number]/tcp --permanent
sudo firewall-cmd --reload
# Check if port is accessible:
telnet [server_ip] [port_number]
Dynamic Forwarding (SOCKS) Browser Setup:
Firefox: about:preferences β Network Settings
- Manual proxy configuration
- SOCKS Host: localhost, Port: [your_port]
- SOCKS v5: β
- Proxy DNS when using SOCKS v5: β
Chrome: Launch with proxy
chrome --proxy-server="socks5://localhost:[your_port]"
SSHM provides both command-line operations and an interactive TUI interface:
# Launch interactive TUI mode for browsing and connecting to hosts
sshm
# Connect directly to a specific host (with history tracking)
sshm my-server
# Execute a command on a remote host
sshm my-server uptime
# Execute command with arguments
sshm my-server ls -la /var/log
# Force TTY allocation for interactive commands
sshm -t my-server sudo systemctl restart nginx
# Launch TUI with custom SSH config file
sshm -c /path/to/custom/ssh_config
# Connect directly with custom SSH config file
sshm my-server -c /path/to/custom/ssh_config
# Add a new host using interactive form
sshm add
# Add a new host with pre-filled hostname
sshm add hostname
# Add a new host with custom SSH config file
sshm add hostname -c /path/to/custom/ssh_config
# Edit an existing host configuration
sshm edit my-server
# Edit host with custom SSH config file
sshm edit my-server -c /path/to/custom/ssh_config
# Move a host to another SSH config file (requires Include directives)
sshm move my-server
# Move host with custom SSH config file (requires Include directives)
sshm move my-server -c /path/to/custom/ssh_config
# Search for hosts (interactive filter)
sshm search
# Print machine-readable info (JSON) for scripting
sshm info prod-server
sshm info prod-server --pretty
# With a custom SSH config file
sshm -c /path/to/custom/ssh_config info prod-server
# Pipe to jq
sshm info prod-server | jq -r '.result.target.hostname'
sshm info prod-server | jq -r '.result.target.user'
# Show version information
sshm --version
# Disable automatic update check (useful on air-gapped machines)
sshm --no-update-check
# Show help and available commands
sshm --help
sshm info <hostname> prints a single JSON object to stdout so you can script against it with jq.
# Extract fields
sshm info prod-server | jq -r '.result.target.hostname'
sshm info prod-server | jq -r '.result.target.port'
# Check not-found (exit code 2)
sshm info does-not-exist | jq -r '.error.code'
SSHM supports shell completion for host names, making it easy to connect to hosts without typing full names:
sshm <TAB> # Lists all available hosts
sshm pro<TAB> # Completes to hosts starting with "pro" (e.g., prod-server)
Setup Instructions:
Bash:
# Enable for current session
source <(sshm completion bash)
# Enable permanently (add to ~/.bashrc)
echo 'source <(sshm completion bash)' >> ~/.bashrc
Zsh:
# Enable for current session
source <(sshm completion zsh)
# Enable permanently (add to ~/.zshrc)
echo 'source <(sshm completion zsh)' >> ~/.zshrc
Fish:
# Enable for current session
sshm completion fish | source
# Enable permanently
sshm completion fish > ~/.config/fish/completions/sshm.fish
PowerShell:
# Enable for current session
sshm completion powershell | Out-String | Invoke-Expression
# Enable permanently (add to your PowerShell profile)
Add-Content $PROFILE 'sshm completion powershell | Out-String | Invoke-Expression'
SSHM supports direct connection to hosts via the command line, making it easy to integrate into your existing workflow:
# Connect directly to any configured host
sshm production-server
sshm db-staging
sshm web-01
# All direct connections are tracked in your history
# Use the TUI to see your most recently connected hosts
Features of Direct Connection:
-c flagExecute commands on remote hosts without opening an interactive shell:
# Execute a single command
sshm prod-server uptime
# Execute command with arguments
sshm prod-server ls -la /var/log
# Check disk usage
sshm prod-server df -h
# View logs (pipe to local commands)
sshm prod-server 'cat /var/log/nginx/access.log' | grep 404
# Force TTY allocation for interactive commands (sudo, vim, etc.)
sshm -t prod-server sudo systemctl restart nginx
Features:
-t flag for commands requiring terminal interactionSSHM automatically creates backups of your SSH configuration files before making any changes to ensure your configurations are safe.
Backup Location:
~/.config/sshm/backups/ (or $XDG_CONFIG_HOME/sshm/backups/ if set)%APPDATA%\sshm\backups\ (fallback: %USERPROFILE%\.config\sshm\backups\)Key Features:
Additional Storage:
Quick Recovery:
# Unix/Linux/macOS
cp ~/.config/sshm/backups/config.backup ~/.ssh/config
# Windows
copy "%APPDATA%\sshm\backups\config.backup" "%USERPROFILE%\.ssh\config"
By default, SSHM uses the standard SSH configuration file at ~/.ssh/config. You can specify a different configuration file using the -c flag:
# Use custom config file in TUI mode
sshm -c /path/to/custom/ssh_config
# Use custom config file with commands
sshm add hostname -c /path/to/custom/ssh_config
sshm edit hostname -c /path/to/custom/ssh_config
sshm move hostname -c /path/to/custom/ssh_config
SSHM provides a powerful move command to relocate SSH hosts between different configuration files. This feature requires SSH Include directives to be present in your SSH configuration.
# Move a host to another config file (requires Include directives)
sshm move my-server
# Move with custom config file (requires Include directives)
sshm move my-server -c /path/to/custom/ssh_config
β οΈ Important Requirements:
~/.ssh/config or the file specified with -c)Include statements referencing other SSH configuration filesFeatures:
Use Cases:
Example Setup Required: Your main SSH config file must contain Include directives like:
# ~/.ssh/config
Include ~/.ssh/config.d/*
Include work-servers.conf
Include projects/*.conf
Host personal-server
HostName personal.example.com
User myuser
SSHM features asynchronous SSH connectivity checking that provides visual indicators of host availability:
Status Indicators:
Features:
p to check again. Set ping_on_start to false to check only on demandSSHM includes built-in version checking that notifies you of available updates:
Features:
Update notifications appear:
Disabling update checks:
Via the CLI flag (one-time):
sshm --no-update-check
Via ~/.config/sshm/config.json (persistent):
{
"check_for_updates": false
}
SSHM remembers your port forwarding configurations for easy reuse:
Features:
Windows:
%USERPROFILE%\.ssh\configUnix/Linux/macOS:
~/.ssh/configSSHM works directly with your standard SSH configuration file (~/.ssh/config). It adds special comment tags for enhanced functionality while maintaining full compatibility with standard SSH tools.
SSHM fully supports SSH Include directives, allowing you to organize your SSH configurations across multiple files. This is particularly useful for managing large numbers of hosts or organizing configurations by environment, project, or team.
Include Examples:
# Main ~/.ssh/config file
Host personal-server
HostName personal.example.com
User myuser
# Include work-related configurations
Include work-servers.conf
# Include all configurations from a directory
Include projects/*
# Include with relative paths
Include ~/.ssh/configs/production.conf
Organization Examples:
work-servers.conf:
# Tags: work, production
Host prod-web-01
HostName 10.0.1.10
User deploy
ProxyJump bastion.company.com
# Tags: work, staging
Host staging-api
HostName staging-api.company.com
User developer
projects/client-alpha.conf:
# Tags: client, development
Host client-alpha-dev
HostName dev.client-alpha.com
User admin
Port 2222
Example configuration: Include ~/.ssh/conf.d/*
# Tags: production, web, frontend
Host web-prod-01
HostName 192.168.1.10
User deploy
Port 22
IdentityFile ~/.ssh/production_key
Compression yes
ServerAliveInterval 60
# Tags: development, database
Host db-dev
HostName dev-db.company.com
User admin
Port 2222
IdentityFile ~/.ssh/dev_key
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
# Tags: production, backend
Host backend-prod
HostName 10.0.1.50
User app
Port 22
ProxyJump bastion.company.com
ProxyCommand ssh -W %h:%p Jumphost
IdentityFile ~/.ssh/production_key
Compression yes
ServerAliveInterval 300
BatchMode yes
SSHM supports all standard SSH configuration options:
Built-in Fields:
HostName - Server hostname or IP addressUser - Username for SSH connectionPort - SSH port numberIdentityFile - Path to private key fileProxyJump - Jump server for connection tunneling (e.g., user@jumphost:port)ProxyCommand - Jump command for connection tunneling (e.g, ssh -W %h:%p Jumphost)Tags - Custom tags (SSHM extension); the special tag hidden hides the host from the TUI and sshm search while keeping it connectable via sshm <host>Additional SSH Options:
You can add any valid SSH option using the "SSH Options" field in the interactive forms. Enter them in command-line format (e.g., -o Compression=yes -o ServerAliveInterval=60) and SSHM will automatically convert them to the proper SSH config format.
Common SSH Options:
Compression - Enable/disable compression (yes/no)ServerAliveInterval - Interval in seconds for keepalive messagesServerAliveCountMax - Maximum number of keepalive messagesStrictHostKeyChecking - Host key verification (yes/no/ask)UserKnownHostsFile - Path to known hosts fileBatchMode - Disable interactive prompts (yes/no)ConnectTimeout - Connection timeout in secondsControlMaster - Connection multiplexing (yes/no/auto)ControlPath - Path for control socketControlPersist - Keep connection alive durationForwardAgent - Forward SSH agent (yes/no)LocalForward - Local port forwarding (e.g., 8080:localhost:80)RemoteForward - Remote port forwardingDynamicForward - SOCKS proxy port forwardingExample usage in forms:
SSH Options: -o Compression=yes -o ServerAliveInterval=60 -o StrictHostKeyChecking=no
This will be automatically converted to:
Compression yes
ServerAliveInterval 60
StrictHostKeyChecking no
SSHM supports a configuration file to customize its behavior, including key bindings and update checking.
Configuration File Location:
~/.config/sshm/config.json%APPDATA%\sshm\config.jsonExample Configuration:
{
"check_for_updates": false,
"focus_search_on_start": false,
"ping_on_start": false,
"key_bindings": {
"quit_keys": ["q", "ctrl+c"],
"disable_esc_quit": true
}
}
Available Options:
true. Set to false on air-gapped or offline machines to avoid connection delays.true (the search bar). Set to false to start on the host table; the -s / --search flag still starts on the search bar.true. Set to false to check only when you press p (for example with many hosts, or hosts behind a slow ProxyJump).["q", "ctrl+c"]falseFor Vim Users:
If you frequently press ESC accidentally causing the application to quit, set disable_esc_quit to true. This will disable ESC as a quit key while preserving all other functionality.
For Air-gapped Machines:
If SSHM is slow to start due to DNS timeouts when reaching GitHub, set check_for_updates to false. You can also use the --no-update-check CLI flag for a one-time override without editing the config file.
Default Configuration: If no configuration file exists, SSHM will automatically create one with default settings that maintain backward compatibility.
# Clone the repository
git clone https://github.com/Gu1llaum-3/sshm.git
cd sshm
# Build the binary
go build -o sshm .
# Run
./sshm
sshm/
βββ main.go # Application entry point
βββ cmd/ # CLI commands (Cobra)
β βββ root.go # Root command and interactive mode
β βββ add.go # Add host command
β βββ edit.go # Edit host command
β βββ move.go # Move host command
β βββ search.go # Search command
βββ internal/
β βββ config/ # SSH configuration management
β β βββ ssh.go # Config parsing and manipulation
β βββ connectivity/ # SSH connectivity checking
β β βββ ping.go # Asynchronous SSH ping functionality
β βββ history/ # Connection history tracking
β β βββ history.go # History management and last login tracking
β β βββ port_forward_test.go # Port forwarding history tests
β βββ version/ # Version checking and updates
β β βββ version.go # GitHub release checking and version comparison
β β βββ version_test.go # Version parsing and comparison tests
β βββ ui/ # Terminal UI components (Bubble Tea)
β β βββ tui.go # Main TUI interface and program setup
β β βββ model.go # Core TUI model and state
β β βββ update.go # Message handling and state updates
β β βββ view.go # UI rendering and layout
β β βββ table.go # Host list table component with status indicators
β β βββ add_form.go # Add host form interface
β β βββ edit_form.go# Edit host form interface
β β βββ move_form.go# Move host form interface
β β βββ port_forward_form.go # Port forwarding setup with history
β β βββ styles.go # Lip Gloss styling definitions
β β βββ sort.go # Sorting and filtering logic
β β βββ utils.go # UI utility functions
β βββ validation/ # Input validation
β βββ ssh.go # SSH config validation
βββ images/ # Documentation assets
β βββ logo.png # Project logo
β βββ sshm.gif # Demo animation
βββ install/ # Installation scripts
β βββ unix.sh # Unix/Linux/macOS installer
β βββ README.md # Installation guide
βββ .github/ # GitHub configuration
β βββ copilot-instructions.md # Development guidelines
β βββ workflows/ # CI/CD pipelines
β βββ build.yml # Multi-platform builds
βββ go.mod # Go module definition
βββ go.sum # Go module checksums
βββ LICENSE # MIT license
βββ README.md # Project documentation
Automated releases are built for multiple platforms:
| Platform | Architecture | Download |
|---|---|---|
| Linux | AMD64 | sshm-linux-amd64.tar.gz |
| Linux | ARM64 | sshm-linux-arm64.tar.gz |
| macOS | Intel | sshm-darwin-amd64.tar.gz |
| macOS | Apple Silicon | sshm-darwin-arm64.tar.gz |
| Windows | AMD64 | sshm-windows-amd64.zip |
| Windows | ARM64 | sshm-windows-arm64.zip |
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ by Guillaume
β Star this repo if you found it useful! β
165 followers Β· starred Jul 2026
104 followers Β· starred Sep 2025
38 followers Β· starred Sep 2025
30 followers Β· starred Aug 2026