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 and password protection
- π Cross-Platform - Works on macOS, Linux, and Windows (WSL)
- β‘ Zero Dependencies - Uses standard Unix tools (bash, ssh, expect)
# 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 ~/.bashrc # Linux/WSL with bashThat's it! The installer will:
- β Make scripts executable
- β
Add the
go2alias to your shell - β Set up secure file permissions
- β Check for 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 |
| SSH | β Pre-installed | β Pre-installed | β Available |
| expect | β Usually pre-installed | β Usually pre-installed |
Installing expect (if needed):
- macOS:
brew install expect - Linux (Debian/Ubuntu):
sudo apt-get install expect - Linux (RHEL/CentOS):
sudo yum install expect - Windows (WSL):
sudo apt-get install expect
# 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 withgo2commandhost- Server hostname or IP addressuser- SSH usernameport- SSH port (default: 22, optional)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)
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.
The installer automatically sets secure permissions:
chmod 600 servers.conf # Read/write for owner only
chmod +x go2.sh # Executable| Platform | Status | Notes |
|---|---|---|
| macOS | β Fully Supported | Tested and optimized |
| Linux | β Fully Supported | Works on all major distributions |
| Windows (WSL) | β Fully Supported | Same as Linux |
| Windows (Git Bash) | May require manual alias setup |
When using password authentication, go2 uses expect for automatic password entry. If expect isn't available, it falls back to an interactive prompt.
Automatic Password Entry:
- Requires
expect(usually pre-installed) - Passwords are entered automatically
- No manual typing required
Interactive Fallback:
- If
expectisn't available - You'll be prompted to enter the password manually
- Still works, just requires manual input
You can add any SSH options to your server configuration:
# Keep connection alive
-o ServerAliveInterval=60
# Skip host key checking (for testing)
-o StrictHostKeyChecking=no
# 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
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!