gue*_*tli 8 linux sudo opensuse
此命令在 OpenSuSE 11.4 上失败:
root@host# sudo -S -u "coreapp_customer1_d" -g "coreapp_customer1_d" /bin/bash -l -c "mkdir -p /home/coreapp_customer1_d/.ssh"
Run Code Online (Sandbox Code Playgroud)
这条消息:
Sorry, user root is not allowed to execute
'/bin/bash -l -c mkdir -p /home/coreapp_customer1_d/.ssh'
as coreapp_customer1_d:coreapp_customer1_d
on workdevel114.
Run Code Online (Sandbox Code Playgroud)
但它适用于 OpenSuSE 12.3。
我比较了两个系统的 /etc/sudoers 文件,并且(注释行除外)它们是相同的。
Jon*_*yJD 10
我自己也有这个问题,可以用
root ALL=(ALL:ALL) ALL
Run Code Online (Sandbox Code Playgroud)
在visudo
。重要的部分是:ALL
. 该sudoers的手册页这样说:
在下面的示例中,用户 tcm 可以运行命令来访问具有拨号程序组的调制解调器设备文件。
tcm boulder = (:dialer) /usr/bin/tip, /usr/bin/cu,\ /usr/local/bin/minicom
请注意,在此示例中仅设置组,该命令仍以用户 tcm 运行。例如
$ sudo -g 拨号程序 /usr/bin/cu
在我的上下文中使用-g
是重点,因为我想知道一个组可以写什么:
sudo -u nobody -g some_group find . -writable 2> /dev/null > /tmp/some_group_writable.txt
Run Code Online (Sandbox Code Playgroud)