If you encounter an error message saying "Error: The WebSocket handshake failed" while attempting to use the Terminal feature in cPanel, it is possible that this issue arises when accessing cPanel through a proxy sub-domain, such as https://cpanel.yourdomain.com.
To resolve this problem, we recommend trying the following alternative links to access the cPanel Terminal:
- https://$ipaddress:2083
- https://$domain.tld/cpanel
- https://cpanel.$domain.tld
If none of these links work, consider disconnecting from any proxies or VPNs you may be using and attempt accessing cPanel with different web browsers.
Furthermore, if the server has Imunify360 installed, access the Imunify360 console from the root directory. Navigate to "Settings" and deselect the option for "cPanel account protection," as illustrated in the accompanying screenshot.
In addition to the previously mentioned solutions, there is another potential reason for this issue. If you are running CloudLinux, it's possible that the /bin/cagefs_enter.proxied file no longer has the setuid bit set. To verify this, you can use the following command:
[root@server97 ~]# stat /bin/cagefs_enter.proxied
File: /bin/cagefs_enter.proxied
Size: 16856 Blocks: 40 IO Block: 4096 regular file
Device: 10303h/66307d Inode: 32382934 Links: 1
Access: (0755/-rwsr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2023-07-09 19:16:29.260835027 +0600
Modify: 2023-02-27 19:58:50.000000000 +0600
Change: 2023-07-08 12:36:32.411856717 +0600
Birth: 2023-06-06 18:41:08.513066271 +0600
[root@server97 ~]#
The permissions should be 4755. CloudLinux is aware of this issue and is tracking it under the reference CAG-1082. The solution is to run the following command:
chmod u+s /bin/cagefs_enter.proxied
By executing this command, the setuid bit will be set, resolving the issue and allowing the Terminal to function properly again.