Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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!

share|improve this question

migrated from stackoverflow.com Jun 21 '13 at 12:35

This question came from our site for professional and enthusiast programmers.

    
Search for freesshd import public key. –  ott-- Jun 21 '13 at 12:55

1 Answer 1

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).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.