Skip to content
mybox Help Center

Help sections

  • Getting Started
  • Account & Billing
  • Domains & DNS
  • Hosting & Servers
  • Email
  • Security & SSL
  • WordPress & CMS
  • Grow Online
mybox.com All services operational
/

Language

  • English
  • Română
  • mybox panel
  • Webmail
Start free
/
  • Getting Started
  • Account & Billing
  • Domains & DNS
  • Hosting & Servers
  • Email
  • Security & SSL
  • WordPress & CMS
  • Grow Online
  • Help Center
  • mybox.com
  • English
  • Română
All services operational Start free
  1. Help Center
  2. Security & SSL
  3. Account & Password Security
How-to Security & SSL

How do I add an SSH key to a server?

Updated June 3, 2026 1 min read
On this page
  1. Step 1: Connect to the Server
  2. Step 2: Open the Authorized Keys File
  3. Step 3: Add Your Public SSH Key
  4. Step 4: Save the File
  5. Step 5: Test the Connection
  6. Security Recommendations
  7. Summary

SSH keys provide a secure alternative to password-based authentication. Once a public key is added to your hosting account, you can connect via SSH using the corresponding private key stored on your device.

To complete the next steps, you must have active access to SSH. Click HERE to learn how.

Step 1: Connect to the Server

Log in to your hosting account using SSH.

Step 2: Open the Authorized Keys File

In the terminal, run the following command:

nano ~/.ssh/authorized_keys

If the file does not exist, it will be created automatically when saved.

Step 3: Add Your Public SSH Key

Paste your public SSH key on a new line in the file.

A public key typically looks similar to:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQ...

Make sure the entire key is pasted on a single line without any additional characters or formatting.

If you have not yet generated an SSH key pair, first create one on your local computer and then copy the public key to the server.

Step 4: Save the File

To save the changes in Nano:

  1. Press Ctrl + X
  2. Press Y to confirm the changes
  3. Press Enter to save the file

Step 5: Test the Connection

After saving the file, try connecting to the server using the private key associated with the public key you added.

If the key has been configured correctly, you should be able to authenticate without entering your account password.

Security Recommendations

  • Never share your private SSH key.
  • Store your private key securely on trusted devices.
  • Remove unused keys from the authorized_keys file.
  • Use a passphrase to protect your private key whenever possible.

Summary

To add an SSH key to your hosting account, connect to the server, open the ~/.ssh/authorized_keys file, paste your public key on a new line, and save the changes. Once configured, you can use key-based authentication to access your account via SSH.

Was this article helpful?

Didn't find an answer?

Our support team is here for you 24/7 – write to us and we will help you sort it out.

Helpdesk 24/7 Open a ticket in the mybox panel mybox panel Log in and manage your services

On this page

  1. Step 1: Connect to the Server
  2. Step 2: Open the Authorized Keys File
  3. Step 3: Add Your Public SSH Key
  4. Step 4: Save the File
  5. Step 5: Test the Connection
  6. Security Recommendations
  7. Summary

Related articles

All in Account & Password Security
How-to Account & Password Security FTP client – How to take care of security? When using FTP clients to manage your website files, it is important to follow security best practices to protect your hosting account… 2 min read How-to Account & Login Management How do I set up 2FA in the mybox panel? Two-factor authentication (2FA) adds a second verification step when logging in to the mybox panel. After entering your password, the panel asks… 1 min read How-to WebMail mail.mybox.com How do I set up two-step verification in Webmail? Security is a priority today, and two-step verification, which requires not only knowing and providing a password, but also a one-time code,… 2 min read
mybox

Modular web hosting – free out of the box, modular to grow.

Help sections

  • Getting Started
  • Account & Billing
  • Domains & DNS
  • Hosting & Servers
  • Email
  • Security & SSL
  • WordPress & CMS
  • Grow Online

mybox

  • mybox.com
  • mybox panel
  • Webmail
  • Helpdesk 24/7
© 2026 mybox 1,680 articles