bash脚本,自动输入sudo的密码
来源:互联网 发布:手机自动升级软件 编辑:程序博客网 时间:2024/05/16 17:24
解决方法: echo + | (管道)
始终提示输入密码
后来查看了下sudo命令的使用
the standard input instead of the terminal device. The
password must be followed by a newline character.
因此,之前的命令修改如下:
OK可以work
PS:网上说Shell 的expect工具,专门用来实现自动交互功能的,由于我的需求挺简单的,暂时用不到,后面有用的话,再做研究。
开始使用
始终提示输入密码
后来查看了下sudo命令的使用
发现有如下的解释:
-S The -S (stdin) option causes sudo to read the password fromthe standard input instead of the terminal device. The
password must be followed by a newline character.
因此,之前的命令修改如下:
OK可以work
PS:网上说Shell 的expect工具,专门用来实现自动交互功能的,由于我的需求挺简单的,暂时用不到,后面有用的话,再做研究。
0 0
- bash脚本,自动输入sudo的密码
- bash脚本,自动输入sudo的密码
- bash脚本,自动输入sudo的密码
- sudo 自动输入密码的脚本 alias别名
- shell脚本中sudo 自动输入密码
- ubuntu脚本自动输入sudo密码
- sudo命令自动输入密码的方法
- ubuntu运行sh脚本sudo自动输入密码
- ubuntu运行sh脚本sudo自动输入密码
- 【Linux Bash】利用管道简化sudo 密码的输入操作
- UBUNTU 12.04 64位脚本 自动输入密码 | 脚本执行 sudo 自动输入password
- bash脚本输入密码不回显
- 在 Linux 命令行脚本中执行 sudo 等命令时自动输入密码(使用expect)
- Linux自动输入密码脚本
- ubuntu下用脚本执行sudo命令免去输入密码
- 用 echo 管道命令给sudo自动输入密码
- ubuntu sudo自动切换root 无需输入密码
- ubuntu sudo自动切换root 无需输入密码
- c# string 转byte[]数组转换
- datagrid之类的组件中行内按钮点击和行点击事件问题
- PHP调用JAVA语言开发的WebService。
- android studio build.gradle说明
- 二叉搜索树的C++实现
- bash脚本,自动输入sudo的密码
- 5、TabPanel控件使用
- 四处踩坑的http通讯
- @Controller ~ @Service
- Ubuntu 16.04 安装使用MySQL
- static class 静态类(Java)
- 解决Win7下Jdeveloper(OAF)花屏的方法
- 大数据文本相似去重方案
- 深入分析 Java 中的中文编码问题