This article covers how to SSH into your VPS or Dedicated server, using either PuTTY or a Terminal. Access to Root WHM will be needed to whitelist the IP address for the connecting device in the server firewall. This will allow an SSH connection to be established.
Related Articles
Change Root Password in Root WHM
Change Root Password in AMP
Change cPanel Password Using WHM
Generate SSH Keys
- Log into cPanel
- Navigate to SSH Access, located under the Security section
- Click the Manage SSH Keys button
- Click the Generate a New Key button
- Fill in the details for the new key then click the Generate Key button
- The Key Name field can be left as the default value of id_rsa unless you wish to change it
- Enter a strong password in the Password field or use the Password Generator button to create a random password, then enter the same password in the Password (Again) field
- RSA is the recommended option for Key Type
- Key Size should be 2048 or 4096; 1024 is not recommended
NOTE: Larger key sizes are more secure, but they result in larger file sizes and slower authentication times.
- Once generated, click Go Back
- Click Manage beside the newly created key under the Public Keys section
- Click the Authorize button
- Click Go Back
- Click View/Download beside the newly created key under the Private Keys section
- If connecting using PuTTY
- Enter the password created in step 5 in the Convert the id_rsa key to PPK format: section then click the Convert button
- Enter the password created in step 5 in the Convert the id_rsa key to PPK format: section then click the Convert button
- Click the Download Key button
Connect Using Terminal
-
Whitelist IP in the firewall configuration
IMPORTANT: Depending on the server the Firewall may either be APF or CSF.
NOTE: Adding IP to the firewall only needs done one time unless accessing the account from another location which means having a different IP. - Using Linux, Mac, or Windows terminals, enter the following
ssh userna5@domain.com -p 22 -i /path/to/id_rsa
REPLACE: userna5 with the cPanel username, domain.com with the associated domain on the account, and /path/to/id_rsa with the path to the private key that was downloaded in the first section.
NOTE: The example above uses '22' to signify port 22 which is the standard SSH port. If modification of the port being used for SSH has been made on the server you will need to replace the value with the corresponding port number in use for SSH.
EXAMPLE: to connect as the root user for the server where domain.com is hosted, enterssh root@domain.com -p 22 -i /home/user/downloads/id_rsa
IMPORTANT: If an errorLoad key "/path/to/id_rsa": bad permissions
occurs, run the following command to update the file's permissionschmod 400 /path/to/id_rsa
. Be sure to use the actual path to the id_rsa file.- Enter the appropriate cPanel or root password when prompted
Connect Using PuTTY
-
Whitelist IP in the firewall configuration
IMPORTANT: Depending on the server the Firewall may either be APF or CSF.
NOTE: Adding IP to the firewall only needs done one time unless accessing the account from another location which means having a different IP. - In PuTTY, navigate to SSH, then Auth
- Click Browse under Private key file for authentication
- Navigate to the private key file downloaded in the previous section and click Open
- Return to the Session page and enter the following details
-
Host name you will enter the IP address associated with your account or the server hostname
TIP: You can find your IP address under General Information on the home page of your cPanel. - Port should be 22
-
Host name you will enter the IP address associated with your account or the server hostname
- Click the Open button
NOTE: If a PuTTY Security Alert message pops up, click Yes. - Enter your cPanel username at the login as: prompt and press the Enter key
- Enter the password you set when you created the SSH key in the previous section and press the Enter key
NOTE: Nothing will be displayed when the password is typed. This is normal behavior.
Comments
0 comments
Article is closed for comments.