4

I am using Ubuntu 10.10. I want to disable my usb port due to some resign.
so how i can disable my usb port and after that how i can enable it..

4
  • Do you want to disable USB storage devices? Why are you still using such an old Ubuntu?
    – david6
    Apr 23, 2012 at 5:15
  • My answer only applies for a specific set of circumstances. Why is it you want to disable a usb port, for what type of device, and are you trying to disable all usb ports or just one? Apr 23, 2012 at 8:19
  • @david6 10.10 is not that old. Less than two years ago, after all. Some institutions are still using 8.04, which is a LTS; desktop support for it just ended last year, with server support ending now. Apr 23, 2012 at 20:52
  • Define "disable". Do you want to remove the power or make Ubuntu ignore any USB device?
    – Lekensteyn
    Apr 23, 2012 at 22:09

4 Answers 4

1

Just rename storage to storage-old:

mv /lib/modules/3.2.0-35-generic-pae/kernel/drivers/usb/storage /lib/modules/3.2.0-35-generic-pae/kernel/drivers/usb/storage-old

1
  • change the kernel revision with the kernel ver. you have Feb 22, 2013 at 21:24
1

You could try this, although may cause other issues:

sudo sh -c 'echo "blacklist usb-storage" >> /etc/modprobe.d/blacklist.conf'

Source:

4
  • how can we re enable it via command line??
    – Sukupa91
    Nov 30, 2013 at 8:43
  • 1
    Edit file /etc/modprobe.d/blacklist.conf, to remove line which that this added. ie. "blacklist usb-storage". You could use vim or gedit, from the command line. eg. sudo vim /etc/modprobe.d/blacklist.conf
    – david6
    Nov 30, 2013 at 9:16
  • thanks , yeah it will work for sure , but cant we do it directly via terminal
    – Sukupa91
    Nov 30, 2013 at 9:23
  • @Sushantp606 We can! awk '!/pattern/' file > /tmp/temp && sudo mv /tmp/temp /etc/modprobe.d/blacklist.conf
    – user423626
    Mar 26, 2016 at 16:42
0

You're not being very specific.

List the USB modules currently loaded:

lsmod | grep usb

You can unload the modules with

sudo rmmod usb_storage    # for disks

Be carefull, you can easily lock yourself out if you're using USB keyboard/mouse and remove the usbhid module.

0

This is not strictly an Ubuntu or Linux solution, but you could go into the bios of the computer and disable the usb ports from there.

Some computers will allow you to select which ports to disable (HP).

You can then also password protect the bios to ensure they are not just switched on again.

You may also want to pay attention to what usb input devices (keyboard / mouse) you have before disabling usb.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .