Quickly connect to your servers with simple aliases. No more remembering IP addresses, usernames, or typing long SSH commands.
go2 is a lightweight, cross-platform SSH management system that lets you connect to your servers using memorable aliases. Just type go2 server-name and you're connected. Perfect for developers, sysadmins, and anyone who manages multiple servers.
- π Lightning Fast - Connect to servers instantly with short aliases
- π Multiple Auth Methods - Support for SSH keys, passwords, and custom ports
- π¨ Beautiful Terminal UI - Color-coded output for better readability
- β Interactive Setup - Add servers easily with
go2 addcommand - π Simple Configuration - Plain text config file, easy to edit and version control
- π Secure by Default - Proper file permissions (600) and no auto-accepting of unknown host keys
- π Cross-Platform - Works on macOS, Linux, and Windows (WSL)
- β‘ Minimal Dependencies - Uses standard Unix tools (bash, ssh); password auth via OpenSSH
SSH_ASKPASS
# Clone the repository
git clone https://github.com/knaps151/go2.git
cd go2
# Run the installation script
./install.sh
# Reload your shell
source ~/.zshrc # macOS/Linux with zsh
# or
source ~/.bash_profile # macOS with bash
# or
source ~/.bashrc # Linux/WSL with bashThat's it! The installer will:
- β Make scripts executable
- β
Add the
go2alias to your shell - β Set up secure file permissions (600 for config)
- β Check for optional dependencies
# Add a server interactively
go2 add
# Connect to it
go2 my-server
# List all servers
go2 list| Requirement | macOS | Linux | Windows (WSL) |
|---|---|---|---|
| Bash | β Pre-installed | β Pre-installed | β Pre-installed |
| OpenSSH (8.4+) | β Pre-installed | β Pre-installed | β Available |
Note: Automatic password entry uses OpenSSH SSH_ASKPASS (no expect), so the session keeps a normal TTY β arrow keys, Ctrl+C, and resize all work.
# Connect to a server
go2 server-name
# Add a new server (interactive)
go2 add
# List all configured servers
go2 list
# or simply
go2
# Show help
go2 help# Connect to your web server
go2 web1
# Connect to database server on custom port
go2 db-prod
# Add a new staging server
go2 add
# Follow the prompts...
# See all your servers at a glance
go2 listgo2 addThe interactive wizard will guide you through:
- Server name (alias)
- Hostname or IP address
- Username
- Port (defaults to 22)
- Authentication method (SSH key, password, or default)
- Additional SSH options
Edit servers.conf directly:
# Format: name|host|user|port|key_file|password|options
web1|192.168.1.100|admin|22|~/.ssh/id_rsa||
db-server|db.example.com|root|2222|~/.ssh/db_key||
prod|prod.example.com|deploy|22||mypassword|Configuration Fields:
name- Short alias to use withgo2command (letters, numbers, dots, dashes, underscores only)host- Server hostname or IP addressuser- SSH usernameport- SSH port (default: 22, must be a valid number 1-65535)key_file- Path to SSH private key (optional)password- SSH password (optional, stored in plain text)options- Additional SSH options (optional)
Example Configurations:
# SSH key authentication
web1|192.168.1.100|admin|22|~/.ssh/id_rsa||
# Custom port with SSH key
db-server|db.example.com|root|2222|~/.ssh/db_key||
# Password authentication (not recommended for production)
prod|prod.example.com|deploy|22||mypassword|
# With custom SSH options
staging|staging.example.com|deploy|22|~/.ssh/key||-o ServerAliveInterval=60
# Default SSH keys
test|test.example.com|user|22|||- Use SSH Keys - Prefer SSH key authentication over passwords
- Restrict Permissions - The installer sets
chmod 600onservers.confautomatically - Version Control - The
servers.conffile is excluded from git (via.gitignore) - Password Storage - If you must use passwords, they're stored in plain text. Consider using SSH keys instead.
- Host Key Verification - go2 does NOT auto-accept unknown host keys; you must verify them manually
The installer and go2 automatically set secure permissions:
chmod 600 servers.conf # Read/write for owner only
chmod +x go2.sh # ExecutableIf the config file has insecure permissions, go2 will display a warning.
| Platform | Status | Notes |
|---|---|---|
| macOS | β Fully Supported | Tested on Bash 3.2+ and Zsh |
| Linux | β Fully Supported | Works on all major distributions |
| Windows (WSL) | β Fully Supported | Same as Linux |
| Windows (Git Bash) | May require manual alias setup |
When a password is stored in servers.conf, go2 feeds it to OpenSSH via SSH_ASKPASS so you get a normal interactive SSH session (working arrow keys / readline). Passwords are passed through a short-lived helper script and an environment variable β they are not embedded in process arguments.
You can add any SSH options to your server configuration:
# Keep connection alive
-o ServerAliveInterval=60
# Custom timeout
-o ConnectTimeout=10To remove go2 from your system:
cd /path/to/go2
./uninstall.shThis will:
- Remove the
go2alias from your shell configuration - Create a backup of your shell config file
You can then delete the go2 directory if desired:
rm -rf /path/to/go2- Path Expansion: The script automatically expands
~in key file paths to your home directory - Missing Keys: If a key file is specified but not found, the script falls back to default SSH keys
- Empty Fields: Leave empty fields empty (use
||for empty fields in config) - Comments: Lines starting with
#are treated as comments - Duplicate Servers: The script will prompt to overwrite if you try to add a server that already exists
- Config Location: The config file is stored in the same directory as
go2.sh - Line Endings: The config file supports both Unix (LF) and Windows (CRLF) line endings
Contributions are welcome! Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
- Improve documentation
This project is open source and available under the MIT License.
Built with β€οΈ for developers and sysadmins who value simplicity and efficiency.
Made with: Bash, SSH, and a lot of terminal love.
Questions? Issues? Open an issue on GitHub!