Overview
The SSH Keys page in the DreamHost panel lets you manage all the SSH keys on your account in one place. You can add keys, generate new keys, rename keys, set a default key, assign keys to Dedicated servers, and delete keys you no longer use. How a key gives access to a server depends on your plan, so this article has a section for Dedicated servers and a section for VPS.
This article explains how to open the SSH Keys page, how to manage your keys, and how to use keys on each plan.
Opening the SSH Keys page
Navigate to the Servers & Usage page.
Near the top, click Manage SSH Keys.
The SSH Keys page opens.
The Manage SSH Keys button always appears on the Servers & Usage page, even if your account has no keys.
What does the SSH Keys page show?
The SSH Keys page lists every key on your account in one list. Each key shows the following:
Fingerprint — The key's fingerprint, including its algorithm and hash.
Machines — The machines the key is active on.
Default label — A Default label appears on your default key.
If your account has no keys, the page shows the message "No SSH Keys to Manage."
Adding a key
Click Add SSH Key.
Enter a name for the key.
Add the key using one of these options:
To use a key from your computer, paste your public key (
.pubfile) in the SSH Key field. Don't paste your private key.To create a new key, click Generate Key, then click Download Key or Copy to save your private key. The panel shows your private key only once, so save it before you leave the page. For help saving the key, see Saving your SSH private key.
Click Save.
A new key isn't active on any server yet. See the sections below for your plan to start using it.
Finding a key
To find a key by key name or server name, use Search.
To show only keys on specific servers or server types, click Filter, then use the Server and Type tabs.
Renaming a key
Next to the key, click Manage.
Click the pencil icon next to the key name.
Enter the new name and confirm. The name must be unique on your account.
Setting or removing the default key
Next to the key, click Manage.
Click Set as Default Key.
Your default key is selected automatically when you set up a new VPS. Only one key can be the default. To stop using a key as the default, click the button again.
Deleting a key
Next to the key, click Manage.
Under Delete SSH Key, click Delete.
Confirm.
What happens on your servers when you delete a key depends on your plan. See the Dedicated servers and VPS sections below.
Using keys on Dedicated servers
On a Dedicated server, you assign keys to the server from the SSH Keys page. A key gives access to a Dedicated server once you assign it.
Assigning a key to a server
Next to the key, click Manage.
Under Machine Access, click Assign next to the server.
Confirm.
Removing a key from a server
Next to the key, click Manage.
Under Machine Access, click Remove next to the server.
Confirm.
The key no longer gives access to that server.
Deleting a key
When you delete a key, it's removed from every Dedicated server it was assigned to.
Using keys on a VPS
You have full control of your VPS, so you choose a key for a new VPS during checkout and manage keys on an existing VPS yourself. The panel can't add or remove keys on a VPS after it's set up.
Using a key on a new VPS
During checkout, select the key under Secure VPS Access. See Configuring and connecting to a VPS.
Adding a key to an existing VPS
Copy the public key
Next to the key, click Manage, then copy the public key.
Connect to your VPS
Connect to your VPS. You can find the IP address and login user in the App tab.
Open the authorized_keys file
Run the following commands:
[server]$ mkdir -p ~/.ssh && chmod 700 ~/.ssh [server]$ nano ~/.ssh/authorized_keys
Add the key
Paste the public key on a new line. Save and close the file.
Set the file permissions
Run the following command:
[server]$ chmod 600 ~/.ssh/authorized_keys
Removing a key from an existing VPS
Connect to your VPS
Connect to your VPS.
Open the authorized_keys file
Run the following command:
[server]$ nano ~/.ssh/authorized_keys
Delete the key
Delete the line with the key. Save and close the file.
Removing a VPS from a key's list in the panel
Next to the key, click Manage.
Under Machine Access, click Remove From List next to the VPS.
Confirm.
Remove From List and Delete only change what you see in the panel. The key still works on your VPS until you remove it from the authorized_keys file.
If you no longer have access to your VPS, contact support.
FAQs
Can I use a key I already have?
Yes. Click Add SSH Key, then paste your public key (.pub file) in the SSH Key field.
Can I paste my private key into the panel?
No. Paste only your public key. Keep your private key on your computer.
Can I assign a key to a VPS from the SSH Keys page?
You can select a key for a new VPS during checkout under Secure VPS Access. For an existing VPS, add the key to the authorized_keys file on the VPS yourself.