1、安装sshpass
yum install sshpass
2、本地调用远程服务器的shell脚本文件:
sshpass -p sa ssh [email protected] -C "/bin/bash" < test.sh
3、从本地复制文件到远程服务器:
sshpass -p sa scp egova-pub-ex.jar [email protected]:/egova
原文地址:https://www.cnblogs.com/zhaoyanhaoBlog/p/11970626.html
时间: 2024-11-05 17:32:21