Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Blacklisting a kernel module would disable the microphone for all users. I have set up a restricted user, who should not be able to use the microphone. The restricted user should, however be able to have sound output. Is there a way of reliably disabling the microphone for a restricted user?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

After experimenting a lot this seems to be the solution:

sudo setfacl -m u:user:- /dev/snd/pcmC0D0c 

On my computer, /dev/snd/pcmC0D0c is the microphone. Blocking write access for a specific user seems to forbid capturing. With the above command, I reduce the rights for the user "user" to --- (check with getfacl /dev/snd/pcmC0D0c), which does not allow for capturing sound.

Hint: for finding microphones in /dev/snd/ the c for capturing at the end of the name may be an indicator.

NOTE: As all changes made to /dev/ will be lost at reboot, as these files are placed in RAM, you would have to additionally add the above command (without sudo as /etc/rc.local is executed with root rights at boot) to /etc/rc.local before the "exit 0" line.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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