Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PuTTY - Unable to use key file (not a private key)

I have a PPK file and I am trying to have PuTTY use it, when I am connecting to a remote server. But I keep getting this error below, and then I am just asked for my username (while I should be directly allowed in as root).

I don't understand what the problem is, and what's worse I have no idea how to troubleshoot further. A colleague of mine is using the same file and says everything is OK on his side. So I am stuck.

I did a web search and all I find is recommendations to convert the PEM file into a PPK file. But that does not apply in my case, I already have a PPK file.

I am using Windows on my local machine and the PPK file is located in C:\ssh-keys\

Unable to use key file "C:\ssh-keys\filename.ppk" (not a private key)
login as:

Here is the header:

filename.ppk
ё  :           mBIN                ‚Ѓ&  PuTTY-User-Key-File-2: ssh-rsa
Encryption: none
Comment: imported-openssh-key
Public-Lines: 6
like image 952
peter.petrov Avatar asked Feb 29 '16 14:02

peter.petrov


1 Answers

Your key file is corrupted.

A .ppk file must start with the PuTTY-User-Key-File- followed by the ppk format version number. It must be a plain text file. No binary data. No UTF BOM. Your colleague must have a different (correct) copy of the file.

like image 153
Martin Prikryl Avatar answered Oct 19 '22 09:10

Martin Prikryl