2008-05-27
I always used ssh-agent to remember keys ...
I always used ssh-agent to remember keys for me, but lately I started adding a timeout to keys so they don't get remembered indefinitely. Especially on my laptop: what if it gets stolen, the keys are still valid when it comes out of suspend mode. So now I type ssh-add -t 3600 so they are only valid for one hour. But, that is still not ideal as I need to remember that keys might be forgotten when I click on a button or menuitem in fvwm to start a new xterm-with-ssh. Otherwise I may be thrown out directly from the session or asked for a password or passphrase, depending on the SSH security settings. So, fvwm functions to the rescue:
AddToFunc SSHUR4 "I" Exec if ! ssh-add -l > /dev/null; then ssh-add -t 600 .ssh/id_dsa <&- 2>/dev/null ; fi; uxterm -fg black -bg '#e0e0e0' -geom 80x40 -title 'slogin $0' -vb -e ssh -e none $0 &
Now I can just use SSHR4 host.name and it will ask for the ssh passphrase when needed. In an fvwm menu item: AddToMenu Remote-Logins "idefix.net%mini-freebsd.xpm%" SSHR4 idefix.net and in an fvwm button: *FvwmButtons(Title idefix, Icon mini-freebsd.xpm, Action 'SSHUR4 idefix.net' )