How to disable Usb port?

7,110

Solution 1

You could try this, although may cause other issues:

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

Source:

Solution 2

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

Share:
7,110

Related videos on Youtube

Sumit Singh
Author by

Sumit Singh

Currently a software developer at Flipkart, previously worked in Infineon Technologies, India. I'm specialized in Java and eclipse plugin development. I like Ubuntu, open source philosophy, knowledge sharing, finding innovative solutions, continuous improvement. I tweet here, blog here, and Linkedin Profile. Thanks for visiting my Profile. SOreadytohelp

Updated on September 18, 2022

Comments

  • Sumit Singh
    Sumit Singh over 1 year

    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..

    • david6
      david6 about 12 years
      Do you want to disable USB storage devices? Why are you still using such an old Ubuntu?
    • RobotHumans
      RobotHumans about 12 years
      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?
    • Chan-Ho Suh
      Chan-Ho Suh about 12 years
      @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.
    • Lekensteyn
      Lekensteyn about 12 years
      Define "disable". Do you want to remove the power or make Ubuntu ignore any USB device?
  • Dmitrii K.
    Dmitrii K. about 11 years
    change the kernel revision with the kernel ver. you have
  • david6
    david6 over 10 years
    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
  • Sukupa91
    Sukupa91 over 10 years
    thanks , yeah it will work for sure , but cant we do it directly via terminal
  • Shubshub
    Shubshub about 8 years
    @Sushantp606 We can! awk '!/pattern/' file > /tmp/temp && sudo mv /tmp/temp /etc/modprobe.d/blacklist.conf