ssh隧道技术
来源:互联网 发布:php开源库存管理系统 编辑:程序博客网 时间:2024/04/30 06:19
干什么用的:
A机器ssh到B机器, 创建一个隧道, 通过这个隧道, A机器可以访问任何B机器能访问到的端口, (这个称为本地转发)
或者反过来, 通过这个隧道, B机器可以访问到A机器能访问的任何端口, (这个称为远程转发)
实现方式:
1. 本地转发:
在A机器上执行命令:
ssh -L [bind_address:]port:host:hostport userB@ipB
其中 bind_address只能为localhost或者*, 填其他没有意义
这时在A上另外开一个shell, 所有connect bind_address:port 的连接, 都会通过B机器 连接到 host:hostport
2. 远程转发
在A机器上执行
ssh -R [bind_address:]port:host:hostport userB@ipB
这时, 在B上, 所有connect bind_address:port的连接, 都会通过A机器, 连接到host:hostport
其实感觉man ssh上面说的更清楚, 但是百度上一直各种以讹传讹, 写个帖子希望有人能看到
附man ssh:
-L [bind_address:]port:host:hostport
Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side.
This works by allocating a socket to listen to port on the local side, optionally bound to the specified bind_address.
Whenever a connection is made to this port, the connection is forwarded over the secure channel, and a connection is made
to host port hostport from the remote machine. Port forwardings can also be specified in the configuration file.
-R [bind_address:]port:host:hostport
Specifies that the given port on the remote (server) host is to be forwarded to the given host and port on the local side.
This works by allocating a socket to listen to port on the remote side, and whenever a connection is made to this port,
the connection is forwarded over the secure channel, and a connection is made to host port hostport from the local
machine.
- SSH隧道技术简介
- SSH 隧道技术
- SSH隧道技术简介
- ssh隧道技术
- Ssh隧道技术
- SSH隧道技术简介
- 初探SSH隧道技术
- ssh隧道技术
- SSH隧道技术----端口转发,socket代理
- SSH隧道技术----端口转发,socket代理
- SSH隧道
- SSH 隧道
- SSH隧道
- ssh隧道
- SSH隧道
- SSH隧道
- SSH隧道
- ssh隧道
- ctguoj-取石头 (15分)
- cisco 命令行(静态路由 配置)CCNA
- JSP内置对象(下)
- 编译原理-递归子程序法
- 设计模式的艺术之道--建造者模式
- ssh隧道技术
- 正则的作用简单了解
- 观察者模式
- JavaScript编写可维护的代码。
- scikit-learn 中文文档-无监督降维-用户指南|ApacheCN
- 第二章:Selenium IDE应用实践
- 1 编写一个Book类,该类至少有name和price两个属性。该类要实现Comarable接口,在接口的compareTo()方法中规定两个Book类实例的大小关系为二者的price属性的大小关系。
- 搭建LNMP环境(CentOS 6)
- go 获取函数调用者caller的函数名 打印堆栈runtime.Stack debug.Stack()