Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 3 down vote accepted

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


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?

share|improve this answer

Your Answer


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.