Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I use ssh to connect to a remote site (from ubuntu desktop to debian server). When I first connect a dialog pops up (probably from gnome or seahorse) asking for the passphrase, but from then on it connects with no dialog. That's fine, but I would like it to expire eventually. As it is, even days later, I don't need to give the password, until I log out or reboot or run "ssh-add -D" manually (from the ubuntu desktop). How do I set an expiration?

Edit: using some answers from here as clues, I've figured out (I think) that seahorse and ssh-agent are being started from the /etc/X11/Xsession.d on my ubuntu desktop system. There are files for each (seahorse and ssh-agent). It seems like ssh-agent is the go-to program for what I want to do, since seahorse just puts a GUI face on it, but I can't figure out how to specify arguments to ssh-agent. The 90x11-common_ssh-agent file is not very straightforward... it refers to $OPTIONFILE but I have no idea what that variable is set to or how to find out.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

In /etc/X11/Xsession.d/90x11-common_ssh-agent add your arguments to SSHAGENTARGS at the top:

SSHAGENTARGS='-t 1d'

or however long you want the key to last. If there isn't an SSHAGENTARGS, then post the contents of the file and I'll let you know where to edit it.

OPTIONFILE is something different. It a file where you say if you want ssh-agent to start period - you can't place arguments to the program in it. The file is at /etc/X11/Xsession.options

share|improve this answer
    
Found it, thanks! I put -t 1h hope that works for 1 hour! –  JoelFan Jun 8 '09 at 5:18

Could it be using the lifetime option to ssh-agent?

http://www.cl.cam.ac.uk/cgi-bin/manpage?ssh-agent

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.