从堡垒自动转发到下一台服务器?

我们在工作中使用我们的VPC的堡垒连接到几个私人服务器,我已经设置别名(SSH主机别名),以加快反弹到下一个服务器的过程,但这是一个缓慢的过程,许多用户最终catget我们configurationfind适当的别名。 我想找出一种方法能够让我们的用户能够通过堡垒ssh / sftp? 有谁知道一个可接受的方法? 我简单地看了一下mosh-server,但不确定这是否是正确的方法。

假设Linux / MacOS上的OpenSSH。 腻子可能提供类似的东西。

告诉你的用户在〜/ .ssh / config文件中使用ProxyCommand

 cat ~/.ssh/config Host !bastion.example.com *.example.com ProxyCommand ssh -q -a [email protected] nc %h %p IdentityFile ~/.ssh/id_rsa 

如果您尝试连接到bastion.example.com ,则ssh将通过bastion.example.com自动将此连接隧道bastion.example.com

如果你喜欢,你可以添加无尽的灵活性。