A modern SSH connection manager written in Go with CLI mode support.
- ✅ Encrypted Storage: All passwords encrypted with AES-256-GCM using a master password
- ✅ Alias Support: Connect to servers using easy-to-remember aliases
- ✅ Fuzzy Search: Find hosts by partial alias matches
- ✅ Password Management: Secure password encryption and decryption
- ✅ Connection Testing: Test SSH connections before saving
- ✅ Full CRUD: Add, list, modify, and delete SSH hosts
- ✅ Shell Completion: Auto-completion for bash, zsh, fish, and PowerShell
- ✅ Cross-platform: Single binary for macOS, Linux, and Windows
- Go 1.23+ for building from source or installing via
go install - sshpass for password-based SSH connections
- macOS:
brew install hudochenkov/sshpass/sshpass - Linux:
sudo apt-get install sshpass
- macOS:
Go will automatically download all required dependencies when building:
gopkg.in/yaml.v3- YAML parsinggithub.com/spf13/cobra- CLI frameworkgithub.com/sahilm/fuzzy- Fuzzy search library- Standard library for encryption and SSH connections
go install github.com/aki-colt/sshmgr@latestThis will install the binary to ~/go/bin/ (or $(go env GOPATH)/bin). Make sure this directory is in your $PATH:
# Add to your shell profile (~/.bashrc, ~/.zshrc, etc.)
export PATH=$PATH:$(go env GOPATH)/bincd ssh-manager-go
go build -o sshmgr .go build -o sshmgr .
sudo mv sshmgr /usr/local/bin/Auto-completion is automatically enabled when you run sshmgr init for the first time.
# Auto-completion is installed automatically during init
sshmgr init
# Follow the instructions to source your shell configIf you need to reinstall completion later:
sshmgr completion-installIf you prefer manual setup or need to configure manually:
Bash:
# Load for current session
$ source <(sshmgr completion bash)
# Load for all sessions (Linux)
$ sshmgr completion bash > /etc/bash_completion.d/sshmgr
# Load for all sessions (macOS)
$ sshmgr completion bash > /usr/local/etc/bash_completion.d/sshmgrZsh:
# Load for current session
$ sshmgr completion zsh > "${fpath[1]}/_sshmgr"
# Start a new shell for changes to take effectFish:
# Load for current session
$ sshmgr completion fish | source
# Load for all sessions
$ sshmgr completion fish > ~/.config/fish/completions/sshmgr.fishPowerShell:
# Load for current session
PS> sshmgr completion powershell | Out-String | Invoke-Expression
# Load for all sessions
PS> sshmgr completion powershell > sshmgr.ps1
# Then add to your PowerShell profileFirst, initialize the master password:
$ sshmgr init
Enter master password: ********
Confirm master password: ********
Master password set successfully!$ sshmgr add
Enter alias: myserver
Enter host address: 192.168.1.100
Enter username: admin
Enter password: ********
Enter port (default 22): 22
Test connection? [Y/n]: Y
Connection test successful!
Host added successfully!$ sshmgr list
ID Alias Host User Port
---------------------------------------------------------------------
1 myserver 192.168.1.100 admin 22$ sshmgr connect myserver
Enter master password: ********
Connecting to 192.168.1.100 as admin...If you don't remember exact alias, you can use partial matches:
# These all work for alias "myserver"
$ sshmgr connect myserver
$ sshmgr connect myser
$ sshmgr connect mysv
# Or use shortcut with fuzzy matching
$ sshmgr myser$ sshmgr myserver
Enter master password: ********
Connecting to 192.168.1.100 as admin...$ sshmgr modify myserver
Enter master password: ********
Current configuration:
Alias: myserver
Host: 192.168.1.100
User: admin
Port: 22
Enter new alias (press Enter to keep current):
Enter new host (press Enter to keep current):
Enter new user (press Enter to keep current):
Enter new password (press Enter to keep current):
Enter new port (press Enter to keep current): 2222
Test connection? [Y/n]: Y
Host modified successfully!$ sshmgr delete myserver
Enter master password: ********
Are you sure you want to delete host 'myserver'? [y/N]: y
Host deleted successfully!Configuration is stored in ~/.ssh_manager_config.yaml in the following format:
version: "1.0"
master_hash: a1b2c3...
hosts:
- id: "1"
alias: myserver
host: 192.168.1.100
user: admin
password: encrypted_base64_string
port: 22
created_at: "2026-01-09"
updated_at: "2026-01-09"- Algorithm: AES-256-GCM (Galois/Counter Mode)
- Key Derivation: SHA-256 hash of master password
- Storage: Base64-encoded encrypted ciphertext
ssh-manager-go/
├── main.go # Application entry point
├── pkg/
│ ├── cli/
│ │ ├── commands.go # CLI command definitions
│ │ └── helpers.go # CLI helper functions
│ ├── config/
│ │ └── config.go # Configuration management
│ ├── encryption/
│ │ └── encryption.go # AES-256-GCM encryption
│ └── ssh/
│ └── ssh.go # SSH connection handling
├── go.mod
├── go.sum
└── README.md
- ✅ Passwords are encrypted before storage
- ✅ Master password required for decryption
- ✅ Configuration file permissions set to 0600 (owner read/write only)
- ✅ No passwords in command-line arguments
⚠️ Important: Keep your master password secure - it cannot be recovered if lost
| Feature | Bash Script | Go Implementation |
|---|---|---|
| Password Storage | Plaintext | Encrypted (AES-256-GCM) |
| Config Format | Plaintext | YAML |
| Alias Support | ❌ | ✅ |
| Fuzzy Search | ❌ | ✅ |
| Shell Completion | ❌ | ✅ |
| CLI Mode | ✅ | ✅ |
| Password Management | Plaintext | Encrypted |
| Cross-platform | Linux/macOS | Linux/macOS/Windows |
| Single Binary | ❌ | ✅ |
- github.com/spf13/cobra - CLI framework
- github.com/sahilm/fuzzy - Fuzzy search library
- Standard Library - crypto/aes, crypto/cipher, crypto/sha256
- SSH key support
- Host groups/tags
- Port forwarding configuration
- Command execution on remote hosts
- Configuration export/import
- History tracking
- Batch operations
MIT License - Feel free to use and modify as needed.
Contributions are welcome! Please feel free to submit a Pull Request.