PDA

View Full Version : SSH to a Fedora system


jnylin
2008-07-09, 07:15 AM CDT
Hi!

I have two computers on a network, one Slackware-desktop and one Fedora-laptop, and want to be able to login to one another without the use of passwords. I've created rsa-keys without passwords and there's no problem to login to the Slackware-desktop from Fedora with the use of the rsa-key, but I don't get the key-authorization to work when I login to the Fedora-laptop from the Slackware-desktop. Despite the fact that the Slackware user's rsa-key is present in ~/.autorized_keys on the Fedora laptop I still have to enter the password. Any suggestions?

stevea
2008-07-09, 08:16 AM CDT
Check the file permissions. To login to Fedora(server) with no password the Fedora system should have:
ls -l ~/.ssh/authorized_keys
-rw------- 1 stevea stevea 393 2008-03-18 04:58 /root/.ssh/authorized_keys
and on the slackware system
# ls -l ~/.ssh/id_rsa
-rw------- 1 fred fred 1675 2008-03-18 04:58 /root/.ssh/id_rsa

If these do not have permissions "-rw-------" login will fail. If they are not owned by the login account this will fail. Set permissions with "chmod 0600 ~/.ssh/id_rsa " and similar for authorized _keys.
Set ownership with "chown jnylin:jnylin ~/.ssh/id_rsa" (use your acct and group id - for each system).

If that doesn't work then debug with "-v":
ssh -v jnylin@fedora-sysname

jnylin
2008-07-09, 09:59 AM CDT
Off topic: First of all, I want to excuse the double post. It was a mistake that I don't even was conscious of -- I just tried to correct a miss spelling.

Okey, on topic: Yes, stevea, I had tried all that but without success. However, I've now solved the problem. I started the SSH daemon in a terminal windows on the Fedora system so that I could see the server's debugging information. That told me that the $HOME directory had bad permissions, so I sat them to the same as on the Slackware system and then all worked as expected.