SOLVED. It was the group writable bit on user_B s home directory, that tricked me.
I'm running out of ideas on this one. Every hint would be highly appreciated.
Consider this setup:
- A server
Srunning Ubuntu, usersboldewyn,user_Aanduser_B - Two laptops
AandB, each with a local userboldewyn(has anid_rsakey to log inS) and a second keyid_rsa_A/id_rsa_B. All keys are stored in/home/boldewyn/.ssh. Both running Ubuntu. user_Aanduser_BonShave empty passwords, login should be possible only via publickey and SSH.+--------+ +-------------------+ +--------+ | laptop | | server | | laptop | | A | | S | | B | | | | | | | +--------+ SSH +-------------------+ SSH +--------+ |id_rsa_A|------------|< user_A user_B >|------------|id_rsa_B| +--------+ +-------------------+ +--------+ |id_rsa |------------|< boldewyn >|------------|id_rsa | +--------+ +-------------------+ +--------+
What works:
Log in from any laptop as
boldewyn(usingid_rsaandS:/home/boldewyn/.ssh/authorized_keysLog in from laptop
Aas useruser_A(usingid_rsa_AandS:/home/user_A/.ssh/authorized_keys:ssh -i id_rsa_A user_A@S)
My problem: On laptop B the exactly same setup fails for user_B. I can't log in on S, because for any reason the key is not accepted and the password prompt comes (user_B has no password, that's no option).
What I've checked:
On laptop
B:- Checked the rights of
~/.sshand all its content - put public part of
id_rsa_Binboldewyns.authorized_keysandssh -i id_rsa_B boldewyn@S: works (the key is not corrupt or so) ssh -vvv: Well, not really helpful: Just tells me at one point, that it skipspublickeymethod now. No reason given.
- Checked the rights of
On server
S:- Triple-checked
user_Bs.authorized_keysfile - Checked the rights of
/home/*/.sshand all their contents (especially compareduser_Aanduser_B) - Checked that
$HOMEis set (viasudo -u user_B -i) - Checked, that all users are in
/etc/ssh/sshd_configsAllowUsers(andAllowGroups, by the way)
- Triple-checked
Other stuff:
The only difference I can come up with between user_A and user_B is, that I created the latter with adduser -M (don't create a home directory; it already existed before). However, I triple-checked, that /home/user_B and all relevant children are owned by user_B and his primary group.
sshdon S in debug mode:sudo sshd -rdp 1234- often helps. (-p 1234is the temporary port which you will SSH to.) – grawity Dec 16 '10 at 13:51/home/user_B(as well as/home/user_B/.sshand/home/user_B/.ssh/authorized_keys) had the proper permissions not writable except to the user, i.e., mode 755 or more restrictive? – Gilles Dec 16 '10 at 23:04user_As case (working) with the ones foruser_B(not working). They're exactly the same (apart from file ownership, obviously). – Boldewyn Dec 17 '10 at 8:45