How to disable USB ports on Windows, Mac and Linux
Now, you know that using a USB storage device on your computer has many potential security risks. If you fear the risk of being infected with malware, such as trojian, keyloggers or ransomware, you should completely disable the USB storage device if the system has a lot of sensitive data.
Now, you know that using a USB storage device on your computer has many potential security risks. If you fear the risk of being infected with malware, such as trojian, keyloggers or ransomware, you should completely disable the USB storage device if the system has a lot of sensitive data. The article will show you how to disable USB ports on Windows, Mac and Linux.
Disable USB storage device: advantages and disadvantages
If you are worried about the possibility of malware infection on your computer via USB storage device, you should consider disabling this support. However, this job has certain disadvantages.
- 5 signs of computer infection with malware
The first drawback is that you cannot use USB storage devices on your computer. If you can use cloud memory easily, this is not a problem. However, if you need a device to exchange data regularly between two computers and cannot use cloud storage, it will be very difficult. You can look at tools like Resilio Sync to create a virtual sharing between PC computers.
If you still want to disable USB storage, the article will guide you through the steps to take on Windows 10, Mac and Ubuntu 18.04.
How to disable USB storage device on Windows
Blocking USB storage devices on Windows computers is very simple. You also have a few options; The first two solutions below are for Windows 10 Home PC.
1. Edit the Registry manually
Open the registry by pressing Win + R , then enter " regedit ".
Agree to User Account Control notification, then browse to HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesUSBSTOR. Here, double-click Start (or right-click, choose Modify ) and edit the value.
To turn off, change the value to 4. If you need to turn on the USB port again at any time, just change it back to 3, click OK when done. Note that if you are going to change the registry system, you should back up the registry to prevent a problem.
2. Create a registry script
Alternatively, you can create two blank TXT files in Notepad. To do so, launch the text editor and enter the following line:
- These "hack" tips are only Notepad can do
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesUSBSTOR] "Start"=dword:00000004 [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesUSBSTOREnum] "Count"=dword:00000000 "NextInstance"=dword:00000000
Save the file as disableusb.reg , make sure to change the .TXT file extension to .REG, otherwise this script will not work. Next, repeat the above process and save as enableusb.reg.
For the second file, edit the line:
"Start"=dword:00000004
City:
"Start"=dword:00000003
Save the file after it's done. Now whenever you need to disable USB storage device, run the file disableusb.reg. However, any device that has been plugged into the computer will not be affected, until withdrawn. If you need to re-enable the USB storage device, use the file enableusb.reg. Saving files somewhere easy to remember can be found when needed.
Preventing others from using enableusb.reg is not too difficult, you can set up only the administrator account to run the file, as long as you do not share your profile.
3. Use Group Policy Editor
The third option available for Windows 10 Pro and Enterprise is to modify the settings for the USB storage device in Group Policy Editor.
Press Win + R to open the Run dialog box and enter " gpedit.msc ". This will open the Group Policy Editor, then expand Administrative Templates> System> Removable Storage Access . In the right pane, you will see some items that control media access on the computer. You need to activate the following three options:
- Removable Disks: Deny execute access
- Removable Disks: Deny read access
- Removable Disks: Deny write access
Then, double click on each item and click the Enabled button. Click OK to confirm before moving on to the next item.
Now, whenever you plug a USB storage device into your computer, you will receive an Access is denied message on Windows Explorer when trying to open the drive letter. To reverse this, change the three settings above and set to Disabled .
- Summary of some simple ways to disable USB ports on Windows computers
How to disable USB storage devices on a Mac
To restrict USB storage devices on a Mac, you first need to disable System Integrity Protection (SIP). Then open Utilities> Terminal and remove the driver.
Note: you should only disable this feature when necessary because many people advise you not to do so, refer to the article Why shouldn't you disable the System Integrity Protection feature on a Mac? for information.
kextunload /System/Library/Extensions/IOUSBMassStorageClass.kext/
Next, open / System / Library / Extensions and rename the file (or move to a safe place) IOUSBMassStorageClass.kext . You should replace something that is easy to remember so you can easily find it when you want to re-enable the USB storage device.
When you're done, go back to Terminal and enter:
sudo touch /System/Library/Extensions
This removes the cache files, forcing the build back without reference to the renamed file. Now, you cannot access USB storage devices when connecting.
How to disable USB storage device on Linux
Need to block a USB storage device on your computer? To do this, open Terminal and use the mv (move) command to 'hide' the USB driver:
sudo mv /lib/modules/ $( uname -r) /kernel/drivers/usb/storage/usb-storage.ko /home/user1
Now, when plugged into the USB storage device, it will not work. In short, you cannot access this device. However, this change will no longer work in the case of a kernel update.
Although USB storage devices and portable flash can be password protected, it cannot prevent thieves from stealing your data. The only real solution is USB access control. When staying at home you need to make sure no one accesses your computer without your permission and should lock it when not in use. In the workplace, limit the number of users accessing USB to be manageable.
See more:
- Disable USB drives, CD-ROM, Floppy Disk and LS-120 with Group Policy
- Summary of some ways to fix USB Device Not Recognized on Windows 7, 8 and 10
- 12 USB drives can keep your data safe
You should read it
- Summary of some simple ways to disable USB ports on Windows computers
- How to enable / disable USB drive / port on Windows 7/8/10?
- How to disable the Caps Lock key in Windows 10
- How to disable auto-suspend in Linux
- How to disable Widgets on iOS 10 lock screen?
- How to disable the Insert key in Windows 10
- 3 How to disable BitLocker in Windows 10
- Completely disable the extension for maximum browser security
- How to Disable IPv6 on Ubuntu
- How to turn off Hyper-V on Windows 10, disable Hyper-V
- How to disable keyboard shortcuts and hotkeys on Windows 10
- Disable Windows 10 keyboard in 5 simple ways
Maybe you are interested
Microsoft adds Windows 10 HDR support to Photoshop, Lightroom Huawei was removed from the SD memory card association, will the future of SD memory card slot disappear on Huawei phones? Useful utilities hidden in Mac OSX Instructions for using the Office Lens application to convert image files into written words on Android How to customize the Facebook interface with SC World How to pin messages to chat groups on Viber