625579637
By:
625579637

ssh failed Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

July 1, 2016 49.1k views
DigitalOcean

ssh -v root@xx.xx.xx.xxx
OpenSSH6.9p1, LibreSSL 2.1.7
debug1: Reading configuration data /Users/frank
szn/.ssh/config
debug1: Reading configuration data /etc/ssh/sshconfig
debug1: /etc/ssh/ssh
config line 21: Applying options for *
debug1: /etc/ssh/sshconfig line 56: Applying options for *
debug1: Connecting to 45.55.20.113 [45.55.20.113] port 22.
debug1: Connection established.
debug1: identity file /Users/frank
szn/.ssh/idrsa type 1
debug1: key
loadpublic: No such file or directory
debug1: identity file /Users/frank
szn/.ssh/idrsa-cert type -1
debug1: key
loadpublic: No such file or directory
debug1: identity file /Users/frank
szn/.ssh/iddsa type -1
debug1: key
loadpublic: No such file or directory
debug1: identity file /Users/frank
szn/.ssh/iddsa-cert type -1
debug1: key
loadpublic: No such file or directory
debug1: identity file /Users/frank
szn/.ssh/idecdsa type -1
debug1: key
loadpublic: No such file or directory
debug1: identity file /Users/frank
szn/.ssh/idecdsa-cert type -1
debug1: key
loadpublic: No such file or directory
debug1: identity file /Users/frank
szn/.ssh/ided25519 type -1
debug1: key
loadpublic: No such file or directory
debug1: identity file /Users/frank
szn/.ssh/ided25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH
6.9
debug1: Remote protocol version 2.0, remote software version OpenSSH5.3
debug1: match: OpenSSH
5.3 pat OpenSSH5* compat 0x0c000000
debug1: Authenticating to 45.55.20.113:22 as 'root'
debug1: SSH2
MSGKEXINIT sent
debug1: SSH2
MSGKEXINIT received
debug1: kex: server->client aes128-ctr umac-64@openssh.com none
debug1: kex: client->server aes128-ctr umac-64@openssh.com none
debug1: SSH2
MSGKEXDHGEXREQUEST(1024<3072<8192) sent
debug1: got SSH2MSGKEXDHGEXGROUP
debug1: SSH2
MSGKEXDHGEXINIT sent
debug1: got SSH2MSGKEXDHGEXREPLY
debug1: Server host key: ssh-rsa SHA256:xiB0VWociJ19y8/fqsxGcn0OJJeMe8J5TUhii5y05Ms
debug1: Host '45.55.20.113' is known and matches the RSA host key.
debug1: Found key in /Users/frank
szn/.ssh/knownhosts:3
debug1: SSH2
MSGNEWKEYS sent
debug1: expecting SSH2
MSGNEWKEYS
debug1: SSH2
MSGNEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2
MSGSERVICEREQUEST sent
debug1: SSH2MSGSERVICEACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/frank
szn/.ssh/idrsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Trying private key: /Users/frank
szn/.ssh/iddsa
debug1: Trying private key: /Users/frank
szn/.ssh/idecdsa
debug1: Trying private key: /Users/frank
szn/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

1 comment
  • It's unclear what you're trying to do, as you haven't asked a question. What have you set up, and what are you trying to accomplish. If we know more about what you're working on, and what you've created, we can help you further. Thanks!

7 Answers

You may try edit in /etc/ssh/sshd_config
PasswordAuthentication yes

service sshd restart

Hi @ryanpq @nikfarid , I'm having the same issue.

I checked in Digital Ocean Console .ssh/authorized_keys and I have my key there. I did password authentication to Yes, even tried with no. (as someone suggested).

But still no luck, getting the same "Permission Denied (public Key)" issue.

Can you please help me on this.

Thanks,
Dilip Gupta

Hi,
I am trying get SSH access from my Ubuntu 14.04 to Cent OS 7 droplet at digitalocean. But it's throwing error, "Permission denied (publickey,gssapi-keyex,gssapi-with-mic)."

Again, I am trying to access form filezila SFTP and it's throwing error:
"Disconnected: No supported authentication methods available (server sent: publickey,gssapi-keyex,gssapi-with-mic)"

I have generated SSH key form my Ubuntu Terminal by command: "ssh-keygen -t rsa" and uploaded / past the public key "id_rsa.pub" to my digitalocean droplet SSH key option.

While I first tried to access SHH connection it asked,
"The authenticity of host '1XXXXXXXX' can't be established.
ECDSA key fingerprint is XXXXXXXXXXXXXXXXXXXXXXXX.
Are you sure you want to continue connecting (yes/no)?
"
After I type Yes,
it's through the error, "Permission denied (publickey,gssapi-keyex,gssapi-with-mic)" .

Please advise how to fix it.

Without further information it is difficult to help you troubleshoot this. According to these logs, the keys on your local computer did not match the public keys on your droplet.

Have you been able to connect to this droplet via ssh before?

Have you used this key on your account with another droplet?

If you continue to have trouble and have not set up a password for your root user you can open a ticket with our support team who can assist you in setting a password to allow you to access the droplet from the console in the control panel in order to investigate or assist you in rebooting your droplet to a recovery environment where you can check that your public key was properly added to your /root/.ssh/authorized_keys file.

@Dilip7597 I have the same issue
I get Permission denied (publickey,gssapi-keyex,gssapi-with-mic). when trying to ssh through Terminal app.

I just got back from an extended winter holiday, but before the holiday (4-5 weeks ago) I used to ssh connect to my droplet without a problem. I have not changed the ssh keys since then, so it can't be a problem with that.

Be sure that the public key on /pathToUser/.ssh/idrsa.pub in the droplet is the same file than /pathToUser/.ssh/idrsa.pub in your local machine.

I found in messages log information about bad ownership of authorized_keys. So I changed permissions for my /home/USERNAME/.ssh/authorized_keys to 0600 and everything works.

Have another answer? Share your knowledge.