Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my computer centre in my college ubuntu is installed for some projects purpose in order to keep safe from virus we would like to block pendrive access

share|improve this question
Take a look at this How do I prevent standard users from using the USB ports? – Mitch Aug 16 '12 at 10:24
Blocking pen drive access is totally unnecessary and will only get in your students way. The file system has proper permissions unlike windows which prevent things form spreading between users or to the administrator. If you are worried about students using rootkits to gain root access, they don't need a pen drive to do this. A text editor and c compiler and the code attached to this mailing list email: is all they need if your running an out of date nvidia driver... – MickStep Aug 16 '12 at 10:30
  1. FS permission solution

    To block:

    sudo chmod 700 /media

    To unblock:

    sudo chmod 755 /media
  2. BIOS option (If available)

    You can also disable USB from system BIOS configuration option. Make sure BIOS is password protected.

  3. Grub option

    You can get rid of all USB devices by disabling kernel support for USB via GRUB. Open grub.conf or menu.lst and append "nousb" to the kernel line as follows:

    kernel /vmlinuz-2.6.18-128.1.1 ro root=LABEL=/ console=tty0 console=ttyS1,19200n8 nousb

    vmlinuz-2.6.18-128.1.1 - is just an example, put your own

    Save and close the file. Once done just reboot the system:

    sudo reboot
share|improve this answer

Your Answer


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.