Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Jul 2000 22:39:46 +0100
From:      Mark Ovens <mark@ukug.uk.freebsd.org>
To:        cjclark@alum.mit.edu
Cc:        questions@FreeBSD.ORG
Subject:   Re: Question about the use of ssh-agent(1)
Message-ID:  <20000709223946.F233@parish>
In-Reply-To: <20000709140928.E394@dialin-client.earthlink.net>; from cristjc@earthlink.net on Sun, Jul 09, 2000 at 02:09:28PM -0700
References:  <20000709195220.C233@parish> <20000709140928.E394@dialin-client.earthlink.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jul 09, 2000 at 02:09:28PM -0700, Crist J. Clark wrote:
> On Sun, Jul 09, 2000 at 07:52:20PM +0100, Mark Ovens wrote:
> > I've read the manpages for ssh-agent(1) and ssh-add(1) but require
> > clarification on a couple of points.
> > 
> > Is adding:
> > 
> >    eval `ssh-agent`
> >    ssh-add
> > 
> > to ~/.login {a,the} correct way to start it?
> 
> Does it work? :) I think that would be a legit way to start it.
> 
> > If I login (as the same user) on more than one ttyv do I need to run
> > an ssh-agent on each login?
> 
> I think this work around would do it (written in sh even though you
> look like you are using csh),
> 
>   if [ ! -f $HOME/.ssh-agent.sh ]; then
>     UMASK=`umask`
>     umask 600
>     ssh-agent > $HOME/.ssh-agent.sh
>     umask $UMASK
>     . $HOME/.ssh-agent.sh
>     ssh-add
>   else
>     . $HOME/.ssh-agent.sh
>   fi
> 
> The only issue here is going to be that you need to clean up that file
> properly when you exit. You are going to want to kill off the running
> ssh-agent as well... How to tell when you are the last program using
> the ssh-agent... Hmmm...
> 
> > If not, should the commands in ~/.login be:
> > 
> >    if (! $SSH_AGENT_PID ) then
> >       eval `ssh-agent`
> >       ssh-add
> >    fi
> 
> Hmmm... Wouldn't that be,
> 
>   if ( ! $?SSH_AGENT_PID ) then
> 
> In csh?
> 
> Anywhoo, for my extra $0.02. I typically use ssh-agent to "parent" an
> entire X session. I have the following alias,
> 
>   alias ssh-startx  ssh-agent startx
> 

Ah, that seems like a cleaner solution (I don't envisage needing ssh
in the console).

> And in .xinitrc,
> 
>   if [ ! "X$SSH_AGENT_PID" = "X" ]; then
>     sleep 3
>     \xterm -T "SSH AUTHORIZATION" -fn '7x14' -geometry 85x5+150+250 -e ssh-add
     ^^^

Is the ``\'' a typo?

>   fi
> 
> The benefit of using the 'ssh-agent command' style is that the
> ssh-agent will exit gracefully when the child process exits.
> -- 
> Crist J. Clark                           cjclark@alum.mit.edu

-- 
  If I buy a copy of WinDelete, and it doesn't delete Windows,
  am I entitled to my money back?
________________________________________________________________
      FreeBSD - The Power To Serve http://www.freebsd.org
      My Webpage http://ukug.uk.freebsd.org/~mark/
mailto:mark@ukug.uk.freebsd.org             http://www.radan.com



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000709223946.F233>