3

I just deleted my full ec2-user/.ssh/ folder and I want to recover the keys so I can access my EC2 server without stopping and starting it.

I have on my computer a PPK file that has something like "Private-Lines" so I'm guessing it has both private and public key... I've tried a lot of things without success so, what are the step by step instructions to recover my keys to the server using this PPK key?

I'm still connect via SSH :)

AlfaTeK
  • 275
  • 3
  • 12
  • Why not generate a new key with ssh-keygen, add the public part to your server's authorized_keys so you're not locked out when the network dies unexpectedly? – c4urself May 29 '15 at 03:32
  • And what if I disconnect without realizing that? How will I recover? – Pronoy999 Oct 06 '18 at 16:16

1 Answers1

5

Ok, this is really easy:

  1. Open puttygen
  2. Click Load and Load PPK file
  3. Copy the key that is on the first textarea (public key for pasting...)
  4. In the linux server create ~/.ssh/authorized_keys and paste the key
  5. chmod 700 ~/.ssh
  6. chmod 600 ~/authorized_keys
AlfaTeK
  • 275
  • 3
  • 12