From owner-freebsd-questions Sun Jul 9 14:39:56 2000 Delivered-To: freebsd-questions@freebsd.org Received: from mta03-svc.ntlworld.com (mta03-svc.ntlworld.com [62.253.162.43]) by hub.freebsd.org (Postfix) with ESMTP id 79E1E37B669 for ; Sun, 9 Jul 2000 14:39:45 -0700 (PDT) (envelope-from mark@ukug.uk.freebsd.org) Received: from parish.my.domain ([62.253.91.190]) by mta03-svc.ntlworld.com (InterMail vM.4.01.02.27 201-229-119-110) with ESMTP id <20000709213943.SFNR16423.mta03-svc.ntlworld.com@parish.my.domain>; Sun, 9 Jul 2000 22:39:43 +0100 Received: (from mark@localhost) by parish.my.domain (8.9.3/8.9.3) id WAA08223; Sun, 9 Jul 2000 22:39:46 +0100 (BST) (envelope-from mark) Date: Sun, 9 Jul 2000 22:39:46 +0100 From: Mark Ovens To: cjclark@alum.mit.edu Cc: questions@FreeBSD.ORG Subject: Re: Question about the use of ssh-agent(1) Message-ID: <20000709223946.F233@parish> References: <20000709195220.C233@parish> <20000709140928.E394@dialin-client.earthlink.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20000709140928.E394@dialin-client.earthlink.net>; from cristjc@earthlink.net on Sun, Jul 09, 2000 at 02:09:28PM -0700 Organization: Total lack of Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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