LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 03-01-2010, 03:47 AM   #1
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
How to disable the USB port on a machine?


I'm disgusted with myself for not knowing the answer to this one, as I consider myself a fairly low-level hackerly type, but:

How do I disable the USB port on a machine? This is so that if a pendrive is stuck into it, nothing will happen, i.e. no viruses which can attack the machine etc.

The guy I know who wants this has WINDOZE machines on which he wants this done, but anyway I plan to migrate his office to Linux, after which I'd be wanting the above functionality.

Thanks for your help, you guys
 
Old 03-01-2010, 04:09 AM   #2
ronlau9
Senior Member
 
Registered: Dec 2007
Location: In front of my LINUX OR MAC BOX
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369

Rep: Reputation: Disabled
Quote:
Originally Posted by resetreset View Post
I'm disgusted with myself for not knowing the answer to this one, as I consider myself a fairly low-level hackerly type, but:

How do I disable the USB port on a machine? This is so that if a pendrive is stuck into it, nothing will happen, i.e. no viruses which can attack the machine etc.

The guy I know who wants this has WINDOZE machines on which he wants this done, but anyway I plan to migrate his office to Linux, after which I'd be wanting the above functionality.

Thanks for your help, you guys
Disable it in you're BIOS settings
 
Old 03-01-2010, 04:44 AM   #3
Angel2953
Member
 
Registered: Sep 2005
Location: Poland
Distribution: Debian, Ubuntu
Posts: 38

Rep: Reputation: 16
or you can unload USB driver module from kernel and put it on blacklist, so that kernel won't load it automatically...
 
Old 03-01-2010, 08:33 AM   #4
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Original Poster
Rep: Reputation: 62
No I need this on a GUI thingy - his situation is, people come to his office with pendrives, and he would like to disable them being able to plug in anything into the system cause he's afraid of viruses. But he needs to be able to click this on and off, as according to whether such ppl have landed up *at* his office or not. It's a valid situation, and I'd like to think Linux would be able to handle this.
And Angel, that wouldn't be a good idea, cause Like I said it has to be on a clickable interface, but anyway, what if the driver has not been compiled separately, i.e. there's no .o file to rmmod? Is there a way to unload the driver in this case?
 
Old 03-01-2010, 02:05 PM   #5
whizje
Member
 
Registered: Sep 2008
Location: The Netherlands
Distribution: Slackware64 current
Posts: 594

Rep: Reputation: 141Reputation: 141
What about usb keyboards and mouse. Maybe it's better to make a script with a nice menu for him where he can give and take user rights to mount usb pendrives comfortable from his desk .
 
Old 03-01-2010, 02:42 PM   #6
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
Quote:
and he would like to disable them being able to plug in anything into the system cause he's afraid of viruses.
not to sound stupid but wouldn't migrating him to linux take care of the virus issue anyways
however if its a matter of not waning pendrives then perhaps the better answer is just to disable automounting of pen drives and make sure that standard users don't have permission to mount ANYTHING
 
Old 03-01-2010, 02:55 PM   #7
10110111
Member
 
Registered: Jun 2008
Location: St.-Petersburg, Russia
Distribution: (B)LFS, Ubuntu, SliTaz
Posts: 403

Rep: Reputation: 51
You could disable automount feature of GNOME/KDE/whatever and restrict normal users from mounting any volumes. Then, as the mount is needed, a password could be entered to mount the drive. This can of course be scripted to be clickable (something like a controllable daemon which would change needed settings if a script asks it to do this).
 
Old 03-01-2010, 07:03 PM   #8
helo
LQ Newbie
 
Registered: May 2007
Distribution: slackware
Posts: 18

Rep: Reputation: 2
You may find Documentation/usb/authorization.txt in the kernel source useful:

Quote:
Usage:

Authorize a device to connect:

$ echo 1 > /sys/bus/usb/devices/DEVICE/authorized

Deauthorize a device:

$ echo 0 > /sys/bus/usb/devices/DEVICE/authorized

Set new devices connected to hostX to be deauthorized by default (ie:
lock down):

$ echo 0 > /sys/bus/usb/devices/usbX/authorized_default

Remove the lock down:

$ echo 1 > /sys/bus/usb/devices/usbX/authorized_default
 
Old 03-02-2010, 12:06 PM   #9
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Original Poster
Rep: Reputation: 62
Quote:
Originally Posted by helo View Post
You may find Documentation/usb/authorization.txt in the kernel source useful:
THIS is the info I was looking for, thanks so much.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to configure the serial port of my virtual machine with host machine. akram Linux - Newbie 4 07-31-2009 10:39 PM
Directing packet from one port to another port of another machine anjinpradhan Linux - Networking 4 04-25-2009 03:56 PM
how to disable USB port visitnag Linux - Desktop 6 12-31-2008 01:28 PM
debian iptables squid - redirect port 80 to port 8080 on another machine nickleus Linux - Networking 1 08-17-2006 12:59 AM
Dell Laptop Broken USB port. How to disable? newb sfumato Linux - Hardware 2 10-06-2005 03:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 09:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration