Score:0

Add custom iptables rule to UFW to be persistent

cn flag

I would like to add the following rule to block the access for a specific user in Ubuntu 22.04 and persist whenever UFW is on. Is there a mechanism to do this while playing nicely with the UFW?

-A OUTPUT ! -o lo -m owner --uid-owner 130 -j DROP

I tried adding this rule to the "/etc/ufw/before.rules" file already, but it seems like the rule is completely ignored. Do I need to add the rule to a different chain maybe? Is there an entirely different mechanism for custom rules like this?

waltinator avatar
it flag
No. Packets don't have user identification.
cn flag
No, you can't get it to work nicely inside of UFW or no this rule doesn't work because packets don't have user identification, because I have it working just fine when I type it from the CLI.. I am just working on making it come up automatically when ubuntu starts.
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.