我们有一些机器只能通过内网访问,通常情况下先登录到跳板机,然后在登录到目标机器。
ssh 提供一个 -J JumpServer
的参数,让我们快速的通过跳板机登录目标机器
ssh -J JumpServer targetServer
我们也可以通过代理登录到目标机器,本机或者跳板机上开启 socks5 代理,通过指定 ProxyCommand 来登录目标机器。
ssh -o 'ProxyCommand=nc -X 5 -x proxyhost:proxyport %h %p' targetServer
网友评论