1 / 10

SSH 端口 转发

SSH 端口 转发. ssh 端口转发. SSH 端口转发技术 在 ssh 加密的 通道 上传输其它协议数据,即其它协议的数据通过 SSH 端口进行转发, SSH 连接作为其它协议传输的通道(隧道 ),这种 方式也叫做 SSH 端口转发或 SSH 隧道 SSH 端口转发技术的作用 加密数据传输 突破防火墙限制 SSH 端口转发的分类 本地转发 (local forwarding) 远程转发 (remote forwarding) 动态转发 (dynamic forwarding). ssh 端口转发. SSH 本地端口转发

Download Presentation

SSH 端口 转发

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SSH端口转发

  2. ssh端口转发 SSH端口转发技术 在ssh加密的通道上传输其它协议数据,即其它协议的数据通过SSH端口进行转发,SSH连接作为其它协议传输的通道(隧道),这种方式也叫做SSH端口转发或SSH隧道 SSH端口转发技术的作用 加密数据传输 突破防火墙限制 SSH端口转发的分类 本地转发(local forwarding) 远程转发(remote forwarding) 动态转发(dynamic forwarding)

  3. ssh端口转发 SSH本地端口转发 本地转发中的本地是指将本地的某个端口转发到其他主机的某个端口,这样当我们的程序连接本地的这个端口时,其实间接连上了其他主机的某个端口,当我们发数据包到这个端口时数据包就自动转发到了那个远程端口上 ssh -L [bind_address:]port:host:hostport server_address SSH本地端口转发中的常用选项 -L [bind_address:]port:host:hostport -N:不执行命令,和-f配合使用 -f:在后台执行,不用登陆到远程主机

  4. ssh端口转发 • SSH本地端口转发:实现安全通信 • ssh -Nf -L 10.10.10.1:7788:10.10.10.2:80 10.10.10.2 1 2 4 3

  5. ssh端口转发 • SSH本地端口转发:实现绕过防火墙限制 • C不允许A访问,但允许B访问,通过ssh本地转发实现A访问C • ssh -Nf -L 10.10.10.1:7788:10.10.10.3:80 10.10.10.2 1 2 4 3

  6. ssh端口转发 SSH远程端口转发 与本地端口转发相对的是远程端口转发。与本地转发不同,它指定的是远程主机的一个端口,将指向该端口的连接转发到本地端口。可知远程转发和本地转发本质上是一样的,主要区别在于需要转发的端口是在远程主机上还是在本地主机上 ssh -R [bind_address:]port:host:hostport server_address SSH远程端口转发中的常用选项 -R [bind_address:]port:host:hostport

  7. ssh端口转发 • SSH远程端口转发:实现访问内网的资源 • 内网通过SNAT可以访问外网,外网无法直接访问内网 内网主机通过SSH远程转发实现外网主机访问内网资源 • ssh -Nf -R 192.168.1.150:7788:10.10.10.10:80 192.168.1.150 1 4 2 3

  8. ssh端口转发 SSH动态端口转发 前面介绍的端口转发都是两个特定的端口间的转发,如果我们想用同一个本地端口访问不同的外部服务,那就要将ssh作为SOCKS代理服务,SOCKS也是一种网络协议,它用于客户端和服务器之前数据传输的代理服务 ssh -D [bind_address:]port server_address

  9. ssh端口转发 • SSH动态端口转发:实现访问内网的资源 • 防火墙允许内网主机A访问外网,禁止主机B访问外网 在内网主机B上通过SSH动态转发实现通过主机A问外网 • ssh -Nf -D 10.10.10.20:7788 10.10.10.10 5 1 4 2 3

  10. 思维决定未来,天道酬勤

More Related