How to Enable Terminal in cPanel through WHM

Written by Software Engineer

December 16, 2024
How to Enable Terminal in cPanel through WHM

Having access to the terminal in cPanel is like having a direct line to the heart of your system. It can be a game-changer for anyone managing websites, offering direct control over the server environment and advanced troubleshooting capabilities.

However, terminal access isn't always enabled by default, especially if you're using WHM (Web Host Manager) to manage multiple accounts.

This guide walks you through the simple steps to enable terminal access in cPanel through WHM. Whether you're a developer looking for more flexibility or just need to execute commands directly on the server, this guide has you covered.

Understanding cPanel and WHM


cPanel and WHM are two essential tools for managing web hosting environments, working together to streamline the process. While cPanel focuses on individual website management, WHM offers higher-level control over the entire server and all its hosted accounts.

What is cPanel?

cPanel is a user-friendly web hosting control panel that simplifies managing a website. Its graphical interface makes it easy for users, even without technical experience, to handle tasks such as:

Due to its user-friendly interface and robust functionality, cPanel is widely adopted by web hosting providers to help website owners efficiently control their hosting accounts.

What is WHM?

WHM is a powerful administrative tool used by web hosting providers and resellers to manage multiple cPanel accounts.

It operates at a higher level than cPanel, offering greater control over server settings, configurations, and user management. While cPanel is focused on individual website management, WHM manages the server environment and all its cPanel accounts.

20%

💸 EXTRA 20% OFF ALL VERPEX RESELLER HOSTING PLANS

with the discount code

AWESOME

Save Now

Why Enable Terminal in cPanel?


Enabling the terminal in cPanel offers several advantages, particularly for users who need more advanced control over their hosting environment. Here’s why it is a game-changer:

1. Direct Server Access

Normally, when managing a server, you would need an SSH client like PuTTY or a terminal app to access the command line interface (CLI).

By enabling the terminal within cPanel, you can skip the need for external tools and directly access the server from any browser. This is particularly useful if you:

  • Don’t want to deal with SSH key configuration.

  • Need quick access to the command line without installing extra software.

This seamless access allows you to execute commands and manage the server more efficiently.

2. Advanced Troubleshooting

Certain server issues are best dealt with through the command line. If you’re facing downtime or a specific service is malfunctioning, using the terminal within cPanel allows you to:

  • Monitor system logs in real-time(e.g., /var/log), which is essential for identifying the root cause of issues.

  • Track resource usage with commands like top or htop to identify any performance bottlenecks.

  • Restart services (e.g., systemctl restart apache2, ), quickly without needing a full server reboot.

Having terminal access allows you to react faster and fix problems that might not be addressable through cPanel’s graphical interface.

3. Enhanced Security and Custom Scripts

Some users prefer to run custom security scripts, automated backups, or other system maintenance tasks. Enabling the terminal allows users to:

  • Set up and manage firewall rules or adjust security settings.

  • Run custom scripts (e.g., shell scripts) to automate repetitive tasks.

  • Perform tasks that require elevated privileges more securely (if needed) within the server environment.

While cPanel’s GUI is convenient, it doesn’t offer the same level of control for customizations or security measures.

4. Time Efficiency

Terminal access can significantly boost your productivity if you're comfortable with the command line. Tasks such as installing software, moving large files, and changing permissions across directories can often be done more quickly via the terminal than through cPanel’s file manager or other GUI tools, saving you valuable time.

Prerequisites


Before you can enable terminal access in cPanel through WHM, ensure you meet the following requirements:

  1. You must have administrative access to WHM to manage and enable features for cPanel accounts. Make sure you have the appropriate login credentials.

  2. Have root or sufficient reseller permissions in WHM to make changes to account features, including enabling terminal access.

  3. Have at least one cPanel account created under WHM for which you want to enable terminal access.

Step-by-Step Process for Enabling Terminal Access in cPanel from WHM


Step 1: Log in to WHM

1. Access the WHM login page: Open your web browser and navigate to your server’s WHM login URL. This usually looks something like https://yourdomain.com:2087.

2. Enter your WHM credential: Use your root or reseller credentials to log in.

Step 2: Locate the Terminal Feature in WHM

Here are two options you can use to access the terminal feature in WHM, and you can choose whichever method you prefer:

1. Using the WHM search bar: After logging in to WHM, the quickest way to find terminal-related settings is to use the search bar on the left side. Type "Manage Shell Access" or "Shell" into the search bar, and relevant options will appear. Click on Manage Shell Access from the list.

2. Navigating manually through the WHM menu: If you prefer navigating manually, follow these steps:

  • Scroll down the left-hand menu on the WHM dashboard.

  • Expand the Account Functions section.

  • Click on Manage Shell Access.

Both methods will take you to the page where you can enable terminal access for individual cPanel accounts.

Step 3: Enable Terminal Access for a cPanel Account

1. Select the cPanel account: In the Manage Shell Access section, you will see a list of cPanel accounts associated with your WHM. Find the account for which you want to enable terminal access.

Manage Shell Access

2. Enable Shell access (Jailed or Normal): You will have two options for enabling shell access:

  • Jailed Shell: Provides a limited, secure environment with restricted access to sensitive server parts.

  • Normal Shell: Provides unrestricted SSH access (typically for advanced users).

For most users, enabling Jailed Shell is recommended for security reasons.

Note: If you need to enable shell access for multiple cPanel accounts at once, you can use the bulk action feature. At the top of the page, you can click the Apply to all button that suits your needs, and the changes will be applied to all cPanel accounts with a single action. This is particularly useful for resellers or admins managing multiple accounts.

After selecting the shell access option, changes will be saved automatically. A green check mark will appear beside the column, indicating the settings have been successfully saved.

Step 4: Testing Terminal Access in cPanel

1. Log in to cPanel: Log in to the cPanel account where you’ve enabled terminal access. You can access cPanel by navigating to https://yourdomain.com:2083 and entering your cPanel credentials.

2. Navigate to the Terminal section: Once logged in, scroll down to the Advanced section in the cPanel dashboard and click Terminal. If the terminal feature is enabled, you should see it here.

Note: You’ll get a warning if you access the Terminal option for the first time. Click, I understand and want to proceed.

Testing Terminal Access

3. Test terminal access: Open the terminal window and test it by running a basic command like ls (to list directory contents) or whoami (to check the logged-in user). If the command executes successfully, it confirms that terminal access is working properly.

Hooray! You did it. You can now run commands, execute server tags, and perform various operations from the terminal interface.

Step 5: Troubleshooting (optional)

If the terminal feature is not available in cPanel or doesn't function as expected, consider these troubleshooting steps:

1. Verify Shell access in WHM: Go back to the Manage Shell Access section in WHM and ensure that the shell access for the cPanel account is enabled, either as "Jailed Shell" or "Normal Shell."

2. Check SSH configuration on the server: Ensure that SSH is properly enabled on the server. Although the terminal in cPanel uses a web-based interface, it still relies on the server's SSH configuration.

3. Review cPanel permissions: Confirm that the cPanel account has the necessary permissions. The terminal may not appear or function correctly if the account lacks proper permissions.

Security Considerations


Enabling terminal access in cPanel provides powerful control over your server, but it also introduces potential security risks. To protect your server and data, it's important to follow these best practices:

1. Use Jailed Shell for most users: Jailed Shell restricts users to a limited environment, preventing access to sensitive server parts. This adds an extra layer of security while still allowing users to execute essential commands. Unless absolutely necessary, avoid giving Normal Shell access, which grants unrestricted access to the server.

2. Limit terminal access to trusted users: Only provide terminal access to users who absolutely need it and are familiar with SSH or command-line operations. The fewer users with this level of access, the lower the risk of accidental or malicious server actions.

3. Use SSH keys instead of passwords: If possible, configure SSH to require SSH keys instead of just passwords. SSH keys provide a more secure authentication method and significantly reduce the risk of brute-force attacks. While the cPanel terminal interface is secure, using SSH keys adds an extra layer of protection.

4. Monitor user activity: Regularly review server logs to monitor terminal activity. This allows you to keep an eye on suspicious actions or misuse of the terminal feature. Monitoring system logs (e.g., /var/log/secure) helps identify any unusual login attempts or unauthorized command execution.

5. Disable terminal access when not needed: If terminal access is only needed temporarily, disable it as soon as the task is complete. This prevents unnecessary access and reduces your server's attack surface.

6. Set proper file permissions: Make sure that critical system files and directories have the correct permissions to prevent users with terminal access from modifying or accessing sensitive information.

7. Keep software updated: Always ensure that your server’s operating system, cPanel, and WHM are up-to-date. Security patches are released regularly to fix vulnerabilities, and failing to apply updates can leave your server exposed.

By following these security practices, you can enable terminal access in cPanel while maintaining the safety and integrity of your server.

90%

💰 90% OFF YOUR FIRST MONTH WITH ALL VERPEX RESELLER HOSTING PLANS

with the discount code

MOVEME

Use Code Now

Conclusion


Enabling terminal access in cPanel through WHM is an essential task for administrators who need to provide users with greater control over their hosting environment.

By following the steps outlined in this guide, you can quickly enable terminal access for cPanel accounts, allowing users to manage their files and services through the command line.

As always, consider the security implications of enabling terminal access. Restrict access to trusted users, and consider using SSH keys for additional security.

This will help ensure that your server remains protected while still offering the flexibility of terminal access.

Frequently Asked Questions

What is cPanel?

cPanel is one of the most popular control panels on the market. cPanel allows its users to manage their hosting accounts incredibly easily. You can control and oversee domain extensions, email accounts, and if you want to, you can install new applications.

Is cPanel good for hosting?

Yes, cPanel is excellent for hosting as it provides a user-friendly interface, powerful tools, and reliable support, making website management straightforward for most users.

It's especially popular among web hosting companies for its ease of use and wide range of features that cater to both beginners and experienced users.

How does cPanel pricing work?

In most cases, you’ll be paying for the number of licenses you need for users. However, at Verpex, the number of cPanel accounts depends on your hosting package, ranging between one and 100. Plus, it works out cheaper to pay via a hosting plan than paying separately for licenses.

Is cPanel free or paid for?

cPanel is a paid software. Hosting providers typically include the cost in their hosting plans, but if you’re managing your own server, you’ll need to purchase a cPanel license.

Jivo Live Chat