Use OpenSSH to create new SSH keys on MacOS, Linux, or Windows Subsystem for Linux.
How to Add SSH Keys to New or Existing Droplets
Validated on 22 Aug 2019 • Last edited on 22 Nov 2024
DigitalOcean Droplets are Linux-based virtual machines (VMs) that run on top of virtualized hardware. Each Droplet you create is a new server you can use, either standalone or as part of a larger, cloud-based infrastructure.
You can manage your Droplets using password-based logins, but we strongly recommend using SSH key pairs instead. SSH keys are more secure than passwords and can help you log in without having to remember long passwords.
To use SSH keys with your Droplets, you need to:
-
Create an SSH key using an SSH client installed on your local computer. OpenSSH is included on Linux, macOS, and Windows Subsystem for Linux. Windows users without Bash can use PuTTY.
How to Create SSH Keys with OpenSSH on MacOS or LinuxHow to Create SSH Keys with PuTTY on WindowsUse PuTTY to create SSH keys on Windows systems without Bash.
-
Add your SSH key to your Droplets. On DigitalOcean, you can upload your SSH public key to your team, which lets you add it to your Droplets at creation time. This lets you log in to your servers without a password while still remaining secure. You can also add your keys to a Droplet manually after creation.
How to Manage SSH Public Keys on DigitalOcean TeamsAdd public SSH keys to a DigitalOcean team to be able to automatically configure SSH key authentication during Droplets creation.
How to Upload an SSH Public Key to an Existing DropletAdd an SSH public key to an existing Droplet to be able to log in using that keypair.
After you create and upload your keys, you can connect using them.
Use a terminal to connect to Droplets using OpenSSH or PuTTY for shell access to your remote server.