1

A separate user has been created whose purpose is to execute a script that keeps a particular process running constantly on my server.

This process needs to run at a higher priority requiring it to be executed via the 'nice' command.

The issue is that executing 'nice' requires elevated privileges to run and for security purposes this process that is kept running needs not to gain these elevated permissions when we use 'nice'.

How can I give my user the ability to execute 'nice' without making him 'sudo' it? If that's not an option, How can I 'sudo nice' without the program executed through 'nice' gaining elevated permissions this way?

I would prefer just allowing the user access to 'nice'

KKlouzal
  • 113

1 Answers1

0

I would suggest to use the sudo command:

sudo nice -n $priority sudo -u $user $command

By using this command the command will run with the rights of the user account.

muru
  • 207,228
LeTeX
  • 16