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

如何在bash脚本中执行sudo时自动输入用户密码

2017-03-28 19:44 597 查看
echo “password” | sudo -S netstat -tlnp

The -S (stdin) option causes sudo to read the password from the standard input instead of the terminal device.


源: http://bbs.csdn.net/topics/350068385
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: