search for: id_rsa_mykey

Displaying 1 result from an estimated 1 matches for "id_rsa_mykey".

2006 Aug 17
0
make ssh-add conditional?
...knocked back before - I didn't find it while googling. Anyway, I'd like ssh-add to have an option to add a key only if it is not already present in ssh-agent. I currently use a shell function to conditionally add a key, then login to a remote host: go () { ssh-add -L | grep -q 'id_rsa_mykey$'; if [ $? -eq 0 ]; then echo "my key already present"; else ssh-add ~/.ssh/id_rsa_mykey; fi; if [ $? -eq 0 ]; then ssh myhost; else echo "Oopsie"; fi } It works well enough, but it seems inelegant - I'd prefer if...