i am currently developing a node.js app that does a ping sweep on the network, and as some people may know, performing ICMP requests on linux requires root privileges. And my question resides on, is there a way to prompt the user for the administrator password once the application has started?
What i am trying to achieve is to make the user run the app as a normal user without having to run it as a sudo user. And when the action requires elevated privileges, then prompt the user for privilege access.
Thank you guys in advance.
Edit: What i am trying to use as a sudoer is the module raw-socket.
using child_process.spawn() worked fine.