Can you share an example of how you are calling the API and the cloud config script used? It would help narrow down the issue. At the surface, what you’re trying to should be supported.
You have a few options for adding multiple SSH keys to a Droplet:
The API allows for adding more than one SSH key when creating a Droplet. The ssh_keys
field and take an array of SSH key IDs. For example, the body of your request might look like:
{
"name":"example.com",
"region":"nyc3",
"size":"s-1vcpu-1gb",
"image":"ubuntu-16-04-x64",
"ssh_keys":[123456, 654321]
}
You can also add SSH keys to new Droplets via user data. For example:
#cloud-config
users:
- name: root
ssh-authorized-keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADA....
If you specify the root
user, these keys will be merged with the keys specified via the API into the ~/.ssh/authorized_keys
file.
If you are still having issues and want to do further debugging, you can reset the root password for your Droplet via the “Access” tab for the Droplet in the control panel in order to gain access.

by Justin Ellingwood
A cloud-config file is a special script that is used to define configuration details for your server as it is being brought online for the first time. These are often used for completing common tasks that a user would normally have to log into the server to accomplish. In this guide, we will run through how to do some initial configuration of an Ubuntu 14.04 server using a cloud-config file with our metadata service.