I sometimes use ssh to connect to a remote machine. Once I enter the passphrase once, I can use ssh again without the passphrase, but even if I come back a long time later, it still doesn't ask me, because the key is cached. I can do ssh-add -D to remove the key from the cache, but I want that to happen automatically after, say, 1 hour. How can I do that?
Tell me more
×
Ask Ubuntu is a question and answer site for
Ubuntu users and developers. It's 100% free, no registration required.
|
|
|||
|
|
|
The program that caches your ssh keys is the ssh-agent program, if you look at the man page you can see this relivent option:
You can edit the ssh-agent program in your startup programs. Go to
You will need to restart your session (log out and back in) for it to take effect. You can also do a similar thing for your gpg key which also can be set in an agent program which can be launched the same way (but isn't installed by default) just in case you get sick of typing in your gpg pass-phrase for package building or emailing. |
||||
|
|
|
You can add a cron job for that. |
|||
|


