I'm having problem when I try to connect to a remote server using ssh with the following command:
ssh -vvv -l user hostname -p XXXX
I get the following result:
OpenSSH_7.9p1 Debian-10+deb10u1, OpenSSL 1.1.1d 10 Sep 2019
debug1: Reading configuration data /home/johannys/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to xxxx.com [xxx.xxx.xxx.xxx] port xxxx.
debug1: Connection established.
debug1: Local version string SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u1
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4
debug1: Authenticating to xxxxx.com:2020 as 'user'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:VYlY/MrjfxzISurmLT3AD2ZaXgSsSPEDhesAPjSGLBY debug1: Host '[xxxxx.com]:xxxx' is known and matches the ECDSA host key.
debug1: Found key in /home/johannys/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks debug1: Will attempt key: /home/johannys/.ssh/id_rsa RSA SHA256:aRPCgKDIJBNXISKuLrJnj17+jdv27OSfaUP3TPaQG2o agent
debug1: Will attempt key: /home/johannys/.ssh/id_dsa
debug1: Will attempt key: /home/johannys/.ssh/id_ecdsa
debug1: Will attempt key: /home/johannys/.ssh/id_ed25519 debug1: Will attempt key: /home/johannys/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure. Minor code may provide more information
No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)
debug1: Unspecified GSS failure. Minor code may provide more information
No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)
debug1: Next authentication method: publickey
debug1: Offering public key: /home/johannys/.ssh/id_rsa RSA SHA256:aRPCgKDIJBNXISKuLrJnj17+jdv27OSfaUP3TPaQG2o agent
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Trying private key: /home/johannys/.ssh/id_dsa
debug1: Trying private key: /home/johannys/.ssh/id_ecdsa
debug1: Trying private key: /home/johannys/.ssh/id_ed25519
debug1: Trying private key: /home/johannys/.ssh/id_xmss
debug1: No more authentication methods to try.
xxxxx.com: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
I have checked the file permissions and they seem to be okay:
drwx------ 2 johannys johannys 4096 out 8 10:47 .ssh drwx------ 2 johannys johannys 4096 out 8 10:47 .
drwxr-xr-x 22 johannys johannys 4096 out 8 11:50 ..
-rw-r--r-- 1 johannys johannys 106 out 8 10:44 config
-rw------- 1 johannys johannys 1876 out 8 10:40 id_rsa
-rw-r--r-- 1 johannys johannys 398 out 8 10:40 id_rsa.pub
-rw-r--r-- 1 johannys johannys 444 out 8 10:47 known_hosts
On the server side, the auth.log reports:
Oct 7 15:50:07 XXX sshd[18309]: Accepted publickey for XXX from XXX.XXX.XXX.XXX port XXXX ssh2: RSA SHA256:0 Oct 7 15:50:07 XXX sshd[18309]: pam_unix(sshd:session): session opened for user XXX by (uid=0) Oct 7 15:51:09 xxx sshd[18566]: reverse mapping checking getaddrinfo for bacefebb.virtua.com.br [XXX.XXX.XXX.XXX] failed - POSSIBLE BREAK-IN ATTEMPT!
What might be wrong ?