> For the complete documentation index, see [llms.txt](https://learn.sitecove.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.sitecove.com/how-to-guides/web-hosting/control-panel-and-server-management/how-to-enable-ssh-access-to-your-server.md).

# How to Enable SSH Access to Your Server

#### Introduction <a href="#introduction" id="introduction"></a>

Secure Shell (SSH) is a crucial tool for remote server management, allowing users to securely access and control their servers via a command-line interface. Whether you're a developer, system administrator, or website owner, enabling SSH access can significantly enhance your ability to manage your server. This guide will walk you through the steps to enable SSH access on your server, covering different control panels and server environments.

#### Step 1: Check if SSH is Already Enabled <a href="#step-1-check-if-ssh-is-already-enabled" id="step-1-check-if-ssh-is-already-enabled"></a>

Before enabling SSH, check if it is already active on your server.

* On Linux/macOS, open a terminal and type:

  ```bash
  ssh your-user@your-server-ip
  ```

  BashCopy
* If you receive a connection prompt, SSH is already enabled.
* If the connection is refused, follow the next steps to enable SSH.

#### Step 2: Enable SSH Access viacPanel <a href="#step-2-enable-ssh-access-via-cpanel" id="step-2-enable-ssh-access-via-cpanel"></a>

1. **Log into cPanel**
   * Access your cPanel by navigating to `https://yourdomain.com/cpanel`.
2. **Go to SSH Access**
   * Find the **SSH Access** option under the **Security** section.
3. **Manage SSH Keys**
   * Click **Manage SSH Keys** to create a new key pair (public and private).
   * Select **Generate a New Key**, enter a passphrase (optional), and click **Generate Key**.
   * Authorize the newly created key under **Manage Keys**.
4. **Download and Use Your SSH Key**
   * Click **View/Download** the private key and save it to your computer.
   * Use an SSH client like PuTTY (Windows) or OpenSSH (Linux/macOS) to connect.

#### Step 3: Enable SSH Access via DirectAdmin <a href="#step-3-enable-ssh-access-via-directadmin" id="step-3-enable-ssh-access-via-directadmin"></a>

1. **Log into DirectAdmin**
   * Navigate to your DirectAdmin panel: `https://yourdomain.com:2222`.
2. **Check User-Level Access**
   * Go to **Account Manager** > **SSH Keys**.
   * If the option is not available, contact your hosting provider to enable SSH.
3. **Create an SSH Key Pair**
   * Click **Create SSH Key**, generate the keys, and download the private key.
   * Use an SSH client to connect.

#### Step 4: Enable SSH Access via Plesk <a href="#step-4-enable-ssh-access-via-plesk" id="step-4-enable-ssh-access-via-plesk"></a>

1. **Log into Plesk**
   * Access Plesk via `https://yourdomain.com:8443`.
2. **Enable SSH for Your User Account**
   * Navigate to **Websites & Domains** > **Hosting & DNS** > **Web Hosting Access**.
   * Set the **Access to the server over SSH** option to **/bin/bash** or another shell.
3. **Use SSH to Connect**
   * Open a terminal and connect using:

     ```bash
     ssh your-user@your-server-ip
     ```

     BashCopy

#### Step 5: Enable SSH Access on Linux Servers (Without a Control Panel) <a href="#step-5-enable-ssh-access-on-linux-servers-without-a-control-panel" id="step-5-enable-ssh-access-on-linux-servers-without-a-control-panel"></a>

If you are using a VPS or Dedicated Server without a control panel, you may need to enable SSH manually.

#### **Install and Start the SSH Service** <a href="#install-and-start-the-ssh-service" id="install-and-start-the-ssh-service"></a>

On Ubuntu/Debian-based servers:

```bash
sudo apt update && sudo apt install openssh-server -y
sudo systemctl enable ssh
sudo systemctl start ssh
```

BashCopy

On CentOS/RHEL-based servers:

```bash
sudo yum install -y openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd
```

BashCopy

#### **Adjust**Firewall**Settings** <a href="#adjust-firewall-settings" id="adjust-firewall-settings"></a>

If your firewall blocks SSH connections, allow SSH access:

```bash
sudo ufw allow ssh  # For Ubuntu/Debian
sudo firewall-cmd --permanent --add-service=ssh && sudo firewall-cmd --reload  # For CentOS/RHEL
```

BashCopy

#### **Verify SSH Status** <a href="#verify-ssh-status" id="verify-ssh-status"></a>

Check if SSH is running with:

```bash
sudo systemctl status ssh
```

BashCopy

#### Step 6: Secure Your SSH Access <a href="#step-6-secure-your-ssh-access" id="step-6-secure-your-ssh-access"></a>

To enhance security, follow these best practices:

* **Change the Default SSH Port** (e.g., from 22 to another number):
  * Edit the SSH configuration file: `sudo nano /etc/ssh/sshd_config`
  * Change `Port 22` to another port (e.g., `Port 2222`), save, and restart SSH: `sudo systemctl restart ssh`
* **Disable Root Login**:
  * Edit `sshd_config` and set `PermitRootLogin no`.
* **Use SSH Keys Instead of Passwords**:
  * Generate an SSH key using `ssh-keygen` and copy it to the server with `ssh-copy-id your-user@your-server-ip`.

#### Conclusion <a href="#conclusion" id="conclusion"></a>

Enabling SSH access to your server allows for secure and efficient management. Whether you're using cPanel, DirectAdmin, Plesk, or a standalone Linux server, following these steps ensures you can access your server safely. Always prioritize security by using strong authentication methods and limiting SSH access where necessary.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.sitecove.com/how-to-guides/web-hosting/control-panel-and-server-management/how-to-enable-ssh-access-to-your-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
