#!/usr/bin/expect -f
#sshlogin.sh
#脚本不能用sh sshlogin.sh执行
#应该付权限执行./sshlogin.sh
set timeout 30
spawn ssh root@192.168.95.2 #执行
expect "password:" #判断
send "toor\r" #发送
interact
sshlogin.sh
最新推荐文章于 2021-08-12 14:30:59 发布
#!/usr/bin/expect -f
#sshlogin.sh
#脚本不能用sh sshlogin.sh执行
#应该付权限执行./sshlogin.sh
set timeout 30
spawn ssh root@192.168.95.2 #执行
expect "password:" #判断
send "toor\r" #发送
interact