I am beginner in linux
Is there anyone help me or refer to other post in the forum with this problem
I want a bash script that stops usb to run until you enter the password
I use linux ubuntu 18.04 LTS
thank you very much i want to protect usb ports with password when you plug in usb storage . I have laptop with ubuntu 18.04 installedI could give you one but you have to be more specific. If you disable all usb devices you will probably be unable to type passwords with you keyboard (probably USB, but could be something else).
Do you want to disable all USB or only USB storage ?
BTW the trick is to remove USB kernel modules.
echo "usb_policy ALL = (root) /sbin/modprobe" >> /etc/sudoers
echo "blacklist usb-storage" > /etc/modprobe.d/usb-policy.conf
#!/bin/bash su usb_policy sudo modprobe usb-storage
#!/bin/bash modprobe -r usb-storage