diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-10-25 15:43:07 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-10-25 15:43:07 -0200 |
commit | 32ab57ed1e4412d2eba8200d9d1b45d6d78d613a (patch) | |
tree | 51cf875b8701f3f2e45aa6843ca293f036b3da1e | |
parent | 5e3520fdf0ce6c530896adbe4344bf497cd4fbd8 (diff) | |
download | utils-ssh-32ab57ed1e4412d2eba8200d9d1b45d6d78d613a.tar.gz utils-ssh-32ab57ed1e4412d2eba8200d9d1b45d6d78d613a.tar.bz2 |
Adds ssh-agent-loadkeys
-rwxr-xr-x | ssh-agent-loadkeys | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ssh-agent-loadkeys b/ssh-agent-loadkeys new file mode 100755 index 0000000..5687ef6 --- /dev/null +++ b/ssh-agent-loadkeys @@ -0,0 +1,29 @@ +#!/bin/bash +# +# Load keys into the ssh-agent +# Uses monkeysphere and keychain +# + +if ! ssh-add -l &> /dev/null; then + monkeysphere subkey-to-ssh-agent +fi + +if [ -x '/usr/bin/keychain' ]; then + mkdir -p $HOME/.keychain + + if [ -e "$HOME/.ssh/id_rsa" ]; then + /usr/bin/keychain -q $HOME/.ssh/id_rsa + fi + + if [ -e "$HOME/.ssh/id_ed25519" ]; then + /usr/bin/keychain -q $HOME/.ssh/id_ed25519 + fi + + if [ -e "$HOME/.keychain/$HOSTNAME-sh" ]; then + . $HOME/.keychain/$HOSTNAME-sh + fi + + if [ -e "$HOME/.keychain/$HOSTNAME-sh-gpg" ]; then + . $HOME/.keychain/$HOSTNAME-sh-gpg + fi +fi |