# cannot login with public key

**URL:** <https://forums.percona.com/t/cannot-login-with-public-key/5559>\
**Category:** PMM 1.x\
**Created:** [April 19, 2017, 12:06pm UTC](https://forums.percona.com/t/cannot-login-with-public-key/5559 "2017-04-19T12:06:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Moreno](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@Moreno](https://forums.percona.com/u/Moreno)\
**Post date:** [April 19, 2017, 12:06pm UTC](https://forums.percona.com/t/cannot-login-with-public-key/5559/1 "2017-04-19T12:06:09Z")

</div>

Hello  
I have installed pmm-server and I can log data from my clients, but I cannot login to the pmm server.

I created the public key and set it through the web interface during setup, but when I try to log in, I get this message:

sign\_and\_send\_pubkey: signing failed: agent refused operation  
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

The key is the following  
2048 SHA256:EyfiOgKJidxr/pOiFtSjlzpaVkjsOQfpKX0n762SgLg /home/mox/.ssh/id\_rsa.pub (RSA)

I tried different way to log in, I found in the forum several suggestions, like using different login names (admin, pmm), but I couldn’t manage to connect.

Thanks

Moreno

p.s.  
Below the debug log from ssh

debug1: Reading configuration data /etc/ssh/ssh\_config  
debug1: /etc/ssh/ssh\_config line 19: Applying options for \*  
debug1: Connecting to 192.168.178.59 [192.168.178.59] port 22.  
debug1: Connection established.  
debug1: identity file id\_rsa.pub type 1  
debug1: key\_load\_public: No such file or directory  
debug1: identity file id\_rsa.pub-cert type -1  
debug1: Enabling compatibility mode for protocol 2.0  
debug1: Local version string SSH-2.0-OpenSSH\_7.2p2 Ubuntu-4ubuntu2.1  
debug1: Remote protocol version 2.0, remote software version OpenSSH\_6.6.1  
debug1: match: OpenSSH\_6.6.1 pat OpenSSH\_6.6.1\* compat 0x04000000  
debug1: Authenticating to 192.168.178.59:22 as ‘mox’  
debug1: SSH2\_MSG\_KEXINIT sent  
debug1: SSH2\_MSG\_KEXINIT received  
debug1: kex: algorithm: [curve25519-sha256&#64;libssh.org](mailto:curve25519-sha256&#64;libssh.org)  
debug1: kex: host key algorithm: ecdsa-sha2-nistp256  
debug1: kex: server-\>client cipher: [chacha20-poly1305&#64;openssh.com](mailto:chacha20-poly1305&#64;openssh.com) MAC: compression: none  
debug1: kex: client-\>server cipher: [chacha20-poly1305&#64;openssh.com](mailto:chacha20-poly1305&#64;openssh.com) MAC: compression: none  
debug1: expecting SSH2\_MSG\_KEX\_ECDH\_REPLY  
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:tBmNep22sfXseHo1INDzjF7vy6KsR3vUhNBbLUSBIgM  
debug1: Host ‘192.168.178.59’ is known and matches the ECDSA host key.  
debug1: Found key in /home/mox/.ssh/known\_hosts:36  
debug1: rekey after 134217728 blocks  
debug1: SSH2\_MSG\_NEWKEYS sent  
debug1: expecting SSH2\_MSG\_NEWKEYS  
debug1: rekey after 134217728 blocks  
debug1: SSH2\_MSG\_NEWKEYS received  
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

debug1: Unspecified GSS failure. Minor code may provide more information  
No Kerberos credentials available

debug1: Unspecified GSS failure. Minor code may provide more information

debug1: Unspecified GSS failure. Minor code may provide more information  
No Kerberos credentials available

debug1: Next authentication method: publickey  
debug1: Offering RSA public key: id\_rsa.pub  
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic  
debug1: Offering RSA public key: /home/mox/.ssh/id\_rsa  
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic  
debug1: No more authentication methods to try.  
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

---

<div class="post-metadata">

**Author:** ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)\
**Post date:** [April 19, 2017, 12:18pm UTC](https://forums.percona.com/t/cannot-login-with-public-key/5559/2 "2017-04-19T12:18:28Z")

</div>

Hi [Moreno](https://percona.vanillacommunities.com/profile/x/x/35848)

Can you please paste the full command line you used? This example is showing you using user ‘mox’

> [@](#):
>
> debug1: Authenticating to 192.168.178.59:22 as ‘mox’

---

<div class="post-metadata">

**Author:** ![Mykola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mykola/32/30_2.png) [@Mykola](https://forums.percona.com/u/Mykola)\
**Post date:** [April 19, 2017, 12:49pm UTC](https://forums.percona.com/t/cannot-login-with-public-key/5559/3 "2017-04-19T12:49:49Z")

</div>

also please share output of these commands, it is ssh key digest (identifier)

```auto
ssh-keygen -y -f /home/mox/.ssh/id_rsa | ssh-keygen -lf -
curl http://USER:PASS&#64;192.168.178.59/configurator/v1/sshkey

```

(please replace USER:PASS by right http credentials)

---

<div class="post-metadata">

**Author:** ![Moreno](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@Moreno](https://forums.percona.com/u/Moreno)\
**Post date:** [April 20, 2017, 9:17am UTC](https://forums.percona.com/t/cannot-login-with-public-key/5559/4 "2017-04-20T09:17:50Z")

</div>

Hello  
thanks for the reply

Here the data that you requested (yes Michael you are right, I generated the keys for a normal user as mox)  
ssh -i .ssh/id\_rsa.pub mox@192.168.178.59

[Mykola](https://percona.vanillacommunities.com/profile/x/x/30783) the output is the following

$ssh-keygen -y -f /home/mox/.ssh/id\_rsa | ssh-keygen -lf -  
2048 SHA256:EyfiOgKJidxr/pOiFtSjlzpaVkjsOQfpKX0n762SgLg no comment (RSA)

$curl [http://mox](http://mox):zxcvbnm@192.168.178.59/configurator/v1/sshkey  
{“type”:“ssh-rsa”,“fingerprint”:“SHA256:EyfiOgKJidxr/pOiFtSjlzpaVkjsOQfpKX0n762SgLg”}

regards

Moreno

---

<div class="post-metadata">

**Author:** ![Mykola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mykola/32/30_2.png) [@Mykola](https://forums.percona.com/u/Mykola)\
**Post date:** [April 20, 2017, 9:40am UTC](https://forums.percona.com/t/cannot-login-with-public-key/5559/5 "2017-04-20T09:40:26Z")

</div>

please ssh to ‘admin’ user.

ssh -i .ssh/id\_rsa.pub admin@192.168.178.59

this information should be added to documentation in [url][Log in - Percona JIRA](https://jira.percona.com/browse/PMM-650%5B/url%5D)

---

<div class="post-metadata">

**Author:** ![Moreno](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@Moreno](https://forums.percona.com/u/Moreno)\
**Post date:** [April 21, 2017, 7:02am UTC](https://forums.percona.com/t/cannot-login-with-public-key/5559/6 "2017-04-21T07:02:37Z")

</div>

Hello  
I tried but still no luck  
$ssh -i .ssh/id\_rsa.pub admin@192.168.178.59  
sign\_and\_send\_pubkey: signing failed: agent refused operation  
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

---

<div class="post-metadata">

**Author:** ![Mykola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mykola/32/30_2.png) [@Mykola](https://forums.percona.com/u/Mykola)\
**Post date:** [April 21, 2017, 8:45am UTC](https://forums.percona.com/t/cannot-login-with-public-key/5559/7 "2017-04-21T08:45:44Z")

</div>

oh, sorry, please use private key for connecting id\_rsa (not id\_rsa.pub)

```auto
ssh -i .ssh/id_rsa admin&#64;192.168.178.59

```

---

<div class="post-metadata">

**Author:** ![Moreno](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@Moreno](https://forums.percona.com/u/Moreno)\
**Post date:** [April 22, 2017, 7:45am UTC](https://forums.percona.com/t/cannot-login-with-public-key/5559/8 "2017-04-22T07:45:42Z")

</div>

Hi Mykola  
thanks for the update, using the private key I could login and everything is fine now 🙂
