Skip to Content

Failed to Connect to IP: Permission Denied cPanel / WHM login

Unable to login into Cpanel/WHM. Getting the error Failed to Connect to IP: Permission Denied


Synopsis: This article describes steps to resolve the "Unable to login into cPanel/WHM: Failed to Connect to IP: Permission Denied" error by checking php.ini for restrictions, and ensuring SELinux is disabled.


Step 1: Check php.ini Restrictions:

  • Ensure there are no restrictions set in the php.ini file that could prevent connections to the server. Specifically, look for settings related to network connections or IP restrictions that might be impacting cPanel/WHM access.

Step 2: Ensure SELinux is Disabled (Check SELinux Status on Both Servers)

  • SELinux can sometimes cause issues with cPanel/WHM access. It is advisable to disable it on both the gateway server and the remote servers.
  • To check the status of SELinux, use the following command.

:~# sestatus

SELinux status:                 disabled

2 a. Disable SELinux if Necessary

  • If SELinux is not disabled, you can disable it by editing the configuration file.
  • Open the SELinux configuration file using a text editor.

:~# nano /etc/selinux/config

  • Set SELINUX=disabled in the configuration file:

SELINUX=disabled

  • Save the file and reboot the server to apply the changes and check by running the "sestatus" command again. It should return as 'disabled'. 

Step 3: Test Login Again:

  • Attempt to log in to cPanel/WHM again after completing the above steps.
  • Monitor for any error messages or logs that may indicate ongoing issues with connectivity or permissions.

Related Articles:

Error logs and configuration files.

Unable to log in to CPanel with a single click.

ERROR: Token not found.

Add your CPanel as WebPortal.