Ubuntu 下,shell脚本 sudo 自动填写密码实现

版权声明:转发可以,带链接啊,兄弟 https://blog.csdn.net/qq_36285997/article/details/88934311

---------------------------------------------------

|                不安全不安全不安全          |

---------------------------------------------------

1.安装expect工具:sudo apt-get install tcl tk expect

.sh文件中 加入

#! /usr/bin/expect
spawn sudo 命令
send "sudo密码\r"
interact

猜你喜欢

转载自blog.csdn.net/qq_36285997/article/details/88934311