I would like to redirect (switch) one execution to other user instead root
while using sudo
.
Example: sudo startup.sh
will execute the startup.sh
as root
,
but what is needed is for it to be executed as another user, say tomcat
.
Just for this particular execution I just want them to execute the way they are using, i.e., sudo startup.sh
, but in the background (under the hood)
I want that to be changed to sudo su - tomcat startup.sh
as I can't tell the users not to use sudo -su or sudo -u
.
How can I achieve this?
sudo su
. Ever. – Chris Davies Jul 13 '20 at 20:21