You need to use key-based authentication in your SSH/SFTP client (the software you are using to connect, e.g., Putty or FileZilla) to connect to SSH/SFTP. Contact us to enable SSH for your hosting account (not needed for VPS and Dedicated Server), and then follow this guide.
Note:
Commands run via SSH can cause irrecoverable damage to your server or hosting account. We strongly recommend that only users with prior experience use SSH.
Step 1: Generate Public and Private Keys in Windows
- Install "OpenSSH Client" from Start Menu > Apps & Features > Optional Features> Add a feature.
No need to install if "OpenSSH Client" is already installed in "Optional Features". - Run the "Command Prompt" (open the Start Menu and type "cmd") app and execute the following command:
ssh-keygen -t rsa
- It will ask you to save your keys to C:\Users\username/.ssh/
id_rsa
. Press Enter. - It will ask for a passphrase. Leave it empty.
Press Enter, and then press Enter again. - Execute the following command to view the public key:
type .ssh\id_rsa.pub
Copy the public key (select the text and right-click to copy or press Shift + Enter). - Done!
Step 2: Authorize the Public Key
You need to authorize your public key to connect to SSH or SFTP.
How to authorize your public key in cPanel and DirectAdmin?
Step 3: Connect to SSH Using Command Prompt in Windows
- Run the "Command Prompt" (open the Start Menu and type "cmd") app and execute the following command:
ssh -p 2022 username@server.example.com
*Replaceusername
with your cPanel/DirectAdmin username.
*Replaceusername
withroot
if you are connecting to a VPS/Dedicated Server as theroot
user.
*Replaceserver.example.com
with your server hostname or IP address. - Type in
yes
and pressEnter
if it asks, "Are you sure you want to continue connecting?". - Done!
Terminal in cPanel/WHM
cPanel and WHM allow using SSH without the need for a key pair:
cPanel: Go to cPanel > Advanced > Terminal
WHM (VPS/Dedicated Server with root access): Go to WHM > Server Configuration > Terminal.