Ping command allow to cPanel user

Operating System & Version
CloudLinux 7.9.0
cPanel & WHM Version
100.0.11

Tarak Nath

Well-Known Member
Mar 12, 2018
104
14
18
India
cPanel Access Level
Root Administrator
Hello,

cPanel user unable to run ping command, below is the error:

Code:
ping: socket: Operation not permitted
Said user is under normal shell ( /bin/bash )

How we can enable/allow the said user to run ping command ?

It will be great help if you please suggest me.

Thanks
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
10,360
1,628
363
cPanel Access Level
Root Administrator
Hey there! I just created a test user with normal shell on an AlmaLinux 8 system, and that user has access to ping by default. Here is the path I see for that user:

Code:
[[email protected] ~]$ echo $PATH
/usr/local/cpanel/3rdparty/lib/path-bin:/usr/share/Modules/bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/cpanel/composer/bin:/home/username/bin
ping is located in /usr/bin/ping on this machine, which is in the $PATH. Can you check the $PATH variable for your particular user and see if that may be the issue?
 

quietFinn

Well-Known Member
Feb 4, 2006
1,652
325
438
Finland
cPanel Access Level
Root Administrator
I think it's CloudLinux preventing cPanel users from using ping. :rolleyes:
 

Tarak Nath

Well-Known Member
Mar 12, 2018
104
14
18
India
cPanel Access Level
Root Administrator
Thank you all for the response.

Here is the path I see for that user:

Code:
[email protected] [~]# echo $PATH
/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/jdk/bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/lib64/qt-3.3/bin:/home/cpaneluser/perl5/bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/jdk/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin:/opt/bin:/opt/cpanel/composer/bin:/usr/local/easy/bin:/usr/local/bin:/usr/X11R6/bin:/usr/local/puppet/sbin:/usr/local/puppet/bin:/home/cpaneluser/.local/bin:/home/cpaneluser/bin
How about potential firewall rules blocking ICMP?
Please find the attached screenshot for the status.

Thanks
 

Attachments

Tarak Nath

Well-Known Member
Mar 12, 2018
104
14
18
India
cPanel Access Level
Root Administrator
Are there any external firewalls managed by your host? That local configuration looks good, but there could be something blocking this at a higher level that you don't have access to.
It's not possible for us to say whether there is any external firewalls or not. We have access of our server only. However we have contacted with our server provider and their response mentioned below:

By default only users with root privilege's can run this command. The only way for a regular cpanel user to be able to do that is to elevate them to root permissions. You have to give them root privilege's. This is by design for security reasons by cpanel.
 

quietFinn

Well-Known Member
Feb 4, 2006
1,652
325
438
Finland
cPanel Access Level
Root Administrator
I was testing this in a few servers with and without CloudLinux, and if I try to ping as cPanel user I get:
ping: socket: Operation not permitted

Then I created cPanel account in Ubuntu server, Solo License so it's the only account, and ping works.
 
  • Like
Reactions: Tarak Nath

quietFinn

Well-Known Member
Feb 4, 2006
1,652
325
438
Finland
cPanel Access Level
Root Administrator

Tarak Nath

Well-Known Member
Mar 12, 2018
104
14
18
India
cPanel Access Level
Root Administrator
Update for those are interested in this issue. Here is the cPanel support team said:

After some additional investigation into your reported issue, this request will be best reviewed by the CloudLinux staff.

I created a linux user outside of WHM and su'd into that account. That account, which is not managed by cPanel, also encountered the Operation not permitted message. This indicates that the problem is not caused by CageFS or cPanel.
Currently we are communicating with the ClouldLinux support team.
 

Tarak Nath

Well-Known Member
Mar 12, 2018
104
14
18
India
cPanel Access Level
Root Administrator
They have resolved the issue within a minute. Final update from CloudLinux support team:

The issue was related to incorrect permissions of the ping command.

We have resolved the problem by executing
Code:
# chmod +s /bin/ping
 

quietFinn

Well-Known Member
Feb 4, 2006
1,652
325
438
Finland
cPanel Access Level
Root Administrator
  • Like
Reactions: Tarak Nath