sshd_config 选项:“PermitTunnel”与“AllowTcpForwarding”

BoZ*_*haa 4 debian sshd

我无法理解文件PermitTunnel中的选项sshd_config。该选项与 有何关系AllowTcpForwarding?似乎PermitTunnel no对通过隧道到服务器没有任何影响。

该男子这样说道PermitTunnel

 Specifies whether tun(4) device forwarding is allowed.  The argument must be yes,
             point-to-point (layer 3), ethernet (layer 2), or no.  Specifying yes permits both
             point-to-point and ethernet.  The default is no.

             Independent of this setting, the permissions of the selected tun(4) device must allow access
             to the user.
Run Code Online (Sandbox Code Playgroud)

但这对我来说意义不大。

小智 9

PermitTunnel 用于隧道设备,类似于虚拟网络接口。它们可用于通过 SSH 进行 VPN 连接,因此到目标网络的所有流量都通过隧道路由。

另一方面,TCP 转发仅将某些端口从本地主机转发到目标主机。

因此,如果您想要一个成熟的虚拟网络接口,请使用隧道设备 - 您可能需要 root 或适当的 CAP 权限才能进行设置。例如,要通过 TCP SSH 隧道访问 Web 应用程序,TCP 转发更易于设置和使用。