> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.elitehost.co.za/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to access your Managed VPS via SSH Keys

This guide explains how to create SSH keys using WHM and use them to securely access your Managed cPanel VPS via SSH. SSH keys enhance the security of your server by providing a more secure login method compared to passwords.

### Why Use SSH Keys?

SSH keys are a secure and convenient way to access your VPS. They use a cryptographic key pair (private and public keys) to authenticate your login, eliminating the need for passwords.

### Step 1: Generate an SSH Key Pair in WHM

1. **Log in to WHM** as the root user.
2. Navigate to **Home > Security Center > Manage root’s SSH Keys**.
3. Click on **Generate a New Key**.
4. Fill out the following fields:
   - **Key Name**: Leave blank to use the default name ( `id_rsa`), or specify a custom name.
   - **Key Password**: Enter a strong password to secure your private key. This is also known as the key passphrase. Confirm it in the next field.
   - **Key Type**: Select **RSA** (recommended).
   - **Key Size**: Choose **2048** or **4096** for stronger encryption.
5. Click **Generate Key**. WHM will create the key pair and display a confirmation message.

### Step 2: Authorise the Public Key

1. After generating the key, go back to the **Manage root’s SSH Keys** section.
2. Locate the public key you just created in the list.
3. Click **Manage Authorization** next to the key.
4. Click **Authorize** to allow the server to accept the key for SSH access.

### Step 3: Download the Private Key

1. In the **Manage root’s SSH Keys** section, locate the private key associated with your public key.
2. Click **View/Download Key**.
3. Copy the key to a file on your local machine or download it as a file.
   - Save the contents to Private Key id_rsa (OpenSSH format) to a .pem file or if plan to use PuTTY enter the password/passphrase and click Covert.

### Step 4: Access Your VPS Using SSH Keys

#### Using PuTTY (Windows)

1. **Install PuTTY**:
   - Download PuTTY from the [official website](https://www.putty.org/).
2. **Configure PuTTY**:
   - Open PuTTY and enter your server’s IP address in the **Host Name (or IP address)** field.
   - Enter the SSH port (default 22). Please contact support or refer to the welcome email for our custom SSH port.
   - Go to **Connection > SSH > Auth**.
   - Click **Browse** and select your `.ppk` file.
   - Return to the **Session** category, give the session a name, and click **Save**.
3. **Connect to the Server**:
   - Click **Open** to initiate the connection.
   - If prompted, accept the server’s fingerprint.
   - You should now be logged in as the root user.

#### Using SSH Client (Linux/macOS)

1. Open a terminal.
2. Ensure the private key file ( `.pem`) has secure permissions:
```
chmod 600 /path/to/private-key.pem
```
3. Connect to your server
```
ssh -i /path/to/private-key.pem root@your_server_ip
```
4. If prompted, confirm the server’s fingerprint.

### Step 5: Disable Password Authentication (Optional but Recommended)

Once you have confirmed that your SSH keys are working correctly and you can log in without issues, follow these steps to enhance server security by disabling password authentication:

1. Log in to WHM as the root user.
2. Navigate to **Home > Security Center > SSH Password Authorization Tweak**.
3. Check the current status: If **Password Authentication is enabled**, it’s recommended to disable it.
4. Select the option to disable password authentication and save your changes.

| **Tip:** Disabling password authentication ensures that only users with authorized SSH keys can access your VPS, significantly improving security. Ensure that you have tested and confirmed SSH key-based access before disabling passwords.

If you need assistance with these steps, feel free to reach out to our [support team](https://my.elitehost.co.za/submitticket.php) or email helpdesk@elitehost.co.za