#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    1
    Rep Power
    0

    Optimize Linux Sytem to reject unkown usb devices


    Hi, I'm trying to make my Linux system (Kubuntu 12.10) reject/block all other usb devices except from my own from connecting to the computer. In practice all i want is an error message to come up saying "Unknown Device not permitted on this computer" or something when another usb device is connected.

    I don't want the implementation to however disable usb devices connected physically as I do have a Windows 7 installation on the same PC.

    Thanks in advance for any advice/ideas on this.
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,392
    Rep Power
    1871
    http://linux.die.net/man/8/modprobe

    You can see what handles USB by typing in say
    modprobe -l | grep usb

    You can use the modprobe blacklists to prevent whatever module(s) you like from loading.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    23
    Rep Power
    0
    Hey

    You should have a look into the udev rules. With the udev rules you can specify that only certain usb or any other devices with an UUID are recognised by the machine. This way only your usbs will work. You can also secify in the udev rules to create a file in a certain place if someone puts in a non wanted usb.

    You would have to write a bash script to look for that file and if it is created you can display a message with xmessage.

    Regards


    Originally Posted by Cyrebo
    Hi, I'm trying to make my Linux system (Kubuntu 12.10) reject/block all other usb devices except from my own from connecting to the computer. In practice all i want is an error message to come up saying "Unknown Device not permitted on this computer" or something when another usb device is connected.

    I don't want the implementation to however disable usb devices connected physically as I do have a Windows 7 installation on the same PC.

    Thanks in advance for any advice/ideas on this.

IMN logo majestic logo threadwatch logo seochat tools logo