1

I'm unable to connect (ssh) to one of my servers with pubkey. It was working last week, and I have no idea where to search right now.

I have a script which should fetch files with scp to use them locally, that fails with an error:

identity_sign: private key /home/yprox/.ssh/ansiblekey contents do not match public

So, I have checked that local pubkey match my private key with:

diff <(ssh-keygen -e -y -f ansiblekey) <(ssh-keygen -e -y -f ansiblekey.pub)

Generated pubkey match the existing one.

I have checked the file access right :

-rw------- 1 yprox yprox 1,7K févr. 17 16:21 ansiblekey
-rw-r--r-- 1 yprox yprox  381 oct.  17  2014 ansiblekey.pub
-rw------- 1 yprox yprox 1,1K oct.  22 17:07 authorized_keys
-rw-r--r-- 1 yprox yprox  190 avril 24  2018 config
-rw-r--r-- 1 yprox yprox 1,6K févr. 17 16:36 known_hosts

It seems good to me.

I've also checked that my pubkey is present in authorized_keys on the remote host.

I have a fail2ban setup on remote host, and nothing in jail that matches my local machine (I have checked in ssh and sshd jail).

With the same key, I'm able to connect to the remote from another host.

I have no more ideas on where to search, what might be the reason for this break?

EDIT: Here's the debug log I'm getting while trying to connect:

OpenSSH_7.9p1 Debian-10+deb10u2, OpenSSL 1.1.1d  10 Sep 2019
debug1: Reading configuration data /home/yprox/.ssh/config
debug1: /home/yprox/.ssh/config line 7: Applying options for <**** host rule ****>
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "<**** host *****>" port 22
debug2: ssh_connect_direct
debug1: Connecting to <**** host *****> [<**** ip *****>] port 22.
debug1: Connection established.
debug1: identity file /home/yprox/.ssh/ansiblekey type 0
debug1: identity file /home/yprox/.ssh/ansiblekey-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.9p1 Debian-10+deb10u2
debug1: match: OpenSSH_7.9p1 Debian-10+deb10u2 pat OpenSSH* compat 0x04000000
debug2: fd 4 setting O_NONBLOCK
debug1: Authenticating to <**** host *****>:22 as 'yprox'
debug3: hostkeys_foreach: reading file "/home/yprox/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/yprox/.ssh/known_hosts:3
debug3: load_hostkeys: loaded 1 keys from <**** host *****>
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:pEExIOBHhUC2p9ydEia4yCr+WwE3bMig019SnOroKQG
debug3: hostkeys_foreach: reading file "/home/yprox/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/yprox/.ssh/known_hosts:3
debug3: load_hostkeys: loaded 1 keys from <**** host *****>
debug3: hostkeys_foreach: reading file "/home/yprox/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/yprox/.ssh/known_hosts:4
debug3: load_hostkeys: loaded 1 keys from <**** ip *****>
debug1: Host '<**** host *****>' is known and matches the ECDSA host key.
debug1: Found key in /home/yprox/.ssh/known_hosts:3
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug1: Will attempt key: /home/yprox/.ssh/ansiblekey RSA SHA256:rTLOngYPB/5uMLYARR03XoU1eHUoaY3WaYE/8n23SeG explicit
debug2: pubkey_prepare: done
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/yprox/.ssh/ansiblekey RSA SHA256:rTLOngYPB/5uMLYARR03XoU1eHUoaY3WaYE/8n23SeG explicit
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password

0 Answers0