Fail to login ssh without password when using SSH Key-Based Authentication.
This document (000020760) is provided subject to the disclaimer at the end of this document.
Environment
SUSE Linux Enterprise Server 15 all Service Packs
Situation
As a demonstration, below, a "test" user on localhost creates a keypair and then copies it to remotehost. However, the subsequent ssh attempt still prompts for a password.
test@localhost:~> ssh-keygen -t rsa test@localhost:~> ssh-copy-id test@remotehost # Type the remotehost's test user password test@localhost:~> ssh test@remotehost Password:Additionally, if the test user on the remote host attempts to configure SSH Key-Based Authentication, it fails with an error.
test@remotehost:~> ssh-copy-id test@localhost /usr/bin/ssh-copy-id: ERROR: No identities foundA listing of the test user's home directory on the remote host shows:
test@remotehost:~> ls -al /home/test total 4 drwxrwxrwx 1 root root 34 Sep 7 22:24 . <<--!! Note owner and permissions here !! drwxr-xr-x 1 root root 14 Sep 7 22:18 .. -rw------- 1 test users 95 Sep 7 22:24 .bash_history drwx------ 1 test users 54 Sep 7 22:31 .ssh
Resolution
test@remotehost:~> sudo chown test.users /home/test test@remotehost:~> sudo chmod 755 /home/test test@remotehost:~> ls -al /home/test total 4 drwxr-xr-x 1 test users 34 Oct 19 20:32 . <<--!! New settings in effect !! drwxr-xr-x 1 root root 14 Sep 7 22:18 .. -rw------- 1 test users 95 Sep 7 22:24 .bash_history drwx------ 1 test users 54 Sep 7 22:31 .ssh
Cause
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000020760
- Creation Date: 13-Sep-2022
- Modified Date:19-Oct-2022
-
- SUSE Linux Enterprise Server
- SUSE Linux Enterprise Server for SAP Applications
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com