I would like to execute a script as a normal user and execute a command that shuts off apache (which needs a root password). I was wondering if is possible to run the script with sudo but it executes some of the commands with an specific user and executes a specific command as a root.How can I achieve this?
How can I execute a script as root, execute some commands in it as a specific user and just one command as root
bash;scripting;sudo
sudo -u <username> <command>