Ssh

即使規則允許,UFW 也拒絕 SSH

  • September 26, 2019

我最近將 RaspberryPi 3 配置為僅允許通過 VPN 進行連接。但是,我想從任何地方打開它以進行 SSH 連接。下面的規則應該允許埠 22 上的流量,但是一旦我啟用 ufw,我就無法再從任何地方連接,只能從本地 IP 連接(配置本地訪問的規則工作正常)。(路由器防火牆配置正確)

root@raspberrypi:~# ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), deny (outgoing), disabled (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
192.168.178.0/24           ALLOW IN    Anywhere                  
22/tcp                     ALLOW IN    Anywhere                  
22/tcp (v6)                ALLOW IN    Anywhere (v6)             

Anywhere                   ALLOW OUT   Anywhere on tun0          
192.168.178.0/24           ALLOW OUT   Anywhere                  
31.13.190.247 443/tcp      ALLOW OUT   Anywhere                  
Anywhere (v6)              ALLOW OUT   Anywhere (v6) on tun0     

我的錯誤是讓 openvpn 處於活動狀態。

引用自:https://unix.stackexchange.com/questions/536051