How to Access the Command Line
Last modified: November 27, 2024
Overview
While cPanel & WHM automates many server administration tasks, familiarity with the Linux command line interface (CLI) can prove useful for both WHM and cPanel users. This documentation describes how to access the CLI.
- cPanel & WHM requires the
root
user to use Bash by default. System administrators can modify the shell program and command language for other users. - You can use cPanel’s Terminal interface (cPanel » Home » Advanced » Terminal) or WHM’s Terminal interface (WHM » Home » Advanced » Terminal) to access the command line from within the interface.
Access the command line interface
You can access the CLI through any of the following methods:
Operating system | CLI application name | Access steps |
---|---|---|
Microsoft Windows® | Command Prompt | In Windows, click Start and enter Command Prompt in the Search text box. Double-click Command Prompt in the list that appears. |
macOS® | Terminal | Click the Applications icon in your macOS dock, then click the Utilities icon. Click the Terminal icon that appears. |
Ubuntu® | Terminal | Press the Ctrl , Alt , and T keys at the same time. |
You can also use cPanel’s Terminal interface (cPanel » Home » Advanced » Terminal) or WHM’s Terminal interface (WHM » Home » Advanced » Terminal) to access a CLI application within cPanel & WHM.
Connect to cPanel & WHM with the CLI
Your CLI application opens with access to the local computer. You must use SSH to access the cPanel & WHM server. To do this, enter the following command in your CLI and press Enter
to run it:
ssh username@hostname
In this command, username
is your account’s username and hostname
is the server’s hostname. For example, to log in as the root
user on the example.com
server, run the following command:
Then, the CLI will prompt you for the account’s password. Enter it and press Enter
to connect.
Verify your successful connection
When you have successfully connected to your cPanel & WHM server, the CLI’s output will appear similar to the following example:
|
|
This output means that you can now navigate the server’s file system and run commands.
Limitations
The commands you can run could be limited by your account’s permissions and privileges. For example, if you receive an error message that appears similar to the following example, your hosting administrator may not have enabled SSH privileges for your account:
Last login: Tue Nov 26 19:44:18 2024 from 10.3.5.236
Shell access is not enabled on your account!
If you need shell access please contact support.
Connection to IPADDRESS closed.
Because command line access (shell access) has certain security implications, many hosting providers restrict it. Contact your hosting provider or system administrator for more information.