LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-03-2022, 06:13 PM   #1
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 924

Rep: Reputation: 61
Talking How can I grant access to Apache/PHP to use the nping -icmp command without putting the www user into the sudo group?


Is it even possible?

What I want is to give PHP the ability to quickly ping it's own subnet to look for devices that may have gone offline recently. The best route I've discovered so far is using nping, but when I give it the -icmp flag it requires root power.

Any idea why this is and how I can get around it?
 
Old 12-03-2022, 06:54 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,813

Rep: Reputation: 5958Reputation: 5958Reputation: 5958Reputation: 5958Reputation: 5958Reputation: 5958Reputation: 5958Reputation: 5958Reputation: 5958Reputation: 5958Reputation: 5958
If you have a fixed list of addresses or hostnames I would go with using fping.
 
2 members found this post helpful.
Old 12-03-2022, 07:15 PM   #3
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 924

Original Poster
Rep: Reputation: 61
Quote:
Originally Posted by michaelk View Post
If you have a fixed list of addresses or hostnames I would go with using fping.
I'll give it a go!
 
Old 12-04-2022, 09:21 AM   #4
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
You can use sudo to restrict the user to a single command, not give them full sudo. There are plenty of examples of this.

Here is one:

https://kifarunix.com/run-only-speci...sudo-in-linux/


Obviously, you will add sudo to the command and no password.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Seeing differences between ping and nping stats - is this expected ? Shaggy1 Linux - Networking 3 07-07-2020 07:38 AM
[SOLVED] Grant domain user access like he is in netdev group bgstack15 Linux - Networking 2 10-11-2019 09:56 AM
[SOLVED] Scripting result of nping - extracting number of lost pings jeff_russell35 Linux - General 9 03-18-2016 02:05 PM
How to grant sudo without allowing users to su to root jahnieboi Linux - Newbie 8 07-13-2009 12:03 PM
ICMP traffic archives/writing ICMP traffic in a file maia_1 Programming 0 07-20-2004 03:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration