[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 2007-04-09 00:01:59 -0400, Allan Wind wrote:
> On 2007-04-08T21:24:00-0600, Paul E Condon wrote:
> > 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.

This is a bad idea. SSH can also be used in non-interactive sessions
(e.g. by Subversion, rsync, unison and so on). Such a check must not
be done if you want your wrapper to work with these programs (but of
course, you need to set $SVN_SSH and so on to a shell script that
calls ssh).

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)



Reply to: