How To Disable USB Ports In Ubuntu [Quick Tip]

USB Block

Nothing is safe in Cyber world. Even a safe and secure Linux OS like Ubuntu can be hacked in less than 5 minutes. When I was an intern at Mancala Networks, I was working on endpoint protection. One of the things which we wanted to implement in endpoint protection was to disable the USB port. While Linux is (almost) secure from viruses, data theft can occur by means of a removable media.

In this post we’ll see a quick way to disable USB ports in Ubuntu. To this quickly, add anew line in blacklist.conf file. You can use a command like this:

sudo echo "blacklist usb-storage" >> /etc/modprobe.d/blacklist.conf

From next time onwards, no one will be able to use the USB ports. To re-enable the use of USB port, remove the added line from blacklist.conf.

How did you find this quick tip to block USB port in Ubuntu? Do let me know.

About the author
Abhishek Prakash

Abhishek Prakash

Created It's FOSS 11 years ago to share my Linux adventures. Have a Master's degree in Engineering and years of IT industry experience. Huge fan of Agatha Christie detective mysteries πŸ•΅οΈβ€β™‚οΈ

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world


Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.