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.

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: permalink.gmane.org/gmane.comp.security.full-disclosure/86747 is all they need if your running an out of date nvidia driver... –  MickStep Aug 16 '12 at 10:30

1 Answer 1

  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

 
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.