#!/usr/bin/expect
spawn ssh web@x.x.x.x "/data/t/busi/q/aa.sh"
expect "assword:"
send "xxxxxxx\r"
interact
spawn ssh web@x.x.x.x "/data/t/busi/q/aa.sh"
expect "assword:"
send "xxxxxxx\r"
interact
本文介绍了一种通过SSH协议远程执行服务器上Shell脚本的方法。使用expect脚本实现自动化登录及命令发送流程,适用于需要频繁进行远程操作的场景。
2927

被折叠的 条评论
为什么被折叠?