SSH Keys not working - in some accounts but not all
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
SSH Keys not working - in some accounts but not all
I have a cluster where the /home directories are nfs mounted. In some of the accounts the SSH keys have stopped working.
SSH works fine with all accounts. I just can't get passwordless login to work on *some* accounts.
The SSH keys are the same in all accounts so there's not corruption. md5sum confirms this. I've even copied them from working accounts to faulty ones and it made no difference. I've deleted the .ssh directory and created a new one. No effect.
The permissions of /home/ or /home/user1 are OK. I've changed them from wrxwrxwrx to wrx------ and it makes not difference.
I think there are some problems with permission of ~/.ssh. Compare two dirs, working and not working.
Also you can check secure.log.
The permissions are fine. I can do a chmod 755 -R /home and it makes no impact on any of the accounts. I'll check secure.log. Can't believe I forgot to do that.
Presumably they're using the right keys and the authorized_keys files are properly set up. Also, check your other SSH directives -- are you using AllowGroups or similar? As mentioned above, secure.log and other log files will probably lead to a sudden revelation.
I'll also mention that permissions and ownership are important if the sshd has strict mode enabled (which I think it usually is by default). The home directory needs to be owned by the user, and should be 700. .ssh should also be 700, and finally the authorized_keys file should be 600. If you're still having trouble figuring out the problem, as other posters mentioned, check /var/log/secure. And of course, you can use the "-v" flag (or even "-vv") with your ssh client to get more debugging info about why the connection is failing.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.