yum -y install expect
login as normal user:
vi su.exp
#!/usr/bin/expect
set timeout 30spawn su -expect "Password:"send "root-pass\r"interactchmod +x su.exp
./su.exp
本文共 213 字,大约阅读时间需要 1 分钟。
yum -y install expect
login as normal user:
vi su.exp
#!/usr/bin/expect
set timeout 30spawn su -expect "Password:"send "root-pass\r"interactchmod +x su.exp
./su.exp
转载于:https://blog.51cto.com/hj192837/1595972