I installed Ubuntu 17.04

I have two users, and administrator an a standard user.

I want to disable the standard user from using the usb mass storage. The reason is i don't want standard users to be able to copy things from the computer into usb's or viceversa.

I have search on askubuntu and google and tried this:

1- Blacklist the usb_storage module by adding blacklist usb_storage to /etc/modprobe.d/blacklist.conf.

2 - Remove the standard user from the group plugdev

I already rebooted. None of this proposed solutions are working.

Does anyone knows how to do this on ubuntu 17.04? (disable non admin users from being able to use the usb ports).

Also: I dont mind the usb ports to be disable to everyone, as long as i can enable them again using a sudo command.

Thanks in advanced.


In addition to adding the line blacklist usb_storage to /etc/modprobe.d/blacklist.conf, you also have to:

add the following line to /etc/rc.local just before exit 0:

modprobe -r usb_storage

Then reboot.

Then, [only] Users with administrator privileges will be able to mount USB storage devices by typing:

sudo modprobe usb_storage

  • Thanks, but there is no rc.local (apparently) on ubuntu 17.04 or at least on mine, cause when i do: sudo vim /etc/rc.local it opens an empty document. – Luis Muzquiz Jun 8 '17 at 14:01
  • I already tried to enable rc-local by doing: sudo systemctl enable rc-local.service. But i get long message as a response stating that The unit files have no installation config section and that that means they are not meant to be enabled using systemctl. – Luis Muzquiz Jun 8 '17 at 14:10
  • Just add the line to rc.local as I said in my answer and reboot. nowhere in my answer did I say anything about running systemctl – jones0610 Jun 8 '17 at 15:40
  • Ok. I created the /etc/rc.local document using vim (cause there was no such document, that was what i was trying to explain before) and added the lines you said before (modprobe -r usb_storage) and (exit 0) did a reboot. Still not working – Luis Muzquiz Jun 8 '17 at 16:09
  • With all due respect, you need to slowly and carefully follow the steps in my answer without any side trips to run systemctl, create new files and so on. I'm not familiar with 17.04 but /etc/rc.local is a system owned legacy file that has been part of the UNIX startup model for ages. ls -l /etc/rc.local should return a file that is 755 root:root. In the unlikely event that the team moved this file, you could always look around for it by typing sudo find / -name "rc.local". There should be two. One in /etc and one in /etc/init.d. The one in /etc is the one you want to edit. – jones0610 Jun 8 '17 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.