Categories
kbase

How to Add SSH Keys for a DirectAdmin User Account

SSH keys allow you to connect to your server securely without using a password. DirectAdmin includes a built‑in SSH Key Manager that makes adding your public key simple — as long as you know where to look.

This guide walks you through the exact steps to add your SSH key using the Paste Key method, which is the most accurate workflow for standard DirectAdmin user accounts.

1. Generate an SSH Key (If You Don’t Have One Yet)

If you haven’t created SSH keys yet, follow the full guide here:

🔗 https://nanoapps.ca/kbase/how-to-create-ssh-keys/

That guide covers:

  • Windows
  • macOS
  • Linux
  • File paths
  • Copying your public key
  • Best practices

Once you have your public key (.pub file), continue below.

2. Log In to DirectAdmin

Sign in to your DirectAdmin user account (not admin/reseller unless that’s your role).

3. Open the SSH Key Manager

In the main menu, go to:

Advanced Features → SSH Keys

If you don’t see this option, your hosting provider must enable SSH access for your account.

4. Add Your SSH Key Using “Paste Key”

This is the correct workflow for DirectAdmin users.

  1. Click Paste Key
  2. A text box will appear
  3. Paste your entire public key line
    • It should start with ssh-ed25519 or ssh-rsa
    • Make sure there are no extra spaces or line breaks
  4. Click Create

Your key will now appear under Authorized Keys.

5. Test Your SSH Login

From macOS/Linux Terminal or Windows PowerShell:

bash

ssh username@yourdomain.com

If your server uses a custom SSH port:

bash

ssh -p 2222 username@yourdomain.com

If everything is configured correctly, you will log in without entering a password.

What to Do When You See “The authenticity of host can’t be established”

The first time you connect to a new server using SSH, you will see a message like this:

Code

The authenticity of host 'testdomainc.com (192.0.2.123)' can't be established.
ED25519 key fingerprint is SHA256:FAKEFINGERPRINTSTRING1234567890TESTONLYABCDEF.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])?

This is normal. It appears because your computer has never connected to this server before.

What to do

If you are connecting to the correct server, simply type:

Code

yes

and press Enter.

Your computer will save the server’s fingerprint to your known_hosts file, and you won’t see this message again unless:

  • the server is rebuilt
  • the IP changes
  • the SSH host key changes

After typing yes, your SSH login will continue normally.

Troubleshooting

“Permission denied (publickey)”

Common causes:

  • Incorrect key pasted
  • Key not created properly
  • SSH access disabled for your user

Still asks for a password

Force your SSH client to use the correct key:

bash

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

Multiple keys causing conflicts

List loaded keys:

bash

ssh-add -l

Remove all keys:

bash

ssh-add -D

Add the correct one:

bash

ssh-add ~/.ssh/id_ed25519

Summary

Adding SSH keys in DirectAdmin is quick once you know where to go:

  1. Generate your SSH key (or follow your existing guide)
  2. Go to Advanced Features → SSH Keys
  3. Click Paste Key
  4. Paste your public key
  5. Click Create
  6. Test your SSH connection
  7. Type yes when asked to trust the server for the first time

This setup gives you secure, password‑less access to your server.