---
title: "Add an SSH key"
url: "https://inleed.com/helpcenter/add-ssh-key"
language: "en"
updated: "2026-11-06"
category: "Web hosting"
type: "guide"
---

# Add an SSH key

With an SSH key you log in to your hosting or your VPS without a password. You add the public key in DirectAdmin or on the server.

## Faster: let an AI app do it

If you’ve connected Inleed to an AI app, just write what you want done, for example:

> Add my public SSH key to the hosting for example.se

Done. The key is added to your hosting, and you can log in with it.

[How to connect an AI app](https://inleed.com/helpcenter/connect-ai-app)

## Before you start

- You need a key pair. Create it on your computer with `ssh-keygen` or PuTTYgen.

## How to add the key

### A. Hosting

You add the key in DirectAdmin.

1. Log in to [DirectAdmin](https://inleed.com/helpcenter/log-in-to-directadmin) and open **SSH Keys** under **Advanced Features**.

2. Click **Paste Key**.

3. Paste your public key and save.

### B. VPS

You add the key on the server.

1. Log in to the server and add the public key at the end of the file `~/.ssh/authorized_keys`.

## How to know it worked

You log in with the key instead of a password.

## Good to know

- It is the public key that goes in, the file ending in `.pub`. You keep the private one.
- SSH to your hosting uses port `2020`, and to a VPS port `22`.  
  [Connect to your hosting with SSH](https://inleed.com/helpcenter/connect-web-hosting-ssh)

## Related guides

- [Connect to your hosting with SSH](https://inleed.com/helpcenter/connect-web-hosting-ssh)
- [FTP and SFTP settings for your hosting](https://inleed.com/helpcenter/ftp-settings)
