How to Add Your SSH Key to DirectAdmin

Short answer: Log in to DirectAdmin, go to Advanced Features > SSH Keys, click Paste Key, and paste the contents of your public key file (the one ending in .pub) into the box. Give it a name, click Create, then check the Authorized Keys tab to confirm it’s listed. You can now connect over SSH using your private key instead of a password.

If you haven’t generated a key pair yet, do that first — see our guide on generating an SSH key on Windows, Mac, and Linux.

Before you start

  • Your DirectAdmin account needs SSH access enabled. If you don’t see “SSH Keys” under Advanced Features, ask your hosting provider to enable it.
  • You need your public key already generated (the .pub file, not the private key). Never paste the private key anywhere.

Step-by-step: adding your key in DirectAdmin

  1. Log in to your DirectAdmin account.
  2. Go to Advanced Features > SSH Keys.
  3. You’ll see two options: Create Key (generates a new key pair directly on the server) and Paste Key (imports a key you already generated on your own computer). Click Paste Key.
  4. Paste the full contents of your public key file (e.g. id_ed25519.pub or id_rsa.pub) into the text box, including the ssh-ed25519 or ssh-rsa prefix at the start and the comment at the end.
  5. Give the key a name or comment so you can identify it later, then click Create.
  6. Switch to the Authorized Keys tab to confirm the key was added successfully.

Connecting with your key

Once the key is authorized in DirectAdmin, connect as usual:

From Windows (PowerShell):

ssh -i C:\Users\<you>\.ssh\id_ed25519 username@yourserver.com

From macOS or Linux:

ssh -i ~/.ssh/id_ed25519 username@yourserver.com

If you added the key to your local ssh-agent or macOS keychain already, you can usually just run ssh username@yourserver.com and it will pick up the key automatically.

Using PuTTY on Windows: open PuTTY, go to Connection > SSH > Auth > Credentials, browse to your private key file (converted to .ppk format via PuTTYgen if needed), then connect as usual — you’ll be prompted for your passphrase instead of a password.

Troubleshooting

  • “SSH Keys” isn’t in the menu: SSH access isn’t enabled on the account yet. Contact your hosting provider.
  • Still asked for a password after adding the key: double-check the key pasted as a single unbroken line with no extra line breaks, and confirm you’re connecting with the matching private key (ssh -i path).
  • Permission denied (publickey): verify the username in your SSH command matches your DirectAdmin username, and that the key shown as “Authorized” in the panel matches the private key you’re using locally.

Frequently asked questions

Do I need to enable SSH access before I can add a key?
Yes. If “SSH Keys” doesn’t appear under Advanced Features in your DirectAdmin panel, SSH access hasn’t been enabled on your account yet — contact your hosting provider to turn it on.

What’s the difference between “Create Key” and “Paste Key” in DirectAdmin?
“Create Key” generates a brand-new key pair directly on the server and gives you the private key to download. “Paste Key” lets you import a public key you already generated on your own computer, which is the more common and more secure option since your private key never leaves your device.

Can I add more than one SSH key to a DirectAdmin account?
Yes. You can add a separate key for each device you use to connect, and remove individual keys later from the Authorized Keys tab without affecting the others.

Does adding an SSH key disable password login?
No, not by itself. Adding a key gives you the option to log in with it, but password login stays enabled unless it’s separately disabled at the server level (typically in the SSH daemon configuration, which is a server-admin-level change, not a DirectAdmin user setting).

Why does DirectAdmin still ask for my password after I added the key?
This usually means the client is not using the matching private key, or the pasted public key has a line break in it. Re-check that the key was pasted as one continuous line and that your SSH client is pointed at the correct private key file.