USBGuard can protect you against software-based threats that are distributed on compromised USB memory sticks, such as BadUSB, where the attack commences when you’re manipulated into opening what looks like a document but is a disguised executable. USBGuard cannot protect you against hardware-based threats such as USB Killer devices that cause physical harm to your computer by releasing a high-voltage discharge into your machine.
Actually, USBGuard allows you to set up rules for all manner of different USB devices, including mice, webcams, and keyboards. It’s not just for USB memory sticks. Your computer knows the ID of each USB device, so you can choose which USB devices work in your computer, and which cannot. It’s something like a firewall for USB connectivity.
Warning: The USBGuard daemon runs as soon as it is installed. Make sure you configure USBGuard straight after installing it. If you don’t, all your USB devices will be blocked when you reboot your computer. USBGuard has a neat trick. It has a command that creates a rule allowing all currently connected USB devices to continue work unhindered.
See How to Protect Your Linux Computer From Rogue USB Drives
USB memory sticks can be used to steal data from your Linux computer. USBGuard lets you set rules governing the use of USB memory sticks, like a firewall for USB storage devices. Here’s how it works and how you can set it up.