Is it correct to think that SSH key-based authentication works in one direction only? I mean user can authenticate only from machine which stores the private key to the machine which holds the public key in authorized_keys file. In addition, only the public key can be used in authorized_keys file.

  • authorized_keys is just for user keys, but there is also a host key, which needs to match the client's known_hosts. So it is two-way authenitcation.
    – paj28
    Nov 21, 2016 at 12:05

1 Answer 1


Yes. You can't authenticate using public key. By definition.

From mathematical point of view, you can derive public key from the private one, so doing this the other way round would not give any security or anything what you can expect from "authentication".

You must log in to answer this question.

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