启用 ufw 后无法克隆远程仓库

启用 ufw 后无法克隆远程仓库

我有一个运行 alpine3.15 [已启用磁盘模式] 的云 VM,当 ufw 关闭时,我能够克隆/推送/拉取到 github。但是当它打开时,所有与 github 通信的 git 命令都会卡住(无输出)

我尝试通过 ssh 进行测试但也卡住了:

ssh -vvvT [email protected]

OpenSSH_8.8p1, OpenSSL 1.1.1n  15 Mar 2022
debug1: Reading configuration data /root/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/root/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/root/.ssh/known_hosts2'
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug2: resolving "github.com" port 22
debug3: resolve_host: lookup github.com:22
debug3: ssh_connect_direct: entering
debug1: Connecting to github.com [140.82.113.4] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x48

以下是 ufw 的状态:

Status: active

To                         Action      From
--                         ------      ----
SSH                        ALLOW       Anywhere                  
SSH (v6)                   ALLOW       Anywhere (v6)             

DNS                        ALLOW OUT   Anywhere                  
80/tcp                     ALLOW OUT   Anywhere                  
443                        ALLOW OUT   Anywhere                  
DNS (v6)                   ALLOW OUT   Anywhere (v6)             
80/tcp (v6)                ALLOW OUT   Anywhere (v6)             
443 (v6)                   ALLOW OUT   Anywhere (v6)

目前,当我想要克隆/推送时,我会暂时关闭和打开 ufw(没有风险,因为 VM 中没有重要的东西),但每次都必须这样做很麻烦。

任何帮助都将受到赞赏。

相关内容