PEM_read_PrivateKey failed SSH error

I just spent 20 minutes trying to figure out why my passwordless SSH wasn’t working. I’ve done it dozens of times, but this time it wasn’t working and none of the Google results had a solution that helped.

It turns out I was pointing to the public key instead of the private key.

Short summary: Don’t point to the .pub keyfile with IdentityFile in .ssh/config.

A lot of the solutions I found were related to invalid keyfiles, but I’d generated the key with ssh-keygen on that machine, so I was fairly confident the keys were valid.

If you’re having the same problem, use

ssh -vvv

to get more debugging info.

If this saves someone else 20 minutes, my wasted time will not have been in vain.







Number of readers
- home
comics
news links
other links

about me
blog archives
docs
entertainment
experiences
funny lists
humor
intellectual
interests
metafilter
music
opinions
photos
web designs
tools
software
webmaster help

Sign up
Enter your email address to be notified of new blog posts



Search blog archives

Calendar
January 2010
S M T W T F S
« Dec   Feb »
 12
3456789
10111213141516
17181920212223
24252627282930
31  







Random quote
(View all quotes)
"The two most common things in the universe are hydrogen and stupidity."










(?) Choose theme:  X X X X X X