Showing posts with label shell script. Show all posts
Showing posts with label shell script. Show all posts

Wednesday, April 25, 2012

Run shell script as sudo user in Linux

To run a shell script as a sudo user in Linux can be achieved using the -s option of the sudo command.



sudo -u user123 -s /home/myscripts/runtest1.sh

will execute the runtest1.sh script using user user123