Linux tip, Fedora tip / howto: Automatic login with ssh

 
back to notes and tips index

Try my online puzzle page with Calcudoku, Killer Sudoku and online Sudoku.

Automatic login with ssh

  • in the following, the client is, for example, your office PC, and the server is for example bolle
  • make sure you have a ~/.ssh subdirectory on both
  • on the client:
    ssh-keygen -t rsa1
    ssh-keygen -t dsa
    (for both, enter a passphrase when prompted)
    (it may be you only need an RSA key, for example, or that you need a key of type rsa instead of rsa1)
  • add this line to your .login:
    /usr/bin/ssh-agent | grep -v echo > ~/.ssh/env.dat
    (the grep is to get rid of the echo of the process id)
  • and add this line to your .cshrc:
    source ~/.ssh/env.dat
  • cd .ssh
    scp identity.pub bolle.cs:~/.ssh
    scp id_dsa.pub bolle.cs:~/.ssh
  • also on the client:
    create a file ~/.ssh/config, with the lines:
    Host *
            PreferredAuthentications publickey,password

  • next, on the server:
    cd .ssh
    cp identity.pub authorized_keys
    cp id_dsa.pub authorized_keys2
    chmod 600 *
  • on the client, try it out:
    ssh bolle


← back to notes and tips index
Please do not copy the text of this tip (© Patrick Min) to your web site.