0

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.

JoelFan
  • 2,285
  • 5
  • 26
  • 30

2 Answers2

3

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

Steven
  • 3,029
  • 20
  • 18
0

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

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

Matt Simmons
  • 20,396
  • 10
  • 68
  • 116