A Vultr account Secure Shell (SSH) key authenticates and establishes a secure connection between a client application like Putty or Filezilla and cloud compute instances. SSH keys are more secure than passwords because they're long, complex, and less prone to brute-force attacks.
Follow this guide to add SSH keys using the Vultr Customer Portal, API, and CLI.
Navigate to Account and select SSH Keys under OTHER.
Click Add SSH Key.
Enter the SSH Keys details and click Add SSH Key.
Send a POST
request to the Create SSH key endpoint to create an SSH key.
$ curl "https://api.vultr.com/v2/ssh-keys" \
-X POST \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
--data '{
"name" : "test-ssh-key",
"ssh_key" : "ssh-rsa AAAAB3NzaC1yc2EA...."
}'
Visit the Create SSH key endpoint to view additional attributes to add to your request.
Send a GET
request to the List SSH Keys endpoint to view all SSH keys.
$ curl "https://api.vultr.com/v2/ssh-keys" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Create a new SSH Key.
$ vultr-cli ssh-keys create \
--name="test-ssh-key" \
--key="ssh-rsa AAAAB3NzaC1yc2EA...."
List all SSH keys.
$ vultr-cli ssh-keys list
Run vultr-cli ssh-keys create --help
to view all options.