So I have a NodeJS app with a node module called linux-user
it just provides a api to view / change Linux users through javascript. In my app I just have it scanning and outputting what the userid is and the username for the linux host. I want to put this file into production but it requires the JavaScript file to be run as root to run. However I don't want someone to tamper with it without the proper permissions but still able to run without running the app as root when I call it. What is the process to change the ownership of this file?
The file must do this:
- Execute without needing root.
- Can only edit the script with
sudo