On 2007-04-08T21:24:00-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?

In case it was not already been suggested install and configure
libpam-ssh.  I ended up setting the password for my personal account to
! in /etc/shadow and just authenticate against the passphrase of my
private key (while root continues to use std unix auth).

/etc/pam.d/common-auth:

auth sufficient pam_unix.so nullok_secure
auth sufficient pam_ssh.so try_first_pass keyfiles=id_dsa

/etc/pam.d/common-session:

session optional pam_ssh.so
session required pam_unix.so
 
> 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

You may want to ensure you have an interactive session (i.e. PS1 set),
and check SHLVL so you do this less.


/Allan


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to