How to disable USB drive in Linux

(Applicable to other Linux distributions also)

1. Login as root,

2. Open /etc/modprobe.d/no-usb for edit (create this file if it’s not exists),

3. Append this line to the no-usb file (in step-2) and save it:

install usb-storage /bin/true

Reboot server to enforce change.
To confirm USB mass storage support has disabled, just execute

lsmod | grep -i usb or try plug in USB drive to confirm.

Leave a Reply