Cloud Service >> Knowledgebase >> cPanel >> How to Access the Web Server Command Line Through cPanel?
submit query

Cut Hosting Costs! Submit Query Today!

How to Access the Web Server Command Line Through cPanel?

Accessing the web server command line through cPanel is typically done using the Terminal feature or via SSH (Secure Shell). Here's how you can access the command line through cPanel:

Method 1: Accessing the Command Line via cPanel Terminal

cPanel provides a built-in terminal feature that allows you to access the command line directly from the cPanel interface.

Steps to Access the Terminal in cPanel:

1. Log in to cPanel

Open your web browser and go to your cPanel login page (https://yourdomain.com/cpanel or https://cpanel.yourdomain.com).

Enter your username and password to log in to your cPanel dashboard.

2. Find the Terminal Feature

In the cPanel dashboard, scroll down to the Advanced section.

Click on Terminal.

3. Access the Command Line

A warning message might appear, informing you about the potential risks of using the command line.

Click Proceed or I Understand to continue.

The terminal interface will open, giving you direct access to the server's command line.

4. Use the Command Line

You can now enter commands directly into the terminal just as you would in any other command-line interface (CLI).

Method 2: Accessing the Command Line via SSH (Secure Shell)

If the terminal feature is not available in your cPanel, or if you prefer using an external SSH client, you can access the server via SSH.

Steps to Access the Command Line via SSH:

1. Enable SSH Access

SSH access may need to be enabled by your cloud hosting provider or within cPanel.

Some hosting providers disable SSH by default, so you may need to contact them to enable it.

2. Obtain SSH Credentials

You’ll need the following information to connect via SSH:

Hostname or IP address of your server.

SSH port number (usually 22 by default).

Username and password (usually the same as your cPanel login).

3. Use an SSH Client

If you're on Windows, you can use an SSH client like PuTTY.

On macOS and Linux, you can use the built-in terminal.

4. Connect via SSH

Open your SSH client and enter the hostname or IP address, port number, and your credentials.

For example, in a terminal on macOS or Linux, you can connect by typing:
bash
Copy code
ssh [email protected]

Replace username with your actual cPanel username and yourdomain.com with your domain name or server IP address.

5. Enter Commands

After connecting, you’ll have access to the server’s command line and can start entering commands.

Security Considerations:

Strong Passwords: Ensure your SSH password is strong and secure.

Use SSH Keys: For added security, consider setting up SSH keys instead of using passwords.

Monitor Access: Regularly monitor who has SSH access to your server and revoke access if necessary.

Troubleshooting:

Connection Refused: If you get a "Connection refused" error when trying to connect via SSH, it could be due to SSH being disabled on your server. Contact your hosting provider to resolve this.

Permission Denied: Ensure that your user has the appropriate permissions to access the command line via SSH.

By following these steps, you can access the command line through cPanel using either the built-in terminal or via SSH. This allows you to manage your server more effectively, perform advanced tasks, and troubleshoot issues directly from the command line.

Cut Hosting Costs! Submit Query Today!

Grow With Us

Let’s talk about the future, and make it happen!