3

There's some logic that I'm not following whenever my organization sets up VMs for SSH access. Perhaps someone can help me understand.

Our process is currently as follows

  1. Generate Keypair on Linux Server (EC2 instance)
  2. Copy id_rsa (the private key) to Windows system.
  3. Use Putty's keygen to convert to generate a PPK key file from that private key. Then connect to putty with that key file.

But wouldn't it be more secure to generate the keys on the Windows system, connect to our server and add the windows public key to the authorized_key file? Am I missing something?

  • Windows puttygen forces you to create a lot of entropy manually, while Unix ssh-keygen just uses the entropy the system already has, almost instantly. If the people doing this are paid for their time, as is common in most organizations and required in nearly all businesses, and they're doing this for a significant number of machines, generating on Windows could cost a fair bit of money for very little benefit. – dave_thompson_085 Feb 2 at 9:43
3

You are right in that it would be more secure to generate and keep the private key only on the windows system and share only the public key with other systems.

But depending on your specific environment and users it might be more easy and comfortable but still considered secure enough to generate the key the way you describe. There is no such thing as absolute security or even best security - it is always a compromise between performance and usability on one side and the risks on the other side. As long as the risks are small enough (which depend on the actual environment and use case) one might well use the more comfortable way.

  • Besides that, sending the public key without a final check that the correct public key is received may fool you into trusting the wrong public key as well. That may be even less likely than somebody eavesdropping the private key value, but it would compromise the system just as much. Of course, sending the private key to the other system from a public WiFi over an unprotected network might not be the best idea (the environment you were talkin about). Hooking up a laptop directly to a management port of the server is a much more secure option. – Maarten Bodewes Feb 1 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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