SSH本地和远程端口转发之间的区别
SSH 代表“安全外壳”或“安全套接字外壳”。它是一种加密网络协议,允许两台计算机在不安全的网络(如 Internet)上通信和共享数据。 SSH 协议保护网络免受各种攻击。
1.本地端口转发:
本地端口转发是端口转发的常见类型。它用于让用户从本地计算机连接到另一台服务器,即从运行在与 Secure shell 客户端相同的计算机上的另一客户端应用程序安全地转发数据。通过使用本地端口转发,阻止某些网页的防火墙能够绕过。
2. 远程端口转发:
这种形式的端口转发可以在安全外壳的服务器端启用应用程序。有专有的用于相同的通用目的。要使用远程端口转发,必须知道目标服务器的地址和两个端口号。选择的端口号取决于要使用的应用程序。
SSH LPF 与 SSH RPF 的区别:
SSH LPF | SSH RPF |
In this, connections from the SSH client are forwarded via the SSH server, then to a destination server. | In this, connections from the SSH server are forwarded via the SSH client, then to a destination server. |
LPF lets you to connect from your local computer to another server. | RPF lets you connect from the remote SSH server to another server. |
In OpenSSH, local port forwarding is configured using the -L option. | In OpenSSH, local port forwarding is configured using the -R option. |
The basic syntax for LPF with Linux is: ssh -L local_port:destination_server_ip:remote_port ssh_server_hostname | The basic syntax for RPF with Linux is: ssh -R local_port:destination_server_ip:remote_port ssh_server_hostname |
For example: If you wanted to connect from your laptop to http://www.ubuntuforums.org using an SSH tunnel. You would use source port number 8080 and destination port 80 and destination server www.ubuntuforums.org | For example: If you wanted to let a friend access your remote desktop, using the command-line SSH client. You would use port number 5900 and destination server localhost : ssh -R 5900: localhost : 5900 guest@jone-pc |