Originally Posted by viramasu
and other following commands are not executed. How do i fix this?
Which distro are you using and would you consider using "sudo" ? If you look in the manual page for the file sudoers
, you will see all the options. But there are also presentations online by Michael W Lucas about "sudo: You're Doing It Wrong" both slides and video. His book, sudo Master
is quite useful. No, I don't know him or have even met him, but "sudo" is useful enough that it is worth knowing about but flexible enough that an introduction to its capabilities are needed, beyond what are available in the manual pages, and he covers the topic well.
sudo -u abc /usr/local/bin/someprogram
Where a group is given such permission in /etc/sudoers
%team1 ALL=(abc:abc) /usr/local/bin/someprogram ""
The empty quotes mean that no options are allowed for that program. If you want options, add them or (carefully) use a pattern.
If you're stuck using "su" then use the -c option to specify the program to run.