Step 1: Check if SSH Access is Enabled:
- Log in to your cPanel account.
- Scroll to the Security section.
- Click on SSH Access.
- If you see an option to "Manage SSH Keys," SSH is already enabled for your account. If not, contact your hosting provider and ask them to enable SSH access, since many shared hosting plans turn it off by default.
Step 2: Generate an SSH Key Pair:
- Inside the SSH Access page, click on Manage SSH Keys.
- Click Generate a New Key.
- Fill in the details:
- Key Name—give it a recognizable name (e.g., "mykey")
- Key Password—Set a strong passphrase to protect the key (recommended)
- Key Type—choose RSA (2048-bit or higher is recommended)
- Click Generate Key.
- cPanel will create a public key and a private key.
Step 3: Authorize the Public Key:
- Go back to the Manage SSH Keys page.
- Find your newly generated key under "Public Keys."
- Click Manage next to it.
- Click Authorize—this allows the key to be used for logging in.
Step 4: Download the Private Key:
- On the same Manage SSH Keys page, locate your key under "Private Keys."
- Click View/Download and save the private key file safely on your computer.
- Never share this private key with anyone—it works like a password.
Step 5: Install an SSH Client on Your Computer:
Choose based on your operating system:
- Windows – Download and install PuTTY (or use the built-in Windows Terminal with OpenSSH).
- macOS/Linux—These already include a built-in Terminal app with SSH support, so no extra installation is needed.
Step 6: Gather Your Connection Details:
From the SSH Access page (or your hosting account info), note down:
- Hostname or IP address of your server
- Port number (default is 22, but your host may use a custom port)
- Username (usually your cPanel username)
Step 7: Connect Using SSH:
For Windows (PuTTY):
- Open PuTTY.
- Enter the hostname/IP and Port.
- Go to Connection → SSH → Auth, and browse to select your private key file (you may need to convert it to
.ppkformat using PuTTYgen first). - Click Open to start the connection.
- Enter your username when prompted.
For macOS/Linux (Terminal):
- Open Terminal.
- Type the following command, replacing the placeholders with your actual details: ssh username@hostname -p port_number
- Press Enter.
- If using a private key, specify its path: ssh -i /path/to/private_key username@hostname -p port_number
Step 8: Authenticate:
- If prompted, enter your key passphrase (the one you set in Step 2).
- Once authenticated, you'll see a command-line prompt—this confirms you are now connected to your server.
Step 9: Start Using SSH:
Now you can run commands directly on your server, for example:
ls– list files in the current directorycd foldername– move into a folderpwd– show your current directory pathchmod 755 filename– change file permissionsnano filename– edit a file directly in the terminal
Step 10: Disconnect Safely:
When you're done, simply type
exit
Enter to close the SSH session safely.