Skip to content

Instantly share code, notes, and snippets.

@vdeep
Created December 6, 2019 17:43
Show Gist options
  • Save vdeep/5bf2fd25b69db867ec3198bd9ec8eb7d to your computer and use it in GitHub Desktop.
Save vdeep/5bf2fd25b69db867ec3198bd9ec8eb7d to your computer and use it in GitHub Desktop.
Instructions to upload SSH keys to DigitalOcean instance manually

1

  1. Login to the console on digitalocean website.
  2. Type sudo nano /etc/ssh/sshd_config
  3. Change PasswordAuthentication from “no” to “yes” and save the file
  4. Restart sshd (Debian: sudo service sshd restart)

2

Linux, Mac (ssh-copy-id):

  1. Run `ssh-copy-id [user]@[hostname or IP address]

Windows:

  1. Open a terminal on your computer and type ssh username@[hostname or IP address] or if on a Windows box use PuTTY for password login making sure authentication parameters aren’t pointing to a private key
  2. Login with password
  3. Type sudo nano ~/.ssh/authorized_keys
  4. Paste public key text here and save the file

3

  1. Type sudo nano /etc/ssh/sshd_config
  2. Change PasswordAuthentication from “yes” to “no” and save the file
  3. Restart sshd (Debian: sudo service sshd restart)
  4. Log out and attempt to log back in (if using PuTTY make sure you set up auth parameters to point to your private key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment