首页 > 解决方案 > putty中隧道设置的脚本

问题描述

目前我们的用户正在按照以下流程连接到 redshiftdata 仓库集群。

1. Open putty --> add jumphost
2. putty --> connection --> data ---> "Auto-login username"
3. putty --> connection --> SSH ---> Auth ---> allow agent forwading
4. putty --> connection --> tunnels ---> {provide source port,destination,add button}
5. After above setting open and then run 2 static commands 

作为不精通技术的用户,他们不想使用腻子并进行上述配置。所以我想使用一个脚本自动执行此操作,该脚本应该采用用户名(步骤#2),来自步骤#4的输入。用户将运行此脚本并创建到仓库的隧道。

需要一些参考或指导来使用批处理脚本来实现这一点。

标签: powershellshellbatch-fileputty

解决方案


您可以安装 OpenSSH 并使用它的所有命令。还有一个 Powershell SSH 模块,它利用 PSGallery 提供的 .NET:

https://www.powershellgallery.com/packages/Posh-SSH


推荐阅读