In a work environment, I'm trying to "lock down" a mac computer so that files can't be transferred via USB storage device.

Problem is, keybord and mouse are plugged in through USB, but I would still need those enabled, plus the keyboard has two more USB ports on either side. I could use a bluetooth mouse and keyboard to get around that, but then how can I disable the USB ports (And later re-enable with admin access)?

Or is there a way to limit the amount of data sent to/from as USB port? A keyboard and mouse wouldn't use that much, so then anything every X bytes/sec would get blocked? I'm not sure what the solution is here.

  • Are you using any sort of managed preferences? Well worth investigating if you aren't, much finer control over this and tons of other areas without getting into modifying the core OS.
    – da4
    Commented Jul 30, 2012 at 22:36

3 Answers 3


I think what you want to do is prevent the connection of USB Mass Storage Devices.

I found this answer which is untested by me and not terribly recent, but I can see that the referenced kext is still in the location described:

a quote from the Leopard security configuration guide:

48 Chapter 3 Protecting the System Through Hardware

Removing USB Support Software

Use the following instructions to remove USB mass storage device input/output support such as USB Flash drives and external USB hard drives. The removal of this kernel extension only affects USB mass storage devices. It does not affect other USB devices such as a USB printer, mouse, or keyboard. This task requires you to have administrator privileges. Important: Repeat these instructions every time a system update is installed. To remove kernel extensions for specific hardware:

  1. Open the /System/Library/Extensions folder.
  2. To remove support for USB mass storage devices, drag the following file to the Trash: IOUSBMassStorageClass.kext
  3. Open Terminal and enter the following command: $ sudo touch /System/Library/Extensions The touch command changes the modified date of the /System/Library/Extensions folder. When the folder has a new modified date, the Extension cache files (located in /System/Library/) are deleted and rebuilt by Mac OS X.
  4. Choose Finder > Secure Empty Trash to delete the file.
  5. Restart the system.

Source: https://discussions.apple.com/thread/2105022?start=0&tstart=0

  • 3
    This doesn't work anymore on newer OSs. Commented Oct 1, 2012 at 18:11
  • 2
    I can confirm this doesn't work with Mountain Lion. Disabling the kext still allows the drive to be mounted manually via terminal.
    – user54369
    Commented Aug 2, 2013 at 12:51

The following comment of mine has been deleted but I write it again because I think it can be useful for some people.

"Even though deleting the Kernel Extension does not work anymore on Mountain Lion, what still works is to open a Terminal window and issue a kextunload of the same extension: no USB mass storage volume will be mounted until the next restart."


Steve, there are several ways to achieve this goal. However if you need to do this operation on multiple computers, it can take a lot of time to configure them. And you also have to make sure nothing else is affected besides the USB Mass Storage Devices. The easiest way to go would be to use a software solution to control the removable devices connected to the Macs in your network. This should be a server-client solution, so you can manage everything centrally. Another important aspect to take into consideration is to be able to set allow/deny access on a device quickly in case of an emergency. Enforcing these device policies on Macs where the users have admin rights is also important. You can take a look at Endpoint Protector by CoSoSys, which is considered the market leader for Device Control on Macs, but it works also on Windows and Linux machines.

  • 5
    Please have a look at the FAQ, especially the part about self promotion.
    – nohillside
    Commented Aug 5, 2014 at 11:33

You must log in to answer this question.

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