How to Enable SSH Access to Your Server
Introduction
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
Before enabling SSH, check if it is already active on your server.
On Linux/macOS, open a terminal and type:
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
Log into cPanel
Access your cPanel by navigating to
https://yourdomain.com/cpanel
.
Go to SSH Access
Find the SSH Access option under the Security section.
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.
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
Log into DirectAdmin
Navigate to your DirectAdmin panel:
https://yourdomain.com:2222
.
Check User-Level Access
Go to Account Manager > SSH Keys.
If the option is not available, contact your hosting provider to enable SSH.
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
Log into Plesk
Access Plesk via
https://yourdomain.com:8443
.
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.
Use SSH to Connect
Open a terminal and connect using:
BashCopy
Step 5: Enable SSH Access on Linux Servers (Without a Control Panel)
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
On Ubuntu/Debian-based servers:
BashCopy
On CentOS/RHEL-based servers:
BashCopy
AdjustFirewallSettings
If your firewall blocks SSH connections, allow SSH access:
BashCopy
Verify SSH Status
Check if SSH is running with:
BashCopy
Step 6: Secure Your SSH Access
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 setPermitRootLogin no
.
Use SSH Keys Instead of Passwords:
Generate an SSH key using
ssh-keygen
and copy it to the server withssh-copy-id your-user@your-server-ip
.
Conclusion
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.
Last updated
Was this helpful?