Article 6QRXP Unable to ssh from CentOS 7 to AlmaLinux 8 based on publickey

Unable to ssh from CentOS 7 to AlmaLinux 8 based on publickey

by
jonaskellens
from LinuxQuestions.org on (#6QRXP)
Hello

I have a setup that works from machine CentOS 7 (CentOS Linux release 7.9.2009 (Core)) to another CentOS 7.
When I try this same setup to AlmaLinux machine (AlmaLinux release 8.10 (Cerulean Leopard)), it fails.

I have generated key on CentOS 7 :Code:ssh-keygen -t rsa -b 4096I have added public key on AlmaLinux in Code:~/.ssh/authorized_keysWhen I ssh from CentOS 7 to CentOS 7 I see :
Code:debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /root/.ssh/id_rsa
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 535
debug2: input_userauth_pk_ok: fp SHA256:9UtRIQqXs+UK+iTtkkfD/Fk0I3ZiCQFFE8xPwEteKQM
debug1: Authentication succeeded (publickey).When I ssh from CentOS 7 to AlmaLinux 8 I see :
Code:debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /root/.ssh/id_rsa
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Trying private key: /root/.ssh/id_ed25519
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).I have tried the following settings in sshd_config on AlmaLinux 8 :
Code:PublickeyAcceptedKeysTypes +ssh-rsa
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsaBut sshd gives error on start : "Bad configuration option"

I have also read about :
Code:update-crypto-policies --set DEFAULT:SHA1But this gives error : Code:Unknown policy `SHA1`: file `SHA1.pmod` not found in (., policies/modules, /etc/crypto-policies/policies/modules, /usr/share/crypto-policies/policies/modules)Can you help me on configuring sshd_config for pubkey authentication to work from CentOS 7 ?
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments