Score:0

cant enable UFW firewall

sk flag

I am trying to set up a code-server on my ubuntu 22.04. However I came to the realisation that my firewall wasnt enabled and tried enabling it using the instructions on this other thread : https://superuser.com/questions/590600/ufw-is-active-but-not-enabled-why.

When checking status of the firewall I am told it is inactive. when doing sudo ufw enable I am given this error message.:

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 "/usr/lib/python3/dist-packages/ufw/util.py", line 457, in under_ssh
    return under_ssh(ppid)
  File "/usr/lib/python3/dist-packages/ufw/util.py", line 457, in under_ssh
    return under_ssh(ppid)
  File "/usr/lib/python3/dist-packages/ufw/util.py", line 457, in under_ssh
    return under_ssh(ppid)
  [Previous line repeated 1 more time]
  File "/usr/lib/python3/dist-packages/ufw/util.py", line 434, in under_ssh
    raise ValueError(err_msg)
ValueError: Couldn't find parent pid for '2182' 
hr flag
Please [edit] your question to include the output of `apt policy ufw`. Are you running this on Windows Subsystem for Linux? The error looks a lot like [ufw crashes in wsl2](https://bugs.launchpad.net/ufw/+bug/2015645)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.