[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ssh setup: what is the Debian way? [not what I asked for, but OK ]



On Sat, Apr 07, 2007 at 08:26:23PM -0600, Paul E Condon wrote:
> Debian automagically starts ssh-agent somewhere along the chain of
> events that bring up X and Gnome.  I don't reboot often, but when I
> do, I forget to run ssh-add.  Where can I place an invocation of
> ssh-add so that it is run once just after login? I think there must be
> a Debianly correct answer. What is it?
> 

So, I learned a lot about what doesn't work for me. I settled on
adding the following to my .bashrc:

if [ -x /usr/bin/ssh ] && [ -d ~/.ssh ]; then
   function ssh {
      if [ "The agent has no identities." = "$(ssh-add -L)" ]; then
         ssh-add
      fi
      /usr/bin/ssh $@
      unset -f ssh
   }
fi

This defines a bash function that overlays ssh. When I forgetfully
start ssh without first running ssh-add, this runs ssh-add for me,
then drops me into the real ssh, then wipes itself out of bash
environment. IWFM. I'm still interested in a less kludgy solution, but
have other things to do. Thanks to all.

-- 
Paul E Condon           
pecondon@mesanetworks.net



Reply to: