Public Key Authentication getting errors

As per instruction I have ran server2 using “sshd -d -p”

[tux@server2 ~]$ sudo /usr/sbin/sshd -d -p 34627
debug1: sshd version OpenSSH_7.4, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: private host key #0: ssh-rsa SHA256:ssb4fn3UAtflCtBLI3N5H5hSXI+Z7KQ6CPguMlAzoNA
debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:oV4f6EICfpOJ4YYf7KIWxq8Ga3yPj/6VSBX0yFXG3Uk
debug1: private host key #2: ssh-ed25519 SHA256:1OR73+mSppNAjAoEVLC6vhFl40/e7Py23TdT/MFHXpI
debug1: rexec_argv[0]=‘/usr/sbin/sshd’
debug1: rexec_argv[1]=‘-d’
debug1: rexec_argv[2]=‘-p’
debug1: rexec_argv[3]=‘34627’
debug1: Set /proc/self/oom_score_adj from 0 to -1000
debug1: Bind to port 34627 on 0.0.0.0.
Server listening on 0.0.0.0 port 34627.
debug1: Bind to port 34627 on ::.
Server listening on :: port 34627.

When I try to connect via ssh coming from server1, I got this output:

debug1: userauth-request for user tux service ssh-connection method publickey [preauth]
debug1: attempt 1 failures 0 [preauth]
debug1: userauth_pubkey: test whether pkalg/pkblob are acceptable for RSA SHA256:Ji1d4762rLaxsP8JZ070JQYjVtBAkcQ8r5Kr/mbcy9g [preauth]
debug1: temporarily_use_uid: 1000/1000 (e=0/0)
debug1: trying public key file /root/.ssh/authorized_keys
debug1: Could not open authorized keys ‘/root/.ssh/authorized_keys’: Permission denied
debug1: restore_uid: 0/0
Failed publickey for tux from 192.168.10.243 port 57974 ssh2: RSA SHA256:Ji1d4762rLaxsP8JZ070JQYjVtBAkcQ8r5Kr/mbcy9g

What I did is delete the .ssh directory under root’s home directory and then went to /etc/ssh/sshd_config and edit the entry under “authorizedkeysfile” back to “.ssh/authorized_kerys” This addressed my issue.

Thank you so much for the help.

1 Like