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
  • 29,694
  • 16
  • 106
  • 164
Gyt Dau
  • 33
  • 1
  • 1
  • 4
  • If you are using MS Windows, I'm sorry but you'll have to ask on a Windows forum (or on the DigitalOcean forum). Many people here won't be able to help you. BTW, take a look [at this question on Server Fault](http://serverfault.com/questions/224810/is-there-an-equivalent-to-ssh-copy-id-for-windows). – Andrea Corbellini Jul 04 '15 at 16:30
  • Oh, okay, I thought that it was relevant because the VPS is running Ubuntu. Thank you. – Gyt Dau Jul 04 '15 at 16:34

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,551
  • 10
  • 39
  • 60