小编zun*_*yen的帖子

从 WSL2 使用 Ubuntu 启用 ufw 失败

这是 Ubuntu 20.4 或 Ubuntu 22.04 的全新安装,但当我尝试从 Ubuntu 控制台启用 ufw 时,它们都失败了,并出现如下错误。

 sudo ufw enable
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/ufw/util.py", line 427, in under_ssh
    ppid = get_ppid(pid)
  File "/usr/lib/python3/dist-packages/ufw/util.py", line 419, in get_ppid
    ppid = open(name).readlines()[0].split(')')[1].split()[1]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/sbin/ufw", line 138, in <module>
    not ui.continue_under_ssh():
  File "/usr/lib/python3/dist-packages/ufw/frontend.py", line 901, in continue_under_ssh
    if self.backend.do_checks and ufw.util.under_ssh(): # pragma: no cover
  File …
Run Code Online (Sandbox Code Playgroud)

ufw ubuntu wsl2

4
推荐指数
1
解决办法
4396
查看次数

标签 统计

ubuntu ×1

ufw ×1

wsl2 ×1