How to Manage SSH Access in cPanel
Introduction
At Lanetti, we understand the importance of secure and efficient server management. Secure Shell (SSH) access allows you to securely connect to your hosting server and manage files, databases, and configurations using command-line tools. This guide explains how to manage SSH access in cPanel, including enabling, configuring, and connecting via SSH.
What Is SSH Access?
SSH is a secure protocol that enables remote access to your server. It’s commonly used for:
- File management and transfers.
- Running commands and scripts.
- Managing databases and server configurations.
SSH access is encrypted, ensuring secure communication between your local device and the server.
How to Manage SSH Access in cPanel
Step 1: Log in to Your cPanel
- Open your browser and navigate to your cPanel login page (e.g.,
https://yourdomain.com/cpanel
). - Enter your username and password, then click Log in.
Step 2: Locate the SSH Access Tool
- In the cPanel dashboard, navigate to the Security section.
- Click on SSH Access.
Step 3: Enable SSH Access (If Required)
- If SSH is disabled for your account, you may need to contact your hosting provider to enable it.
- Some hosting plans may include SSH access by default, while others may require an upgrade.
Step 4: Generate an SSH Key
- In the SSH Access page, click Manage SSH Keys.
- Click Generate a New Key and configure the following:
- Key Name: Leave this blank to use the default name.
- Key Password: Create a strong password to protect your private key.
- Key Type: Choose RSA (default).
- Key Size: Select 2048 or 4096 for enhanced security.
- Click Generate Key.
- After the key is created, you’ll see it listed under Public Keys and Private Keys.
Step 5: Authorize the SSH Key
- Locate your newly created public key under the Public Keys section.
- Click Manage next to the key and select Authorize.
Step 6: Download the Private Key
- Under the Private Keys section, click View/Download next to your private key.
- Enter the key’s password to decrypt it.
- Click Download Key and save it to a secure location on your local device.
Connecting to Your Server Using SSH
Using an SSH Client (e.g., PuTTY)
- Download and install PuTTY (Windows) or use your terminal (Mac/Linux).
- Open PuTTY and configure the following settings:
- Host Name (or IP address): Enter your server’s hostname or IP (found in cPanel).
- Port: Use
22
(default SSH port). - Authentication:
- Go to SSH > Auth in PuTTY.
- Browse and select your downloaded private key file.
- Click Open to connect.
Using the Terminal (Mac/Linux)
- Open your terminal and enter the following command:
ssh -i /path/to/private-key username@server_ip
Replace/path/to/private-key
with the location of your private key file,username
with your cPanel username, andserver_ip
with your server's IP address. - If prompted, type yes to accept the server’s fingerprint.
- Enter the private key password when prompted.
Managing SSH Access
Change SSH Key Password
- In the Manage SSH Keys section, locate the private key.
- Click Change Passphrase, enter the new passphrase, and confirm.
Disable SSH Access
- To revoke SSH access, delete or deactivate the public key in the Public Keys section.
- Click Manage next to the key and select Revoke Authorization.
Best Practices for SSH Access
- Use Strong Passwords: Protect your private key with a robust passphrase.
- Restrict IP Access: Use a firewall or IP whitelisting to limit SSH access to trusted devices.
- Regularly Rotate Keys: Periodically generate new keys to maintain security.
- Disable Password Authentication: Use key-based authentication to prevent brute-force attacks.
For any issues or assistance with SSH access, feel free to contact Lanetti Support. We're here to ensure secure and seamless server management for your hosting needs!