sshd_config 選項:“PermitTunnel”與“AllowTcpForwarding”

sshd_config 選項:“PermitTunnel”與“AllowTcpForwarding”

我無法理解文件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.

但這對我來說意義不大。

答案1

PermitTunnel 用於隧道設備,類似虛擬網路介面。它們可用於透過 SSH 進行 VPN 連接,因此到目標網路的所有流量都透過隧道路由。

另一方面,TCP 轉送僅將某些連接埠從本機轉送至目標主機。

因此,如果您想要一個成熟的虛擬網路接口,請使用隧道設備 - 您可能需要 root 或適當的 CAP 權限才能進行設定。例如,要透過 TCP SSH 隧道存取 Web 應用程序,TCP 轉送更易於設定和使用。

相關內容