wave
rectangle square backgroundrectangle square backgroundrectangle square backgroundrectangle square backgroundrectangle square backgroundrectangle square backgroundNews

API Now Supports SSH Keys for Droplet Creates

Posted: January 22, 20131 min read

We are excited to announce that our API now supports SSH Keys for virtual server creates. This allows customers to spin-up new servers through the API with a single or multiple SSH keys already added to the root user. When using SSH keys, we also do not email out the root password for added security as we default to SSH keys for authorization.

To get a list of your available SSH keys simply:

https://api.digitalocean.com/ssh_keys/?client_id=[YOUR_CLIENT_ID]&api_key=[YOUR_API_KEY]

This will give you JSON output of all of your current keys that can be deployed during creates:

{ "status":"OK",  "ssh_keys":[{"id":10,"name":"office-imac"}, {"id":11,"name":"macbook-air"}]}

To use SSH keys in your create request, simply add the new paramater `ssh_key_ids` with a comma separated list of SSH Key IDs that you would like added to the new server that you will create:

https://api.digitalocean.com/droplets/new?name=[DROPLET_NAME]&size_id=[SIZE_ID]&image_id=[IMAGE_ID]&region_id=[REGION_ID]&client_id=[YOUR_CLIENT_ID]&ssh_key_ids=[SSH_KEY_ID1],[SSH_KEY_ID2]
In this case, if you wanted to add both the office-imac and macbook-air keys, you would add the following to your create call: ssh_key_ids=10,11

It's just that simple to now integrate SSH Keys into your droplet creates via the API!

Share

TwitterFacebookLinkedInHackerNews

Optimize your streaming business

Download our guide to learn how streaming businesses can optimize their architecture to save costs.

Download now

Related Articles

Forrester Total Economic Impact: Study finds a 186% ROI with DigitalOcean
news

Forrester Total Economic Impact: Study finds a 186% ROI with DigitalOcean

March 1, 20223 min read

Cloudways to join DigitalOcean 
news

Cloudways to join DigitalOcean 

August 23, 20223 min read

Currents research 2019
news

Currents research 2019

December 11, 20193 min read

Sea floor left
Sea floor middle
Sea floor right