How to Access the Command Line

Last modified: December 6, 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.
  • cPanel account users can use cPanel’s Terminal interface (cPanel » Home » Advanced » Terminal) to access the command line from within the interface.
  • The root user and WHM Reseller account users can use WHM’s Terminal interface (WHM » Home » Advanced » Terminal) to access the command line from within the interface.
    • For WHM reseller accounts, you hosting provider can enable or disable this interface for resellers in WHM’s Edit Reseller Nameservers and Privileges interface (WHM » Home » Resellers » Edit Reseller Nameservers and Privileges).

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.
Remember:
  • cPanel account users can use cPanel’s Terminal interface (cPanel » Home » Advanced » Terminal) to access the command line from within the interface.
  • The root user and WHM reseller account users can use WHM’s Terminal interface (WHM » Home » Advanced » Terminal) to access the command line from within the interface.
    • For WHM reseller accounts, you hosting provider can enable or disable this interface for resellers in WHM’s Edit Reseller Nameservers and Privileges interface (WHM » Home » Resellers » Edit Reseller Nameservers and Privileges).

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:

1
2
Last login: Fri Feb  6 12:52:33 2015 from 10.1.4.202
username@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 provider 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 for more information.

Additional Documentation