cannot login with public key

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@libssh.org
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: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).

Hi Moreno

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

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

ssh-keygen -y -f /home/mox/.ssh/id_rsa | ssh-keygen -lf -
curl http://USER:PASS@192.168.178.59/configurator/v1/sshkey

(please replace USER:PASS by right http credentials)

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 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:zxcvbnm@192.168.178.59/configurator/v1/sshkey
{“type”:“ssh-rsa”,“fingerprint”:“SHA256:EyfiOgKJidxr/pOiFtSjlzpaVkjsOQfpKX0n762SgLg”}

regards

Moreno

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

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).

oh, sorry, please use private key for connecting id_rsa (not id_rsa.pub)

ssh -i .ssh/id_rsa admin@192.168.178.59

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