Score:0

How to disable internet for users in Linux Ubuntu 20.04.3 LTS

cn flag

I need to diable internet for the users in linux. I have tried the following command.

sudo iptables -A OUTPUT -m owner --uid-owner devuser1 -j REJECT

sudo iptables -A OUTPUT -m owner --uid-owner devuser1 -j DROP

And tried to enter this command in /etc/network/interfaces . But it is empty.

David avatar
cn flag
All users selected users and why?
in flag
Generally the `uid-owner` is a number, not a string. If the goal is to use characters, you can replace `uid` with `gid` (for *Group* ID): `sudo iptables -A OUTPUT -p all -m owner --gid-owner devgroup1 -j DROP`
Doug Smythies avatar
gn flag
show us your `/etc/network/interfaces` contents. Are you using an old version of Ubuntu that still uses the `/etc/network/interfaces` file? I load my iptables rules as a post-boot service, but some recommend iptables-pesristent.
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.