Webcam – How to Disable a Webcam in Ubuntu

webcam

I have an integrated webcam in my laptop. I know that it works and that ubuntu recognized it because at installation it asked if I wanted a photo taken for some kind of image associated with my account. When I look in system settings, I do not see any webcam in the hardware section. I would like to disable the webcam like you can do in Windows, but as I can't find it in my hardware section, how can I disable it? I cannot even unplug it as it is integrated into the monitor. Am I looking in the wrong place?? I am using 12.04

Best Answer

Run:

# pre ubuntu 18.04
gksu gedit /etc/modprobe.d/blacklist.conf

# --- OR ---

# ubuntu 18.04 and later
gedit admin:///etc/modprobe.d/blacklist.conf

Add

blacklist uvcvideo

at the bottom. Save the file and quit the text editor.

Regarding the comment:

Find the vendor and device id for the webcam with lsusb:

Bus 001 Device 002: ID 05a9:2640 OmniVision Technologies, Inc. OV2640 Webcam

Next ...

cd /sys/bus/usb/devices/
ls 

Do a "grep" on the vendor id and product id:

$ grep 05a9 */idVendor
1-1/idVendor:05a9

$ grep 2640 */idProduct
1-1/idProduct:2640

and 1-1 is what you need. cd into 1-1.

The file bConfigurationValue in this directory needs to contain a 0 to disable the device or a 1 to enable it. But this file is owned by root so to alter it (change the 0 to a 1 to enable) ...

 sudo -i
 echo 0 > bConfigurationValue

to disable. You can check the camera and it will be disabled.

This is not permanent yet. A reboot will set it back to what is was before. To make it permanent:

 sudo -i
 echo 0 > /sys/bus/usb/devices/1-1/bConfigurationValue

(where 1-1 is the directory we used and use a 1 to enable)