您的位置:首页 > 运维架构 > Shell

shell脚本中sudo 自动输入密码

2013-01-02 13:57 393 查看
http://blog.chinaunix.net/uid-23027556-id-96660.html

在shell脚本中需要用root用的来执行指令:

sudo 自动输入密码

echo "password" | sudo -S netstat -tlnp

-S

The -S (stdin) option causes sudo to read the password from the standard input instead of the terminal device.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: