SSH client 方會看到以下的提示:
sudo: no tty present and no askpass program specified以下有一個方法可以取消 password 查問:
- 利用 visudo (或修改 /etc/sudoers)
- 修改/新增 User privilege,註明 NOPASSWD 關鍵字
用戶 remotescript 使用 sudo 執行任何指令時不須問 password
remotescript ALL = NOPASSWD: ALL用戶 remotescript 使用 sudo 執行 service 指令時不須問 password,其他不變:
remotescript ALL = NOPASSWD: /usr/bin/service
更多參考:
http://www.ducea.com/2006/06/18/linux-tips-password-usage-in-sudo-passwd-nopasswd/
沒有留言:
發佈留言