GitHunt
KN

Zero-dependency SSH alias manager for macOS, Linux, and WSL. Connect smarter, not harder.

go2 - SSH Connection Manager

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.

Platform Support
License


โœจ Features

  • ๐Ÿš€ 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 add command
  • ๐Ÿ“ 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)

๐ŸŽฏ Quick Start

Installation

# 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 bash

That's it! The installer will:

  • โœ… Make scripts executable
  • โœ… Add the go2 alias to your shell
  • โœ… Set up secure file permissions
  • โœ… Check for dependencies

Your First Server

# Add a server interactively
go2 add

# Connect to it
go2 my-server

# List all servers
go2 list

๐Ÿ“‹ Requirements

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 โš ๏ธ May need install

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

๐Ÿš€ Usage

Basic Commands

# 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

Real-World Examples

# 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 list

โš™๏ธ Configuration

Adding Servers

go2 add

The 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

Method 2: Manual Configuration

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 with go2 command
  • host - Server hostname or IP address
  • user - SSH username
  • port - 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|||

๐Ÿ” Security

Best Practices

  1. Use SSH Keys - Prefer SSH key authentication over passwords
  2. Restrict Permissions - The installer sets chmod 600 on servers.conf automatically
  3. Version Control - The servers.conf file is excluded from git (via .gitignore)
  4. Password Storage - If you must use passwords, they're stored in plain text. Consider using SSH keys instead.

File Permissions

The installer automatically sets secure permissions:

chmod 600 servers.conf  # Read/write for owner only
chmod +x go2.sh          # Executable

๐ŸŒ Platform Support

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) โš ๏ธ Partial May require manual alias setup

๐Ÿ”ง Advanced Usage

Password Authentication

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 expect isn't available
  • You'll be prompted to enter the password manually
  • Still works, just requires manual input

Custom SSH Options

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=10

๐Ÿ—‘๏ธ Uninstallation

To remove go2 from your system:

cd /path/to/go2
./uninstall.sh

This will:

  • Remove the go2 alias 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

๐Ÿ“ Notes & Tips

  • 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

๐Ÿค Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Suggest new features
  • Submit pull requests
  • Improve documentation

๐Ÿ“„ License

This project is open source and available under the MIT License.


๐Ÿ™ Acknowledgments

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!