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

Re: ssh setup: what is the Debian way? [addendum]



On Sun, Apr 08, 2007 at 09:24:00PM -0600, Paul E Condon wrote:
> 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.
> 

I tried Florian's suggestion one more time, and success! Don't know
what I did wrong before, but now when I log-in, I get a window in
which I am instructed to enter the pass-phrase for my 'identity'. The
stuff about editing config files was unnecessary. Apparently the edits
were done automagically (by the install scripts for *askpass*,
perhaps?). I would say that the Debianly correct way to enable
ssh-agent with a pass-phrase is to install one of the *askpass*
packages.

-- 
Paul E Condon           
pecondon@mesanetworks.net



Reply to: