对 WSL2 感兴趣。这是我进入 Linux 的方式,并在我决定安装 Nginx 并在 ufw 中允许它之前搞砸了一段时间。当我启用它时:
sudo ufw enable
Run Code Online (Sandbox Code Playgroud)
它的回应是:
ERROR: problem running ufw-init
iptables-restore v1.8.4 (legacy): Couldn't load match `limit':No such file or directory
Error occurred at line: 63
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
iptables-restore v1.8.4 (legacy): Couldn't load match `limit':No such file or directory
Error occurred at line: 21
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
Problem running '/etc/ufw/before.rules'
Problem running '/etc/ufw/user.rules'
Run Code Online (Sandbox Code Playgroud)
所以,我已经尝试了很多东西。首先重启服务,然后重置ufw,卸载重装。在某些时候,我决定切换到 Ubuntu 18.04 而不是 20.04 得到了一个非常相似的错误。
ERROR: …Run Code Online (Sandbox Code Playgroud)