I am trying to ssh from an Ubuntu machine ( VM on Win 10) to a linux server using public keys (DSA). However the OpenSSH client on the Ubuntu does not try public keys as authentication method even though I have added below lines to /etc/ssh/ssh_config:
PubkeyAuthentication yes
PubkeyAcceptedKeyTypes +ssh-dss.
The permissions of .ssh directory is set to 700 and the id_dsa file is set to 600.
Here is the debug log:
The authenticity of host '************' can't be established.
RSA key fingerprint is SHA256:cPAuJmw7PjOgBYDN2TYfFscDVTbcsj0rT6HFJH9SDFI.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '*****************' (RSA) to the list of known hosts.
debug2: bits set: 4095/8192
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey out after 4294967296 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 in after 4294967296 blocks
debug1: Will attempt key: .ssh/id_dsa explicit
debug2: pubkey_prepare: done
debug3: send packet: type 5
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: gssapi-keyex,gssapi-with-mic
debug3: start over, passed a different list gssapi-keyex,gssapi-with-mic
debug3: preferred gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup gssapi-with-mic
debug3: remaining preferred: publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi-with-mic
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)
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
*****************: Permission denied (gssapi-keyex,gssapi-with-mic).
Could someone explain why publickey is not among the authentication methods here:
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic
Thanks in advance,
Update:
I started sshd on a different port (2222) on the server and then I was able to connect. So the issue is with port 22, for some reason the server is not allowing publickey authentication. I see this in the logs, when using port 22:
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic
Here the server is not allowing publickey authentication for my user-id on port 22, however server allows publickey authentication on port 2222 :
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
What could be the reason that the server does not allow publickey authentication for my user id on port 22 ?
ssh-dss
both on the client (inssh_config
and maybe~/.ssh/config
) and on the server (insshd_config
)?/etc/ssh/ssh_config
on the Ubuntu client that works and the Ubuntu client that does not? It might make some things clear to you./usr/sbin/sshd -d -p 2222
then ssh from the troubled Ubuntu client withssh -p 2222 user@server
. Watch the logging on the server. Also, I would do a pass on permissions of the home directory of the user all the way down to the key, compare it to the server that works.