make ssh-add conditional?

This is a discussion on make ssh-add conditional? within the OpenSSH Development forums, part of the Networking and Network Related category; Hi folks, I don't know if this has been suggested and knocked back before - I didn't find it ...


Go Back   Usenet Forums > Networking and Network Related > OpenSSH Development

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-17-2006
openssh@yarra.no-ip.org
 
Posts: n/a
Default make ssh-add conditional?

Hi folks, I don't know if this has been suggested and 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 ssh-add had this
built-in already, so I could do something like:

go()
{
ssh-add ~/.ssh/id_rsa_mykey && ssh myhost
}

....and ssh-add would not ask me for the passphrase if the key was already
present, and exit 0.

Is it feasible? Would it be useful? If I make a patch for it, would it stand a
chance of being accepted?

Regards, Philip.
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
http://lists.mindrot.org/mailman/lis...enssh-unix-dev
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:06 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0