【发布时间】:2017-05-08 23:14:29
【问题描述】:
我想在 /etc/sudoers 文件的末尾添加几行。 下面是我要附加的行示例。
nagios ALL = NOPASSWD: /bin/su - root -c /etc/init.d/crond status
nagios ALL = NOPASSWD: /bin/su - hadoop -c hadoop dfsadmin -safemode get
nagios ALL = NOPASSWD: /bin/su - hadoop -c klist
谁能建议如何使用 shell 脚本附加它?
【问题讨论】:
-
我认为编辑
/etc/sudoers的明智方法是使用visudo。
标签: linux bash shell scripting rhel6