Author: David FinsterLast Updated: Tue, Oct 6, 2020
Changing SSH keys on a running server using the Customer Portal will reinstall and wipe all data on the server. You can manually change SSH keys without reinstalling the server by following this Quickstart Guide.
To follow this guide, you must have an SSH key in OpenSSH format. See our guide to create an SSH key.
This guide applies to Linux and BSD servers.
This guide is suitable for Linux, Mac, or Windows workstations.
Deploy a new SSH key from a Linux or Mac workstation with
The ssh-copy-id utility is pre-installed on most Linux distributions. Mac workstations can install it via Homebrew, MacPorts, or using Curl.
Use the utility to add your public key to the server.
Specify the correct public key with the -i [path to public key] parameter.
Specify the username and server IP address (or domain name) as shown. For example, the root user at 192.0.2.123:
$ ssh-copy-id -i ~/.ssh/id_rsa.pub firstname.lastname@example.org
The utility will report some basic information and prompt for your password.
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/example_user/.ssh/id_rsa.pub" /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys email@example.com's password:
Enter your password and the utility installs the key.
Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'firstname.lastname@example.org'" and check to make sure that only the key(s) you wanted were added.
Windows workstations can mimic the ssh-copy-id utility with a one-line PowerShell command. The example shown pipes the the public key through SSH from the current user's profile to the root user's ~/.ssh/authorized_keys.
PS> type $env:USERPROFILE\.ssh\id_rsa.pub | ssh email@example.com "cat >> .ssh/authorized_keys"
SSH to the server.
Append your public key to the file.
Save and exit.
There are no common automatic methods to delete a public key, you must remove it manually.
SSH to your server.
Remove the line containing your key.
Save and exit.
The Vultr API offers several endpoints to manage SSH keys.
Create a new SSH key for use with future instances. This does not update any running instances.
List all SSH keys in your account.
Get information about an SSH key.
Update an SSH key.
Delete an SSH key.
For more information about managing SSH keys, see our other guides: