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
sudo -u user123 -s /home/myscripts/runtest1.sh
will execute the runtest1.sh script using user user123
No comments:
Post a Comment