This interface provides information about how to connect to another web server via the SSH (secure shell) network protocol.
The SSH network protocol allows you to connect to another web server over the internet via a command line interface (CLI). You can use this network protocol to remotely manage your server, configure CGI scripts, and perform other tasks.
Many modern operating systems, such as macOS® and Linux® distributions, include SSH. If you use Microsoft Windows® to connect to your server, you must use an SSH client, such as PuTTY, to log in to your server.
Many Unix-based operating systems include standardized commands. For a list of standardized Unix-based (POSIX) commands, read the GNU Coreutils documentation.
Note
Not all hosting providers allow shell access.
Connect to your server via SSH
PuTTY
To use PuTTY to connect to your server via SSH, perform the following steps:
.3In the Session interface, enter the hostname or IP address of the server in the Host Name (or IP address) text box (for example, 192.0.2.0).
.4Enter the port number in the Port text box (for example, 22).
.5Select the SSH protocol.
.6Click Open.
.7Enter your cPanel account’s username.
.8Enter your cPanel account’s password.
PuTTY and a private key
To log in to a server via SSH with PuTTY and a public key, perform the following steps:
.1From the Windows Start menu, open the client.
.2Navigate to the PuTTY Key Generator interface.
.3Under the Actions heading, click Generate. PuTTY will generate the key and display the result under the Key menu.
.4Copy the public key and paste it in the .ssh/authorized_keys file.
.5Enter a passphrase in the Key passphrase and Confirm passphrase text boxes.
.6Click Save private key and save the key as a .ppk file.
.7In the Session interface, from the Saved Sessions menu, select your preferred authorization session and click Load.
.8Navigate to the Auth interface under the SSH category.
.9Click Browse, select the private key file to upload, and click Open.
.10Navigate to cPanel’s Manage SSH Keys interface (Home » Security » SSH Access » Manage SSH Keys) and import the server’s keys.
macOS or Linux
Log in with a Password
To log in to your server with a password via SSH using macOS or Linux, perform the following steps:
.1Open a Terminal session.
.2Run the following command: ssh -p port user@IP where port represents the port number, user represents your username, and IP represents your IP address. For example:
user@workstation:~$ ssh-p22 user@192.0.2.0
.3Enter your password.
The password login process is similar to the following example:
user@workstation:~$ ssh-p22 user@192.0.2.0
user@192.0.2.0's password:
Last login: Wed Dec 9 08:31:49 2020 from 192.0.3.33
[user@server.example.com ~]#
Log in with a SSH Key
To log in to your server with a password via SSH using macOS or Linux, perform the following steps:
.1Open a Terminal session.
.2Run the following command: ssh -p port -i ssh-key user@IP where port represents the port number, ssh-key represents the file path to your SSH key, user represents your username, and IP represents your IP address. For example:
Last login: Tue Dec 813:54:10 2020 from 192.0.3.33
[user@server.example.com ~]#
Manage SSH keys
This section of cPanel’s SSH Access interface allows you to create, import, manage, and remove SSH keys. The system will use these keys when you confirm that a specific computer has the right to access your website’s information with SSH.
Generate a New Key
Use this section of the interface to create new SSH key pairs, which include a public key and a private key.
To generate a new SSH key pair, perform the following steps:
.1Click Manage SSH Keys.
.2Click Generate a New Key.
.3To use a custom key name, enter the key name in the Key Name (This value defaults to id_rsa): text box.
NoteIf you use a custom key name, you must manually specify the SSH key when you log in to the server.
.4Enter and confirm the new password in the appropriate text boxes.
Note
This step is optional if your hosting provider sets the SSH Keys setting to 0 in WHM’s Password Strength Configuration interface (WHM » Home » Security Center » Password Strength Configuration).
The system evaluates the password that you enter on a scale of 100 points. 0 indicates a weak password, while 100 indicates a very secure password.
Some web hosts require a minimum password strength. A green password Strength meter indicates that the password is equal to or greater than the required password strength.
Click Password Generator to generate a strong password. For more information, read our Password & Security documentation.
.5Select the desired key type.
DSA keys provide quicker key generation and signing times.
RSA keys provide quicker verification times.
.6Select the desired key size.
NoteGreater key sizes provide more security, but they result in larger file sizes and slower authentication times.
.7Click Generate Key. The interface will display the saved location of the key.
ImportantFor the new SSH key to function, you must authorize the SSH key. For more information, read the Manage your keys section.
Import Key
To import an existing SSH key, perform the following steps:
.1Click Manage SSH Keys.
.2Click Import Key.
.3To use a custom key name, enter the key name in the Choose a name for this key (defaults to id_dsa) text box.
ImportantIf you use a custom key name, you must manually specify the SSH key when you log in to the server.
.4Paste the public and private keys into the appropriate text boxes.
.5Click Import.
Manage your keys
The Public Keys and Private Keys tables display the following information about your existing keys:
Name — The key’s name. Public and private keys use the same key name.
Authorization Status — Whether you authorized the key.
ImportantYou must authorize new keys before you attempt to use them.
NoteThis column only displays in the Public Keys table.
Actions — You can perform the following actions:
Delete Key — Click to delete the key, and then click Yes to confirm that you wish to delete the key.
View/Download — Click to view or download the key. To download the key, save the contents of the Public SSH Key text box to your computer.
Manage — Click to manage authorization for the key. A new interface will appear. Click Authorize to authorize the key, or Deauthorize to revoke authorization for the key.
Note
You can only perform this action for public keys.
After you deauthorize a key, that key’s users cannot log in with the associated private key.