跳板访问 ssh 服务

2021-09-28  本文已影响0人  Lupino

我们有一些机器只能通过内网访问,通常情况下先登录到跳板机,然后在登录到目标机器。
ssh 提供一个 -J JumpServer 的参数,让我们快速的通过跳板机登录目标机器

ssh -J JumpServer targetServer

我们也可以通过代理登录到目标机器,本机或者跳板机上开启 socks5 代理,通过指定 ProxyCommand 来登录目标机器。

ssh -o 'ProxyCommand=nc -X 5 -x proxyhost:proxyport %h %p' targetServer
上一篇 下一篇

猜你喜欢

热点阅读