Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How can I block or disable my Ethernet Internet connection, for the guest account only?

share|improve this question
    
Maybe iptables with the owner match module is an option for you. Never tried it myself though. Here is an example about its use: linuxpoison.blogspot.nl/2010/11/… –  jippie Jun 2 '12 at 17:30
add comment

2 Answers

First you need to edit the network interfaces file.

Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command below.

sudo gedit /etc/network/interfaces

Now you need to add the simple iptables rule to the interfaces file when the internet connection starts up

Simply add this in the interfaces file

pre-up iptables -A OUTPUT -p tcp -m owner --uid-owner username -j DROP

save and exit the file.

Now you need to type in the terminal with the following command

sudo iptables -A OUTPUT -p tcp -m owner --uid-owner username -j DROP

and switch users to the username you blocked and try to access the internet.

share|improve this answer
    
The problem with this is that the actual username associated with a guest session starts with guest- and then contains random characters; it's different for each guest session, as the user is dynamically created on login. –  Eliah Kagan Jun 3 '12 at 17:29
add comment

You can use the following command to block particular user:

sudo iptables -A OUTPUT -p tcp -m owner --uid-owner username -j DROP

share|improve this answer
    
The problem with this is that the actual username associated with a guest session starts with guest- and then contains random characters; it's different for each guest session, as the user is dynamically created on login. –  Eliah Kagan Jun 3 '12 at 17:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.