I could connect from host1 to host2 through ssh using a password, this is working properly.
But I want to connect from host1 to host2 through ssh, using the publickey authentication method.
Regarding the information below:
The content of the files id_rsa.pub (host1) and authorized_keys (host2) is the same.
Security currently ignored for settings in sshd_config - I just want to get it working.
sshd was restarted of course.
SELinux is disabled.
Nothing on filesystem was encrypted, still I run the 'restorecon'-command for /home/xxx
Host1
Version: Centos 7.7.1908
Code: Select all
[xxx@yyy .ssh]$ ls -la /home/xxx/.ssh/
drwx------ 2 xxx xxx .
drwx------. 23 xxx xxx ..
-rw------- 1 xxx xxx id_rsa
-rw-r--r-- 1 xxx xxx id_rsa.pub
-rw-r--r-- 1 xxx xxx known_hosts
Code: Select all
[xxx@yyy .ssh]$ lsattr -l
./known_hosts Extents
./id_rsa Extents
./id_rsa.pub Extents
Version: Centos 7.6.1810
Code: Select all
[xxx@zzz .ssh]# ls -la /home/xxx/.ssh/
drwx------ 2 xxx xxx .
drwx------. 10 xxx xxx ..
-rw------- 1 xxx xxx authorized_keys
Code: Select all
[root@zzz .ssh]# lsattr -l
./authorized_keys Extents
Code: Select all
[root@zzz .ssh]# cat /etc/ssh/sshd_config
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
SyslogFacility AUTHPRIV
PermitRootLogin no
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
PasswordAuthentication yes
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS
Subsystem sftp /usr/libexec/openssh/sftp-server
Code: Select all
[xxx@yyy .ssh]$ ssh -v xxx@zzz.***.local -o PreferredAuthentications=publickey
...
debug1: Authentications that can continue: password
debug1: No more authentication methods to try.
Permission denied (password).
What could cause that issue?
I have set up another server (Centos 7.6.1810) just for testing, did the same configs as on host2 and I was able to connect through ssh with publickey auth within a few minutes....