Using SSH with Gnome

If you're using Gnome as your desktop GUI environment, there is a relatively easy way to use ssh-agent to automatically save your ssh passphrase to seamlessly log into other machines once you've entered your passphrase. This document assumes that you have already set up ssh passphrase access on the relevant machines. This is only to document how to use Gnome to do the ssh-add instead of having it on the command line after you type startx. The point of this is that now your virtual console session can be closed automatically once you boot into Gnome and isn't left laying around allowing access even if your X screen is locked. I understand that there are many of us in this group who do not place such a high value on system security, but I attempt to do might part to pull at popular opinion and habit from the paranoid world that I live in. These instructions are for our PCs as the Suns do not run Gnome.

Conversion from current accounts

  1. Set up Gnome to use ssh-add on startup [* Alternatively you can just directly edit your '~/.gnome/session-manual' file and add the following lines
    0,Priority=50
    0,Restartcommand=/usr/bin/ssh-add
    
    Also make sure that the 'num_clients' line is incremented. If you had nothing here previously, make sure you have the following line before the above two.
    num_clients=1
    
    Similarly to above, if you're using ssh2 add '~/.ssh/id_dsa' to the second line above.]

  2. Edit your 'startx' file and comment out the present ssh-add lines.
  3. Now you can go ahead and change your 'startx' alias to
    alias startx "ssh-agent ~/startx & ; sleep 60 ; exit
    

Michael Wood-Vasey
Last modified: Fri Jan 5 10:37:45 PST 2001