Skip to content

Bash utility to save and load your ~/.ssh/id_* files

Notifications You must be signed in to change notification settings

YieldRay/ssh-switcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ssh-switcher

Bash utility to save and load your ~/.ssh/id_* files

Supports linux & windows (with git bash)

App data will be saved to ~/.config/ssh-switcher/

Usage

Usage: ssh-switcher.sh [-h] [-v] <subcommand>

Switch your ~/.ssh/id_rsa.pub and ~/.ssh/id_rsa file with ease

Commands:
    save      <name> [<email>]     Save ssh key files
    load      <name> [--no-git]    Load saved files
    remove/rm <name>               Remove saved files
    list/ls                        List saved files with name
    whoami                         Show current name

Available options:
-h, --help      Print this help and exit
-v, --verbose   Print script debug info

Recommendations:
name should be `git config --global user.name`
email should be `git config --global user.email`

Installation Reference

Just for reference, since you might want to install to another path

# example
mkdir -p ~/.config/ssh-switcher/script
curl -fLk https://raw.githubusercontent.com/YieldRay/ssh-switcher/main/ssh-switcher.sh > ~/.config/ssh-switcher/script/ssh-switcher
export PATH="$PATH:$HOME/.config/ssh-switcher/script/"

linux

Download ssh-switcher.sh and move it to ~/.config/ssh-switcher/script/ssh-switcher
Modify your PATH environment variable, done!

windows

Download ssh-switcher.sh and ssh-switcher.cmd and move them to %USERPROFILE%\.config\ssh-switcher\script\
Run systempropertiesadvanced.exe to modify your PATH environment variable, done!

You need have git for windows pre-installed, which ships an bash.exe executable
If you installed git for windows with a custom path, edit ssh-switcher.cmd file

About

Bash utility to save and load your ~/.ssh/id_* files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published