Freitag, 18. April 2008

automatic ssh login to remote without a password

If you wish to login to a remote machine without giving the password every time, use following sequence:

1) generate on your LOCAL machine a key pair with: ssh-keygen -t rsa (don't type in any password, just keep hitting enter)
2)file transfer the (local) PUBLIC key ~/.ssh/id_rsa.pub to the machine you which to automatically login to and append it to the (remote) file ~/.ssh/authorized_keys on your remote machine
3)make sure the (remote) authorized_keys is not read or modifiable by group or others my doing (remote) chmod 700 ~/.ssh/authorized_keys
4)make sure the ~/.ssh directory on the REMOTE machine is not read or modifiable by group or others my doing (remote) chmod 700 ~/.ssh
5)You may need to enable empty password authentication (need root access) on the REMOTE machine in the config file sshd_config. Make "permitemptypasswords yes". Restart SSH Daemon on REMOTE.

That's it

If you still can not log in without password then check the priorities of your home directory.
You can as well change temporarily in the file /etc/ssh/sshd_config
If this does not help, change the following option on the remote sshd config:

#LogLevel INFO
to
LogLevel DEBUG

...and of course restart the sshd daemon.
Then you see why it is still not working in the /var/log/messages file.

automatic ssh login to remote without a password