When connecting to the server with ssh
I'm prompted for a passphrase, although the creator of the key hasn't set one and the file is a plain text private key.
$ cat ~/.ssh/private.pem
-----BEGIN RSA PRIVATE KEY-----
MIIEowfIBAdfsdf34325...
-----END RSA PRIVATE KEY——
I also tried to reset the passphrase with
$ ssh-keygen -p -f ~/.ssh/private.pem -P ''
Bad passphrase.
$ ssh -vvvv -i ~/.ssh/private.pem HOST
debug2: key: /Users/.../private.pem (0x0), explicit
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /Users/.../private.pem
debug1: key_parse_private_pem: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/Users/.../private.pem':
debug2: no passphrase given, try next key
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
After trying arzyfex's solution ssh-add
returns 1 as exit code, without any explanation.
$ ssh-agent bash
$ ssh-add ~/.ssh/private.pem
$ Enter passphrase for /Users/../private.pem:
1 $
ssh remotehost
?