【发布时间】:2013-12-08 04:20:39
【问题描述】:
我想从 hadoopmaster su 到 hduser。当我在终端上这样做时,我会这样做:
su - hduser
然后它要求我输入密码,我输入它并进入 hduser。我怎样才能在 shell 脚本中做同样的事情而不必担心密码?我尝试了sudoers文件方法我放的地方:
root ALL=(ALL:ALL) ALL
hduser ALL=(ALL:ALL) ALL
hadoopmaster ALL=(ALL:ALL) NOPASSWD: /bin/su hduser
(here I tried different combinations of the line with and without the '-' and also
with and without /bin)
我这样做了,当我这样做 su hduser 或 su - hduser 时,它会再次提示我输入密码。我该怎么办?
【问题讨论】:
标签: linux ubuntu ubuntu-12.04 sudo sudoers