I've noticed problems I've been having pushing code to a friend's gitlab. If the rsa key specified for use by ssh is encrypted with a password, ssh fails to ask me to provide the password and subsequently fails to authenticate with the private key.

I've tried generating rsa keys by default with a password and and with the options

ssh-keygen -t rsa -b 4096 -o -a 100

as well, with no change.

I've tried hosting sshd on my own system, setting up the key for my own user (copied the .pub to authorized_keys), same results strangely. Permissions for the key doesn't appear to be an issue.

I'm running ArchLinux 64 bit with an unmodified linux kernel.

Here's the log of a sample ssh -i test -p 9988 -vt on my own system with sshd running with mostly default settings (disabled passwords, only publickey authentication allowed, port is set to 9988). The key is generated with default settings and an encryption password is set on it.

OpenSSH_6.8p1, OpenSSL 1.0.2c 12 Jun 2015
debug1: Reading configuration data /home/stephen/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to [] port 9988.
debug1: Connection established.
debug1: identity file test type 1
debug1: key_load_public: No such file or directory
debug1: identity file test-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.8
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.8
debug1: match: OpenSSH_6.8 pat OpenSSH* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr umac-64-etm@openssh.com none
debug1: kex: client->server aes128-ctr umac-64-etm@openssh.com none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:jNykvy5o5p79HUka+BWOqLoMqB0oo90fupUT18ERxMA
debug1: Host '[]:9988' is known and matches the ECDSA host key.
debug1: Found key in /home/stephen/.ssh/known_hosts:2
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: test
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Offering RSA public key: stephen@ArchDynamo
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

EDIT: I recently pushed to my friend's gitlab and realized it did so without prompting me for the password of the key. Does this mean my ssh-keygen is broken somehow?

  • Sorry that was a typo, I did use ssh-keygen – Stephen S. Jun 27 '15 at 19:28
  • Have you tried it without -o -a 100? Is it asking for a passphrase after generating the keys? – ott-- Jun 27 '15 at 19:36
  • I've tried both with the -o -a 100 and with default settings, and in both cases, I failed to authenticate to sshd running on the same system. – Stephen S. Jun 27 '15 at 19:37
  • What is other key stephen@ArchDynamo? Can you try ssh-add to make the agent handle the auth? – ott-- Jun 27 '15 at 19:46
  • I'm not sure what stephen@ArchDynamo means other than it's my user at my system. There isn't a key with that name. I'll look at ssh-add in the meantime. – Stephen S. Jun 27 '15 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.