SSH进阶 端口转发 内网穿透
SSH Tunnel - Port Forwarding Secure Shell (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network. The best known example application is for remote login to computer systems by users. SSH是一个网络协议sftp、scp、ssh都是这个协议。ssh一般用来用于远程主机的登录,Linux系统自带OpenSSH可以方便的使用。它有一个叫SSH Tunnel的东西可以转发流量,下面是几个例子,以便理解和快速使用隧道,详细使用方法,请移步官方手册。 本地端口转发(Local Port Forwarding) -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. 使用-L参数,指定一个本地端口,流量通过这个端口转发到目标主机(host)上的端口(hostport)。 例如连接远程主机(example.com)本地的mysql服务,我们可以本地开一个端口3307转发,这样我们就可以通过SSH连接到远程的数据库,不用修改远程服务器的配置就可以实现,而且数据是加密的。 ssh -L 3307:127....