Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • Thanks! I found it hard to believe ssh would do that myself. Now that would mean the Permission denied (publickey). error is not caused by ssh sending the wrong key but one of the usual causes.
    – crunsher
    Commented Jan 23, 2015 at 9:39
  • Yeah, it could be permissions or one of the usual suspects :)
    – slhck
    Commented Jan 23, 2015 at 9:46
  • 4
    To nitpick, ssh doesn't actually read the .pub file. It just reads the private key file. The public key can be extracted from the private key. ssh-keygen has an option to read a private key and output its public key.
    – Kenster
    Commented Jan 24, 2015 at 22:45
  • 3
    @Kenster: No, it does read the .pub file as well – so that it could query the server about the public part, before having to ask you for the decryption passphrase. (OpenSSH needs this as the entire file is encrypted. PuTTY's key format, otoh, doesn't encrypt the public half so a separate .pub file is not needed.) Commented May 30, 2018 at 15:19