SSH access must be enabled for your hosting account (excluding VPS and Dedicated Server) to connect to SSH/SFTP. Contact support to enable SSH access.
Note:
Commands run via SSH can irreparably damage your data, websites, hosting account, and/or server. We strongly recommend that only users with command-line experience use SSH.
Step 1: Generate Public and Private Keys in MacOS
- Run the Terminal app and execute the following command:
ssh-keygen -t rsa
- It will ask you to save your keys to /home/user/.ssh/id_rsa. Press Enter.
- It will ask for a passphrase. Leave it empty.
Press Enter, and then press Enter again.
The key should now have been generated. - Execute the following command to view the public key:
cat ~/.ssh/id_rsa.pub
Copy the public key. - Done!
Step 2: Authorize the Public Key
To connect to SSH or SFTP, you must authorize your public key.
How to authorize your public key in cPanel and DirectAdmin?
Step 3: Connect to SSH in MacOS
- Run the Terminal 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. - It may ask you to confirm this operation.
Type "yes" without the quotation marks and press Enter. - Done!
Terminal in cPanel/WHM
You can access SSH from cPanel/WHM using your browser without a key pair.
cPanel: Go to cPanel > Advanced > Terminal.
WHM: Go to WHM > Server Configuration > Terminal (requires VPS/Dedicated Server with root access).