linux - 使用多个 Linux 隧道运行 Windows 脚本

标签 linux windows bash shell

我正在尝试在 Linux 中创建一个脚本,其中包含用于多个服务器的多个隧道并在该服务器中运行一个脚本。

基本上,我在 8 台 RedHat 机器上有一个 DailyCheck.sh,我在 Windows 中为每台机器都有一个隧道:

"putty.exe user@xxx.xxx.xxx.xxx -pw  <password> -L port:127.0.0.1:port"

然后我打开每一个并运行命令 DailyCheck.sh。

我想要的是 Windows 中的一个文件:

"putty.exe user@xxx.xxx.xxx.xxx -pw  <password> -L port:127.0.0.1:port"
sudo su -
./dailyCheck.sh
<delay if necessary>
"putty.exe user@xxx.xxx.xxx.xxx -pw  <password> -L port:127.0.0.1:port"
sudo su -
./dailyCheck.sh
(....)

我们有办法做到这一点吗?

谢谢和最好的问候, 安德烈。

最佳答案

我建议你——而不是隧道——设置proxy command对于每个主机。然后使用 remote command execution在远程运行脚本。

此外,为了获得更好的答案,我推荐标签 .

关于linux - 使用多个 Linux 隧道运行 Windows 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36282356/

相关文章:

c++ - 当使用 stdout 输出二进制数据时,如何将调试/详细信息输出到终端?

windows - 使用 ActiveTcl 8.5 在 Windows 7 中的 tcl 脚本中运行 DOS 命令或批处理文件

c++ - 接收消息频率高,请求 'best'线程模型

linux - 在循环脚本中将变量传递给 sshpass 命令

bash - 一个简单的 if/else bash 脚本,它对用户的是/否输入使用react?

C 代码在带有 Windows 的 Turbo C 上运行时工作正常,但在 gcc Linux 中进入无限循环

c - pthread_create 的第三个参数需要哪种类型

c++ - 我应该在 Qt Creator 中更改什么以使用 MinGW 而不是 Microsoft 编译器进行编译

bash - 添加来自不同输入文件的数字

linux - 安装在 ubuntu 计算机上的 Amazon EC2 实例的 var/www 文件夹在一段时间后卡住