Results 1 to 3 of 3

Thread: How can I prevent a user from accessing an specific network interface?

  1. #1
    Join Date
    Apr 2007
    Beans
    891
    Distro
    Ubuntu 10.04 Lucid Lynx

    How can I prevent a user from accessing an specific network interface?

    Hi
    Thank you for reading my post, can someone please let me know how I can prevent a user from accessing an specific network adapter (interface)?

    My computer has two network interfaces and I want to make sure that second user has no access to that interface.


    PS: this is a cross post from http://ubuntuforums.org/showthread.php?t=1258237 I though I may have better chance to get the answer here instead of beginners forum.

    Thanks
    Ubuntu 10.04
    ATI 3470
    4 GB RAM.

  2. #2
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: How can I prevent a user from accessing an specific network interface?

    You can do this with iptables

    Code:
    sudo iptables -A INPUT -i eth0 -m owner --uid-owner 1001 -j DROP
    sudo iptables -A OUTPUT -o eth0 -m owner --uid-owner 1001 -j DROP
    get your users id from the command id
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  3. #3
    Join Date
    Sep 2007
    Location
    In here watching you!
    Beans
    Hidden!

    Re: How can I prevent a user from accessing an specific network interface?

    Quote Originally Posted by bodhi.zazen View Post
    You can do this with iptables

    Code:
    sudo iptables -A INPUT -i eth0 -m owner --uid-owner 1001 -j DROP
    sudo iptables -A OUTPUT -o eth0 -m owner --uid-owner 1001 -j DROP
    get your users id from the command id
    To change which interface is blocked change eth0 to eth1 or wlan or whatever it is labeled in your Linux version.

    Replace 1001 in the command with the userid you want to block.

    You can read about other iptables capabilities or understand the command at this site http://linux.die.net/man/8/iptables easier to read than using man in terminal.
    Use whatever OS or desktop works for you. Dual boot or use VMs if you want. Backup your computer regularly, and definitely before upgrading, partitioning, or installing an OS.

    No support requests by PM please.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •