I created a key pair with Puttygen, I putted its public key under /home/tiesto/.ssh/authorized_keys, I loaded its private key with Pageant, and logged in successfully with Putty via port 22. The private key has a passphrase.

/home/tiesto/.ssh/ is tiesto-tiesto-755.

/home/tiesto/.ssh/authorized_keys is tiesto-tiesto-600.

The problem:

When I try to use the very same key pair from within the Putty session (to start a tunnel on port 80 as well) I am being asked for the passphrase; I can fill the exact correct passphrase 3 times and in the third time I'm being told:

Permission denied: Public key.

The command I use to login seems basically like this:

sudo ssh tiesto@ -L 80:localhost:80 -i /home/tiesto/.ssh/tiesto_pri @ arbpid=$!

(The arbpid=$! is a variable I added to mark the specific process, please just ignore it).

What's wired:

  1. The same public key I use to start the Putty session is also under /home/tiesto/.ssh/authorized_keys.

  2. The same private key I use to start the Putty session is under /home/tiesto/.ssh/tiesto_pri.

I double checked everything and don't know why it doesn't work.

You might have an idea what went wrong and why the very same key pair that works just fine for Putty, won't work inside the Putty session with OpenSSH for tunneling port80.

closed as off-topic by schroeder Dec 25 '16 at 15:56

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about Information security within the scope defined in the help center." – schroeder
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    unfortunately, configuring and troubleshooting software is off-topic here - but I will say that the Puttygen keys are not compatible: stackoverflow.com/questions/2224066/… – schroeder Dec 25 '16 at 8:18
  • Can I close this then? It's off-topic and your answer is in the link I provided. – schroeder Dec 25 '16 at 8:25
  • Okay. Thank you for noting this as a possible cause; I do believe everything is fine besides that key incompatibility issue. – JohnDoea Dec 25 '16 at 8:28

Putty uses its own privatekey format, called PPK, which is incompatible with OpenSSH. You can use puttygen to convert PPK to OpenSSH format (which is also OpenSSL 'legacy' format); see https://unix.stackexchange.com/questions/74545/what-difference-between-openssh-key-and-putty-key .

ssh unfortunately assumes any error reading a keyfile must mean the password is wrong, so it repeatedly prompts for the password when it can't parse the file at all.

  • I gave you a thumb up. I thank you for your answer; Sadly even after I exported the ppk file to OpenSSH, and replaced it in Linux via sudo nano /.ssh tiesto_pri, and saved, I still have the exact same problem when trying to log in. I am still asked 3 times for the passphrase, and then get "permission denied (publick key). – JohnDoea Dec 26 '16 at 16:31
  • @Benia: did sudo make the file owner root? I think OpenSSH doesn't like that, but haven't tested. Next, use openssl pkey <.ssh/tiesto_pri to see if there's any detectable flaw in the file encryption and/or contents. If not, try ssh with -vv or maybe -vvv to see if anything in its log/debug info is helpful; if you need help with that I'm pretty sure you can edit your Q even with the hold. – dave_thompson_085 Dec 27 '16 at 7:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.