LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Passwordless SSH access

[ILUG] Passwordless SSH access

Niall O Broin niall at linux.ie
Tue Mar 19 14:20:05 GMT 2002


OK - this is what I've finally done, and It Works For Me (TM, ©). In
.bash_profile I have

------------------------------------------------------------
/usr/local/bin/ssh-agent-setup
. $HOME/.ssh/env
------------------------------------------------------------

and in .xsession I have

------------------------------------------------------------
#!/bin/bash
if ps aux |grep -v grep|grep -q "$USER.*ssh-agent$"; then
   . $HOME/.ssh/env
else
   ssh-agent |grep -v echo > $HOME/.ssh/env
   . $HOME/.ssh/env
   SSH_ASKPASS=/usr/lib/ssh/x11-ssh-askpass ssh-add ~/.ssh/identity
fi
startkde
eval `ssh-agent -k`
------------------------------------------------------------

/usr/local/bin/ssh-agent-setup is:

------------------------------------------------------------
#!/bin/sh
if ps aux |grep -v grep|grep -q "$USER.*ssh-agent$"; then
    exit 0
fi
ssh-agent |grep -v echo > $HOME/.ssh/env
. $HOME/.ssh/env
ssh-add ~/.ssh/identity
------------------------------------------------------------

Leaving out the $ after ssh-agent above is A Bad Thing, take it from me :-(

Of course a less stubborn person might have just renamed ssh-agent-setup :-)

Note that I've nothing in .bashrc - it's not necessary because any bash will
either be a login shell (e.g. if I ssh into the box) or will be part of an X
session, in which case it'll inherit the environment variables set in
.xsession.

If you use a different shell, make the appropriate adjustments, and you may
also want to replace startkde in .xsession with whatever it takes to start
your choice of X clients.

I posted this so that others who've been struggling with this might find it
useful, but I'd also appreciate comments from anyone who sees any glaring
holes - the above works but is by no means battle hardened.


Regards,


Niall




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell