yum -y install expect
login as normal user:
vi su.exp
#!/usr/bin/expect
set timeout 30
spawn su -
expect "Password:"
send "root-pass\r"
interact
chmod +x su.exp
./su.exp
转载于:https://blog.51cto.com/hj192837/1595972
yum -y install expect
login as normal user:
vi su.exp
#!/usr/bin/expect
set timeout 30
spawn su -
expect "Password:"
send "root-pass\r"
interact
chmod +x su.exp
./su.exp
转载于:https://blog.51cto.com/hj192837/1595972