Quote:
Originally Posted by Nathanael
as far as i know there is not way of writing iptables rules to block a certain 'user'!! iptables works on a different layer!
|
not really
to darkone66669 ,,, first do
id your_son_login_id... you will get some number, for root il look like
id root
uid=0(root) gid=0(root) groups=0(root)
so means instead of root enter login name of your son, ....
check first have you iptables installed on your system, I suppose you have, check it using
iptables -L -n
you should receive output like
TheRocket:/# iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
TheRocket:/#
...
then open vi editor and write this ...
iptables -A OUTPUT -m owner --uid-owner 1000 -p all -j DROP
1000 is my id, you should put there id you receive as output of id command... save that file,
chmod 755 file_of_rule.sh
and execute it using ./file_of_rule.sh every time before your son want to use internet
or easier put it inside /etc/rc.d....... I do not exactly to where are init scripts on Mandriva and make it execute every time you switch on computer,
I home this helps.
Regards