Sunday, May 14, 2006

Unix Remote Login Without Password

This has been covered in many places, so this will be a short version. This is not using the insecure r?? commands with .rhosts.

Assume both machines have the same or similar ssh installation.

"hosthere" is where you are logged on. "hostfar" is where you want to log on.

Use an empty passphrase and default key location.
hosthere $ ssh-keygen -t dsa

Place "pub" file on hostfar in ~/.ssh as "authorized_keys2".
hosthere $ scp id_dsa.pub hostfar:.ssh/authorized_keys2

Now ssh and scp to "hostfar" should not prompt for a password.

Troubleshooting includes checking permissions of .ssh directory and files.

1 comment:

  1. May want to try another type of ssh-keygen.

    localhost $ ssh-keygen -t rsa
    (press ENTER for all prompts)

    Copy file /home/user/.ssh/id_rsa.pub to remotehost:/home/user/.ssh/authorized_keys2

    ReplyDelete