Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
stylenone

Overview

While cPanel & WHM automates many server administration tasks, familiarity with the Linux command line can prove useful for both WHM and cPanel users. This documentation describes how to access the command line.

Note
titleNote:
  • cPanel & WHM requires the root user to use BASH by default. System administrators can modify the shell for other users. 
  • In cPanel & WHM version 72 and later, 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

To access your cPanel & WHM server from the command line, perform the following steps:

  1. Use the correct method for your computer's operating system to open the command line interface (CLI):
    • Microsoft Windows® — Open the Command Prompt program. To do this, click Start and enter Command Prompt in the Search text box. Double-click Command Prompt in the list that appears.
    • MacOS® — Open the Terminal program. To do this, click the Applications icon in the dock, click the Utilities icon, and then click the Terminal icon.
    • Ubuntu — Open the Terminal program. To do this, press the Ctrl+Alt+T keys.

  2. Your CLI program opens with access to the local computer. You must use SSH to access the cPanel & WHM server. To do this, enter the following command and press Enter:

    Code Block
    languagebash
    ssh username@hostname

    In this comment, 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:

    Code Block
    languagebash
    ssh root@example.com


  3. The CLI prompts you for the account's password. Enter it and press Enter.
  4. The CLI's display will appear similar to the following example.

    Code Block
    languagebash
    linenumberstrue
    Last login: Fri Feb  6 12:50:38 on ttys000
    MyComputer:~ myname$ ssh username@example.com
    Password: 
    Last login: Fri Feb  6 12:52:33 2015 from 10.1.4.202
    username@example [~]# 

    You can now navigate the server's file system and run commands, within the limits of your account's permissions on the server.

     

Note
titleNote:

If you receive an error message that appears similar to the following example, you may not have SSH privileges enabled on the server.

Code Block
languagebash
ssh: connect to host example.com port 22: Connection refused 

Contact your hosting provider or system administrator for more information. Because command line access (shell access) has certain security implications, many web hosting providers restrict this access.


Additional documentation

Localtab Group


Localtab
activetrue
titleSuggested documentation

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel in ("whm","cpanel") and label in ("ssh","login") and space = currentSpace()


Localtab
titleFor cPanel users

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel = "cpanel" and label in ("ssh","login") and space.type = "global"


Localtab
titleFor WHM users

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel in ("cpanel","whm") and label in ("ssh","login") and space in (currentSpace(),"ALD")


Localtab
titleFor developers

Content by Label
showLabelsfalse
max5
showSpacefalse
cqllabel in ("ssh","login") and space = "DD"