0

I'm being prompted for a passphrase each time I try to connect with my ssh key.

$ ssh user@server.ip -i .ssh/private_key

I was given these credentials (private key) by the server admin, so I cannot regenerate the key, and there is nothing wrong with the credentials. I copied/pasted the key exactly (there is no botching of dashes with hyphens due to a mail client, etc). I verified there are no spaces / line break issues with vim, an the same issue happens. Permissions are set correctly (to 0600).

What did I do wrong?

2

Turns out I copied the data from the SSH key itself, but not the header/footer, and that was the entire issue. Note to self: make sure to copy everything from the start of the line BEGIN RSA PRIVATE KEY to the end of the line END RSA PRIVATE KEY including all dashes.

In other words, the private key is not...

4OoXTO0cqjtyd7rPWaKeKHgmF5Zu9h7AdZCIJuUTpbBhzER7nW1tMZVPAHMed3r
...
Z9BX7lae9FN/dv5TSAFdSG1Ow011ZvENw25l4mKMPREcHRvDMedeL6oQSBL2m9c

... but rather ...

-----BEGIN RSA PRIVATE KEY-----
4OoXTO0cqjtyd7rPWaKeKHgmF5Zu9h7AdZCIJuUTpbBhzER7nW1tMZVPAHMed3r
...
Z9BX7lae9FN/dv5TSAFdSG1Ow011ZvENw25l4mKMPREcHRvDMedeL6oQSBL2m9c
-----END RSA PRIVATE KEY-----

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .