All Apps and Add-ons

How to run a specific script as root?

nick405060
Motivator

I'm looking to run a script as a root.

In terms of specifics, I'm trying to run pingstatus, and am only able to get it to run if I run all of Splunk as root. Which I don't want to do. If anyone has any recommendations specific to pingstatus, that works, but recommendations on how to run a specific script as root should fix the problem as well.

Tags (2)
0 Karma
1 Solution

nick405060
Motivator

You have to run Splunk as root.

View solution in original post

0 Karma

nick405060
Motivator

You have to run Splunk as root.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

@nick405060 If your problem is resolved, please accept the answer to help future readers.

---
If this reply helps you, Karma would be appreciated.
0 Karma

laurie_gellatly
Communicator

Letting any non-root owned script run with root privileges - not a good idea from a security perspective (you're already running Splunk as non-root so this would be a backward step IMHO).
A lesser evil would be to allow /bin/ping to be run by a non-root user.
https://stackoverflow.com/questions/37512291/how-is-ping-for-non-root-user-implemented-on-linux-dist...
You'll then need to wrap that into a script to replace pingstatus.

...Laurie:{)

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...