username ALL=NOPASSWD: /usr/sbin/ntpdate
Now this will be allowed:
username@laptop:~$ sudo /usr/sbin/ntpdate
There is another situation: when you need user1 to run a command as user2. For this you add to /etc/sudoers:
user1 ALL=(user2) NOPASSWD: /home/user1/bin/start_daemon
In this case user1 will be able to do:
user1@laptop:~$ sudo -u user1 /home/user1/bin/start_daemon
No comments:
Post a Comment