Friday, April 19, 2024
 Popular · Latest · Hot · Upcoming
8
rated 0 times [  8] [ 0]  / answers: 1 / hits: 8990  / 2 Years ago, thu, april 21, 2022, 3:23:11

I want that one of the users (not in the sudoers list) have Internet access from 14:00 until 16:00 and from 17:00 until 18:30. Is it possible? Can I set different time intervals for different week days?


More From » firewall

 Answers
1

You can use iptables's owner extension to block a user from accessing the net, like



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


Now you can use cron to add or remove those rules (which may need a little bit of shell scripting if you already have some iptable rules or want it to to for different users at different times).


[#44718] Saturday, April 23, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lintical

Total Points: 344
Total Questions: 122
Total Answers: 106

Location: Sint Maarten
Member since Mon, Oct 12, 2020
4 Years ago
lintical questions
Thu, Jan 12, 23, 03:07, 1 Year ago
Mon, Jun 28, 21, 07:01, 3 Years ago
Sat, Aug 7, 21, 04:29, 3 Years ago
Mon, Dec 5, 22, 00:03, 1 Year ago
;