Hello,
I need to disable specific USB ports (not all), but could not find any useful information so far. What do I need to do?
Thank you!
Hello,
I need to disable specific USB ports (not all), but could not find any useful information so far. What do I need to do?
Thank you!
What type of machine? WHY do you want to disable them? If it's to prevent people from plugging removable drives into the front of a PC (in corporate setting, for example) then the only sure way is to physically disconnect the ports, otherwise they can just insert a boot USB stick, run ubuntu (or puppy, or one of many other OS's) and carry on unrestricted.
AMD Phenom Quad 9650, 8Gb RAM, (2 x 1) +(1 x 1.5)Tb HDDs; 64-bit Lucid (ʍoʃs ʎpooʃq ooʇ sɐʍ ʇı ʇnq ʎʇʇɐᴎ pǝıɹʇ I); Dual-boot Win XP Pro 32-bit (although mainly use WINE or VirtualBox). HP t5730 with 1GB RAM and 160GB HDD running xubuntu 10.10.
Hi,
I've got a USB UMTS modem and it's not working properly. Now I would like to disable all the other USB ports, to run tests.
Hi
At the terminal type
This will get you a list of usb devices. You can then turn the power off and on to them like so.Code:for device in $(ls /sys/bus/usb/devices/*/product); do echo $device;cat $device;done
Turn it off.
Turn it onCode:echo suspend | sudo tee /sys/bus/usb/devices/XXXX/power/level
Where XXXX is the device to switch off.Code:echo on | sudo tee /sys/bus/usb/devices/XXXX/power/level
Here is an example from my machine.
It turns off and on my web cam.Code:matthew@matthew-laptop:/sys/bus/usb$ for device in $(ls /sys/bus/usb/devices/*/product); do echo $device;cat $device;done /sys/bus/usb/devices/2-5/product Video WebCam /sys/bus/usb/devices/usb1/product EHCI Host Controller /sys/bus/usb/devices/usb2/product EHCI Host Controller /sys/bus/usb/devices/usb3/product OHCI Host Controller /sys/bus/usb/devices/usb4/product OHCI Host Controller /sys/bus/usb/devices/usb5/product OHCI Host Controller /sys/bus/usb/devices/usb6/product OHCI Host Controller matthew@matthew-laptop:/sys/bus/usb$ echo suspend | sudo tee /sys/bus/usb/devices/4-1/power/level tee: /sys/bus/usb/devices/4-1/power/level: No such file or directory suspend matthew@matthew-laptop:/sys/bus/usb$ echo suspend | sudo tee /sys/bus/usb/devices/2-5/power/level suspend matthew@matthew-laptop:/sys/bus/usb$ echo on | sudo tee /sys/bus/usb/devices/2-5/power/level on matthew@matthew-laptop:/sys/bus/usb$
Kind regards
If you believe everything you read, you better not read. ~ Japanese Proverb
If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed. - Mark Twain
Thinking about becoming an Ubuntu Member?
That was a useful answer!
I don't need it but I'm writing that bit down in case someday I do.
i am trying to this and can't figure out which one to disable.
i have a 24 usb hub connected to one usb port. I want to disable and enable on the fly via the command prompt
ls /sys/bus/usb/devices
1-0:1.0 1-3.5.1:1.0 1-3.6.1:1.0 1-3.7.1:1.0 1-7:1.0 3-2.3:1.0
1-3 1-3.5.2 1-3.6.2 1-3.7.2 2-0:1.0 4-0:1.0
1-3.1 1-3.5.2:1.0 1-3.6.2:1.0 1-3.7.2:1.0 2-1 5-0:1.0
1-3:1.0 1-3.5.3 1-3.6.4 1-3.7.3 2-1:1.0 usb1
1-3.1:1.0 1-3.5.3:1.0 1-3.6.4:1.0 1-3.7.3:1.0 2-2 usb2
1-3.2 1-3.5.4 1-3.6.5 1-3.7.4 2-2:1.0 usb3
1-3.2:1.0 1-3.5.4:1.0 1-3.6.5:1.0 1-3.7.4:1.0 3-0:1.0 usb4
1-3.3 1-3.5.6 1-3.6.6 1-3.7.6 3-2 usb5
1-3.3:1.0 1-3.5.6:1.0 1-3.6.6:1.0 1-3.7.6:1.0 3-2:1.0
1-3.5 1-3.6 1-3.7 1-3.7.7 3-2.2
1-3.5.1 1-3.6.1 1-3.7.1 1-3.7.7:1.0 3-2.2:1.0
1-3.5:1.0 1-3.6:1.0 1-3.7:1.0 1-7 3-2.3
Sorry but if I would like to shut disable a usb port
issues this command
echo suspend | sudo tee /sys/bus/usb/devices/USB1/power/level
to shutdown usb1
tHE PORT I WANT TO SHUTDOWN IS 1-3
Last edited by VVAW; January 29th, 2012 at 06:46 PM.
Hi
Can you post the output of
Can you post it between code tagsCode:lsusb -t
[code]like this[/code]
to make it easier to read.
Kind regards
If you believe everything you read, you better not read. ~ Japanese Proverb
If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed. - Mark Twain
Thinking about becoming an Ubuntu Member?
~$ lsusb -t
/: Bus 05.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
|__ Port 2: Dev 2, If 0, Class=hub, Driver=hub/4p, 12M
|__ Port 2: Dev 3, If 0, Class=vend., Driver=pl2303, 12M
|__ Port 3: Dev 4, If 0, Class=vend., Driver=pl2303, 12M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
|__ Port 1: Dev 2, If 0, Class=vend., Driver=pl2303, 12M
|__ Port 2: Dev 3, If 0, Class=vend., Driver=pl2303, 12M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/8p, 480M
|__ Port 7: Dev 6, If 0, Class=stor., Driver=usb-storage, 480M
Sorry to drag this one up, but has something changed in 12.04?
If I run the suspend command for my webcam which is on 3-5
I getCode:echo suspend | sudo tee /sys/bus/usb/devices/3-5/power/level
Same with other devices. Just try to turning off annoying blue light on webcam when not in useCode:Invalid Argument
The best things in life are free, so what are we paying for?
Bookmarks