Setting up an ssh-agent to cvs.sanger.ac.uk

  1. set up .ssh/authorized_keys on your local machine
    1. mkdir $HOME/.ssh (unless already there)
    2. cd $HOME/.ssh
    3. if you have an authorized_keys file and an identity.pub file, see if authorized_keys contains the text from identity.pub
    4. if not
      1. ssh-keygen -t rsa1    (use your standard passphrase)  (this produces the identity.pub file)
      2. cat identity.pub >> authorized_keys   (appends)
  2. get that file into your sanger home
    1. on your local machine:
      1. emacs authorized_keys
      2. select and copy the contents of that file (make sure you haven't introduced incorrect newlines)
      3. ssh cvs.sanger.ac.uk (to get to the sanger machine)
    2. on the sanger machine:
      1. mkdir .ssh
      2. emacs .ssh/authorized_keys
      3. paste what you had copied into your clipboard
      4. save the file
      5. logout from sanger
  3. test ssh to sanger from your local machine:
    1. ssh -1 cvs.sanger.ac.uk
    2. it should ask you for your passphrase (not a password)
    3. if it doesn't debug by using ssh -1 -v cvs.sanger.ac.uk  
  4. create the ssh1 command (if you don't already have an ssh1 command)
    1. in a bin/ directory that is in your path, and that you can write to, do this:
    2. echo "ssh -1 $*" > ssh1
    3. chmod +x ssh1
    4. rehash
    5. now test ssh1:
      1. ssh1 cvs.sanger.ac.uk
  5. setup the CVS_RSH variable, in your .login or .cshrc
    1. setenv CVS_RSH ssh1
    2. now open a new terminal window so that the change will take effect (or use the source command)
    3. test that:
      1. cd to a directory that was checked out from sanger
      2. cvs update
      3. it should ask you for a passphrase
  6. start up your agent:
    1. eval `ssh-agent`
    2. ssh-add
  7. test cvs again.  this time it should not ask for a passphrase or password
  8. to alert a new terminal window to the presence of the agent:
    1. in the terminal in which the agent is already running:
      1. env | grep SSH_A
    2. in the new terminal
      1. set the environment following environment variables with the values from the first terminal
        1. SSH_AUTH_SOCK
        2. SSH_AGENT_PID