3

I have a client providing me with his own id_rsa.pub key, he wants me to setup a SSH server so that he can send me files. As far as I understand, when I setup my SSH Server (freesshd on Windows) I need a private key that will be the fingerprint of my server. Then using the private key provided or generating a new private key, I can generate a public key that I will tie to a user account, allowing my client to use that public key to login without a user/pass combo.

I don't think a server can be configured to use a public key that was not generated from the private key associated with that server.

Am I correct or is there a way to use an existing public key to setup a SSH server if that key was not generated from the private key of said server? Thanks to all!

1
  • Search for freesshd import public key.
    – ott--
    Jun 21, 2013 at 12:55

1 Answer 1

5

Your client has both his private key (typically called id_rsa) and public key (typically called id_rsa.pub).

If he sends you his public key id_rsa.pub - which is simply oneline text file, and you add contents of this file into authorized_keys on the server (in his account .ssh directory), then this client can ssh without password. Simple fact that his client has access to his private key (id_rsa) is enough for ssh to establish password-less connection. But this is also the reason why private key should be guarded very carefully, and be never sent to anyone (including you, server owner). Public key, on other hand, is perfectly fine to show and send to anyone - it is useless without having access to private key.

Also (on Linux at least), ssh has certain rules regarding permissions for files id_rsa, id_rsa.pub and authorized_keys. For example, it will refuse to work if permissions on private key and authorized keys are not strict enough (something like 0600 - user-owned only must be in effect).

You must log in to answer this question.

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