VERSION ⚠️
❗ 0️⃣.1️⃣-DEV ❗ 💥 This is a DEV version, so NO STABLE version 🚧
This bash script 'sshaddm' help you to add multiples keys to your ssh-agent with only one command.
It run correctly if you have the same passphrase for all yours keys you want to add in one time !!
In next version I'll add the possibility to add keys by passphrase's group ...
Take a look at TODO.md ;)
Tested on Ubuntu/Debian
- openssh-client
how verify :
dpkg -s openssh-client
how install (But Normally you would not be here if you don't know what is openssh-client and how it runs ;)) :
sudo apt-get install openssh-client
SSHADDM-DIR-NAME="The name you want for sshaddm directory"
git clone https://github.com/massipasquesi/sshaddm.git $SSHADDM-DIR-NAME
if you want sshaddm works everywhere,
you can create a symlink to sshaddm.sh in /usr/local/bin or /usr/bin (depends on your $PATH environment variable)
sudo ln -s $SSHADDM-DIR-NAME/sshaddm.sh /usr/local/bin/sshaddm
cd $SSHADDM-DIR-NAME/
./sshaddm.sh
or if you made the symlink
you can run it from everywhere with simply sshaddm
command :
sshaddm
When you run sshaddm for the first time you'll invited to set configuration variables from the prompt.
You can set variables manually by copying 'define.example' and naming it 'define.rc' into $SSHADDM-DIR-NAME
and set variables like explained in this CONFIG section below.
Everytime you want to change configuration variables you can do it manually or running 'setup.sh'
sshaddm -s
# OR
sshaddm --setup
# OR
cd $SSHADDM-DIR-NAME && ./setup.sh
define $keys_path : path to yours ssh_keys. No trailing slashs at the end of the path !
# exemple : all your keys in "your home"/.ssh directory
keys_path="${HOME}/.ssh"
If all your keys have the same prefix -> set $keys_prefix. If not set to empty string : ""
# exemple : all your keys's names are prefixed by "id_dsa_" :
keys_prefix="id_dsa_"
# exemple : keys's names have differents prefix or they don't have any :
keys_prefix=""
Define $keys_names : list ok keys's names separated by a space. If you setted $keys_prefix remove it from key's name
# exemple : all your keys's names have the same prefix $keys_prefix like :
# id_dsa_firstkey, id_dsa_secondkey, id_dsa_thirdkey
keys_names="firstkey secondkey thirdkey"
# exemple : keys's names have differents prefix or they don't have any like :
# mykey, another_key, my_prefered_key,
keys_names="id_dsa_mykey another_key my_prefered_key"