SSH public keys not working - RH 7.3
Ok I know this is a common problem but I've checked the basics and I still cannot get it to work...
I am trying to set up ssh over two servers using public keys instead of using passwords. I did the following: ssh-keygen -t rsa and it creates the files in the usal dir .ssh/id.rsa and .ssh/id_rsa.pub I then copy the .pub file to the server i wish to connect to: scp .ssh/id_rsa.pub <server>:.ssh/authorized_keys2 I then checked the permissions on the files/dirs so that we have: server1: drwx------ .ssh | -rw------- id_rsa -rw-r--r-- id_rsa.pub server2: drwx------ .ssh | -rw-r--r-- authorized_keys2 This is correct is it not? Whenever i try to ssh to server2 from server1 i get a password prompt. Is there anything else that could be causing the problem? Maybe something specific to RH7.3? |
Re: SSH public keys not working - RH 7.3
Hi, and welcome to LQ!
Quote:
Cheers, Tink |
It all depends on how your /etc/ssh/sshd_config is setup.
Please check that you do have 'pubkey authentication' enabled and that the file is named correctly as above poster mentions. |
I checked the config file and the 'pubkey authentication' line is commented out meaning it must be using the default, which is 'yes'.
The reason for the '2' is that it was stated in my O'Reilly book, perhaps that was a typo. I tried removing the 2 and it made no difference. |
Could it have anything to so with user accounts? I will not be using this logged on as root but as another user.
I cant seem to find anything else that could be causing the problem. |
On further thought it may still be a permissions issue, this time with the home directory. At the moment my home dir is full access 777. Perhaps thats why ssh doesnt like it when I try to use pulic keys.
I'll check it out. |
No, 777 on the home wouldn't affect that (but it's a bad
idea). Another common problem for authorized_keys is the way they get transferred from one machine to the other. Check that the file on the server does have the public key in ONE line. Cheers, Tink |
Just checked and it is all on one line.
|
All times are GMT -5. The time now is 06:33 PM. |