80后技术男
分类: LINUX
2006-09-24 22:51:21
user billy will be able to run any command in /usr/bin as root, such as /usr/bin/w. The following two command will be allowed (the first assumes that /usr/bin is in the user's path):
$ sudo w $ sudo /usr/bin/w
However, this will not:
$ cd /usr/bin $ sudo ./w
For this reason you should only grant access to commands using wildcards and never restrict access using them. This limitation will be removed in a future version of sudo.
tester ALL(主机的名字)=NOPASSWD: /bin/kill,PASSWD: /bin/ls, /usr/bin/lprm
tester ALL=(ALL) ALL
例如以下
给apache用户本地主机不用输入密码能够执行特定目录的脚本权限
apache localhost=NOPASSWD:/avtech/apps/future/vhcs/command/*.sh,/bin/cp
参见