zoukankan      html  css  js  c++  java
  • SSH内网穿透 Reverse SSH Tunneling

    Have you ever wanted to ssh to your Linux box that sits behind NAT? Now you can with reverse SSH tunneling. This document will show you step by step how to set up reverse SSH tunneling. The reverse SSH tunneling should work fine with Unix like systems.

     

     Let's assume that Destination's IP is 192.168.20.55 (Linux box that you want to access).

    You want to access from Linux client with IP 138.47.99.99.

    Destination (192.168.20.55) <- |NAT| <- Source (138.47.99.99)

    1. SSH from the destination to the source (with public ip) using command below:

    ssh -R 19999:localhost:22 sourceuser@138.47.99.99

    * port 19999 can be any unused port.

    2. Now you can SSH from source to destination through SSH tuneling:

    ssh localhost -p 19999

    3. 3rd party servers can also access 192.168.20.55 through Destination (138.47.99.99).

    Destination (192.168.20.55) <- |NAT| <- Source (138.47.99.99) <- Bob's server

    3.1 From Bob's server:

    ssh sourceuser@138.47.99.99

    3.2 After the sucessful login to Source:

    ssh localhost -p 19999

    * the connection between destination and source must be alive at all time.

    Tip: you may run a command (e.g. watch, top) on Destination to keep the connection active.

     

     





  • 相关阅读:
    DOM--6 向应用程序中加入ajax
    javascript优化--12模式(设计模式)03
    javascript优化--11模式(设计模式)02
    javascript优化--14模式2(DOM和浏览器模式)
    mvc-9测试和调试
    mvc-10部署
    mvc-6依赖管理
    less
    css3 总结03
    css3 总结02
  • 原文地址:https://www.cnblogs.com/jins-note/p/9513326.html
Copyright © 2011-2022 走看看