3

I'm following this guide to set up an RSA key pair with my VPS.

I'm using my Windows PC to follow through with the first part of the guide, and ssh-copy-id does not exist in the command prompt (neither does cat) - meaning I can't send the public key to the server.

Am I doing it wrong? Is it because I'm using Windows?

Wilf
  • 30,732
Gyt Dau
  • 33
  • 1
  • 1
  • 4

1 Answers1

3

With putty, you can upload public key manually, assuming you now can access the server with username and password:

  1. Generate the key file, with the guide you followed it will be .pub file, the content of the file should shart with "ssh-rsa AAAA ...."
  2. Login to the server machine
  3. Copy the content of the .pub file into the ~/.ssh/authorized_keys file (for this use vim, nano or your favourite text editor)

If your SSH directory does not exist, create it and then copy the pub file into the ~/.ssh/authorized_keys:

mkdir ~/.ssh
chmod 0700 ~/.ssh
touch ~/.ssh/authorized_keys
chmod 0644 ~/.ssh/authorized_keys
nano ~/.ssh/authorized_keys
...

Now you should be able to login with your private key file.

Mike
  • 5,931