I am currently trying to run a script as a different user than the user I am logged in.
I would like to run as main
user the following command, to have the user local
executing the script:
sudo su local -c "/home/main/some/folders/script"
But I have a Permission denied
output.
Still, if I log in as local using sudo su local
and then run the script, everything goes fine.
The permission on the file are 775 main main
and user local is part of the group local main
What could be the reason for this, and how to solve it ?
Thanks