SSH Through NAT with help of middle man

With this method, you don’t need to do any modification on the middle man server. GatewayPorts setting is not required.

 

Run this on destination machine:

ssh -o ServerAliveInterval=60 -N -R <port on middleman>:localhost:<port on this machine, usually 22> <user>@<middleman server>

Run this on your local machine:

ssh -o ServerAliveInterval=60 -N -L <port on local machine>:localhost:<port on middleman server> <user>@<middleman server>

 

Then you can connect to localhost <port on local machine> which will take you to the destination server

此条目发表在 Linux使用 分类目录。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>