One command to manage all your SSH keys across any device.
Never manually configure SSH keys again. Perfect for developers who juggle multiple accounts (work, personal, freelance) across different machines.
- 🚀 One-line installation - Clone and run, that's it
- 🔄 Easy switching - Switch between SSH profiles instantly
- 🌍 Cross-platform - Works on macOS, Linux, and Windows
- ⚡ Zero dependencies - Single binary, no runtime needed
- 🔧 Auto-configuration - Manages SSH config, Git config, and SSH agent
- 📦 Portable - Copy the binary anywhere, it just works
macOS / Linux:
git clone https://github.com/abhinavgupta-de/ssh-manager.git
cd ssh-manager
chmod +x install.sh
./install.shWindows (PowerShell):
git clone https://github.com/abhinavgupta-de/ssh-manager.git
cd ssh-manager
PowerShell -ExecutionPolicy Bypass -File install.ps1That's it! The script will:
- ✅ Build the binary for your platform
- ✅ Install it globally
- ✅ Add it to your PATH
- ✅ Make it executable
Create your first profile:
sshm newFollow the prompts:
Profile name: work
Email: you@company.com
Git username: johndoe
Git host: github.com
The tool will:
- Generate an SSH key pair
- Display your public key
- Save your profile
Copy the displayed public key to your GitHub/GitLab account!
Create more profiles:
sshm new # Create 'personal' profilesshm newsshm listsshm switch work
sshm switch personalWhen you switch, the tool automatically:
- Updates your SSH config
- Changes Git global username and email
- Adds the key to SSH agent
sshm currentsshm delete old-work# Monday morning - time for work
sshm switch work
git clone git@github.com:company/project.git
# Evening - personal project time
sshm switch personal
git clone git@github.com:me/side-project.git
# Check which profile is active
sshm currentWhen you run sshm switch work:
-
Updates
~/.ssh/config:Host github.com IdentityFile ~/.ssh/id_rsa_work IdentitiesOnly yes -
Updates Git config:
git config --global user.name "Your Work Name" git config --global user.email "work@company.com"
-
Loads key to SSH agent:
ssh-add ~/.ssh/id_rsa_work
Problem: You have multiple GitHub accounts (work, personal, freelance). Every time you:
- Clone a repo, you get permission errors
- Make a commit, it has the wrong email
- Setup a new laptop, you spend 30 minutes configuring SSH
Solution: One command switches everything. Setup new machines in seconds.
# Build for your current platform
go build -o sshm main.go
# Cross-compile for all platforms
make build-all
# Or manually:
GOOS=darwin GOARCH=amd64 go build -o sshm-mac main.go
GOOS=linux GOARCH=amd64 go build -o sshm-linux main.go
GOOS=windows GOARCH=amd64 go build -o sshm.exe main.gossh-manager/
├── main.go # Main application code
├── install.sh # Unix/Linux/macOS installer
├── install.ps1 # Windows PowerShell installer
├── Makefile # Build automation
└── README.md # This file
- SSH keys are stored in standard
~/.ssh/directory - Profile metadata stored in
~/.ssh-profilesin your home directory - No keys or sensitive data transmitted anywhere
- All operations are local to your machine
Contributions welcome! Please feel free to submit a Pull Request.
MIT License - feel free to use this in your own projects!
Command not found after installation:
- Restart your terminal
- Or run:
source ~/.zshrc(or~/.bashrc)
Permission denied when connecting:
- Make sure you copied the public key to your Git provider
- Run
sshm currentto verify the correct profile is active - Check
ssh -T git@github.comto test connection
Keys not switching:
- Run
ssh-add -Dto clear SSH agent - Then run
sshm switch <profile>again
If this tool saves you time, give it a star! ⭐
Made with ❤️ for developers tired of SSH configuration headaches