A lightweight Bash utility for developers managing multiple GitHub accounts on a single machine. Seamlessly switch between personal and work SSH keys with a single command.
Working with multiple GitHub accounts (personal and work) on the same machine requires constantly updating SSH configurations. SSH-Switch automates this process, eliminating the manual hassle of editing ~/.ssh/config and managing different SSH keys.
- Quick Switching: Toggle between personal and work GitHub SSH keys instantly
- Automation: No manual config file editing required
- Simple CLI: Single script execution to change active SSH key
- Cross-Platform: Works on macOS, Linux, and WSL
- Bash shell
- Multiple SSH keys already generated for different GitHub accounts
- SSH keys stored in
~/.ssh/directory
- Clone the repository:
git clone https://github.com/FouL06/SSH-Switch.git
cd SSH-Switch- Make the script executable:
chmod +x sshswitch.sh- (Optional) Add to PATH for global access:
sudo cp sshswitch.sh /usr/local/bin/sshswitchRun the script and follow the prompts:
./sshswitch.shOr if installed globally:
sshswitchThe script will:
- Display your current SSH keys
- Prompt you to select which key to activate
- Update your SSH configuration automatically
- Confirm the switch
Ensure your SSH keys follow standard naming conventions:
- Personal:
id_rsaorid_ed25519 - Work:
id_rsa_workorid_ed25519_work
The script automatically detects available keys in ~/.ssh/ directory.
Perfect for developers who:
- Maintain separate GitHub accounts for work and personal projects
- Need to frequently switch contexts between different organizations
- Want to automate SSH key management without manual configuration
Contributions welcome! Feel free to open issues or submit pull requests.
github ssh automation shell management githubcli shell-script