Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
13
rated 0 times [  13] [ 0]  / answers: 1 / hits: 6706  / 2 Years ago, thu, may 19, 2022, 8:10:37

I know about changing owners/permissions on particular programs/files, but how can I control which users have access to the network card (NIC) or have the power to create network sockets?


More From » networking

 Answers
1

As described here, you can block all Internet access for certain users using this iptables command:


sudo iptables -A OUTPUT -m owner --uid-owner {USERNAME} -j REJECT
sudo ip6tables -A OUTPUT -m owner --uid-owner {USERNAME} -j REJECT

If you want this command to run automatically when the system starts up, you should add it to the end of your /etc/rc.local file.


While this won't make it impossible for those users to create sockets, it will block all outgoing traffic (like a firewall).


[#33968] Saturday, May 21, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
allally

Total Points: 487
Total Questions: 106
Total Answers: 110

Location: Laos
Member since Sun, Jul 3, 2022
2 Years ago
;