SyntaxFix
Write A Post
Hire A Developer
Questions
Call visudo and add this:
visudo
user1 ALL=(user2) NOPASSWD: /home/user2/bin/test.sh
The command paths must be absolute! Then call sudo -u user2 /home/user2/bin/test.sh from a user1 shell. Done.
sudo -u user2 /home/user2/bin/test.sh
user1