setup remote login (without password) using ssh2

In the following, we assume that you want to login as user on a machine called remote from a machine called local, where you are already logged in as user.
  1. Check, on both local and remote that ssh2 (sshd2) has been installed and that any earlier ssh installation has been removed (files belonging to earlier installations can be found in $prefix/bin, /etc/ssh, $prefix/sbin, $HOME/.ssh.
  2. On local:
    mkdir $HOME/.ssh2
    (if it does not yet exist)
  3. On remote:
    mkdir $HOME/.ssh2
    (if it does not yet exist)
  4. On local:
    cd $HOME/.ssh2
  5. On local:
    This generates a public-private key pair. Just hit ``return'' when asked for the pass phrase (if you provide a nonempty pass phrase, you will have to type it again each time you login to the remote system).
  6. On local: check the names of the 2 files generated in $HOME/.ssh2: usually something like id_dsa_1024_a (private key) and (public key).
    In what follows, I'll use these names; replace by the actual names if different. Of course, the private key file should be well protected, i.e. accessible only for user.
  7. On local:
    echo "IdKey id_dsa_1024_a" >identification
    to tell ssh which key you will be using to identify yourself.
  8. On local: copy the public key file to the remote machine:
      scp2 remote:.ssh2/
    (You will have to type your remote password).
  9. On remote: create a file $HOME/.ssh2/authorization containing the line
  10. On local:
    ssh remote
    should work without asking for a password or pass phrase.
Once you have this setup, you can also develop on local while keeping your cvs repository on remote: just add the following lines to your $HOME/.bash_profile.
export CVS_RSH=/usr/local/bin/ssh
export CVSROOT=:ext:user@remote:/path/to/cvsroot

See also the article `` OpenSSH key management'', part1 and part2 on IBM developerworks .

Dirk Vermeir ( [Last modified: Wed Jun 20 09:49:23 MEST 2001 ]