
{"id":7858,"date":"2018-06-21T16:14:34","date_gmt":"2018-06-21T16:14:34","guid":{"rendered":"http:\/\/ubuntuhandbook.org\/?p=7858"},"modified":"2024-08-23T14:09:12","modified_gmt":"2024-08-23T14:09:12","slug":"disable-webcam-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2018\/06\/disable-webcam-ubuntu-18-04\/","title":{"rendered":"Disable Your Laptop&#8217;s Webcam in Ubuntu 24.04 | 22.04"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/webcan-icon.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-47089\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/webcan-icon-250x250.webp\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/webcan-icon-250x250.webp 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/webcan-icon-300x300.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/webcan-icon-700x700.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/webcan-icon-768x768.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/webcan-icon.webp 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p><b>This tutorial shows how to disable your laptop&#8217;s built-in webcam in Ubuntu 24.04, Ubuntu 22.04, Ubuntu 20.04, and Ubuntu 18.04.<\/b><\/p>\n<p>If you rarely use the webcam in your laptop, then it&#8217;s a good choice to disable it for privacy and security reasons. Some laptops have physical buttons to do the job, but most others do NOT.<\/p>\n<p>Besides covering your webcam with a sticky note, here&#8217;s how to configure your Ubuntu to soft-block using Kernel module option.<\/p>\n<p><!--more--><\/p>\n<h3>Option 1: Disable Only Internal Laptop Webcam<\/h3>\n<p>If you want to disable the internal laptop webcam, and use the one attached via USB, then you may create a udev rule to auto-remove the device as soon as it is detected.<\/p>\n<p><b>1.<\/b> First, press <code>Ctrl+Alt+T<\/code> on keyboard to open up a terminal window. When it opens, run command to find out the ID of your webcam device:<\/p>\n<pre>lsusb<\/pre>\n<p>In the terminal output, identify the device according to the text description. Then, copy the ID xxxx:xxxx (5986:2113 in my case).<\/p>\n<ul>\n<li>The 4 hexadecimal numbers before colon is the Vendor ID.<\/li>\n<li>While the 4 after is the Product ID.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/lsusb-webcam.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47090\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/lsusb-webcam-700x336.webp\" alt=\"\" width=\"610\" height=\"293\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/lsusb-webcam-700x336.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/lsusb-webcam-300x144.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/lsusb-webcam.webp 706w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p><b>2.<\/b> Once you got the ID, run the command below to create (and edit) a udev rule config file:<\/p>\n<pre>sudo nano \/etc\/udev\/rules.d\/40-disable-internal-webcam.rules<\/pre>\n<p>When file opens, add the line below but <strong>replace\u00a0the ID to yours<\/strong>!<\/p>\n<pre>ACTION==\"add\", ATTR{idVendor}==\"5986\", ATTR{idProduct}==\"2113\", RUN=\"\/bin\/sh -c 'echo 1 &gt;\/sys\/\\$devpath\/remove'\"<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/udev-disablewebcam.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47091\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/udev-disablewebcam-700x505.webp\" alt=\"\" width=\"610\" height=\"440\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/udev-disablewebcam-700x505.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/udev-disablewebcam-300x216.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/udev-disablewebcam.webp 706w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>After editing, press Ctrl+S to save changes and Ctrl+X to exit.<\/p>\n<p><b>3.<\/b> Finally, restart your computer! You&#8217;ll see that <code>lsusb<\/code> command no longer find the webcam device, and camera app reports &#8220;No Device Found&#8221;.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/webcam-gone.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47092\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/webcam-gone-700x348.webp\" alt=\"\" width=\"610\" height=\"303\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/webcam-gone-700x348.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/webcam-gone-300x149.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/webcam-gone-768x382.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/webcam-gone-1320x656.webp 1320w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/webcam-gone.webp 1376w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h3>Option 2: Disable the Kernel Module for Webcam<\/h3>\n<p>If you want to disable webcam completely in Ubuntu, just un-load and block the Linux USB Video Class (UVC) driver.<\/p>\n<h4>Disable uvcvideo Module Temporarily<\/h4>\n<p>You can disable your webcam device to prevent it from working temporarily by un-load the Kernel module.<\/p>\n<p>To do so, simply open up a terminal window, and run command:<\/p>\n<pre>sudo modprobe --remove uvcvideo<\/pre>\n<p>Your webcam will stop working immediately, until system reboot or manually re-load the kernel module.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/remove-uvcvideo.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47093\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/remove-uvcvideo-700x285.webp\" alt=\"\" width=\"610\" height=\"248\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/remove-uvcvideo-700x285.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/remove-uvcvideo-300x122.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/remove-uvcvideo.webp 706w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>At any time, you may re-load the module to make the webcam work again, by running command:<\/p>\n<pre>sudo modprobe uvcvideo<\/pre>\n<h4>To permanently disable webcam in Ubuntu:<\/h4>\n<p>To permanently disable the webcam, simply add the rule to block the kernel module on every boot.<\/p>\n<p>To do so, open terminal (Ctrl+Alt+T) and run command to edit the configuration file:<\/p>\n<pre>sudo nano \/etc\/modprobe.d\/blacklist.conf<\/pre>\n<p>When the file opens, add two new lines below:<\/p>\n<pre>#Disable webcam\r\nblacklist uvcvideo<\/pre>\n<p>Finally, press Ctrl+S to save and Ctrl+X to exit. You Ubuntu will read the file and block the driver next time you boot the system.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/block-uvcvideo.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-47094\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/block-uvcvideo-700x505.webp\" alt=\"\" width=\"610\" height=\"440\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/block-uvcvideo-700x505.webp 700w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/block-uvcvideo-300x216.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2018\/06\/block-uvcvideo.webp 706w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<h3>Summary<\/h3>\n<p>In this tutorial, I&#8217;ve shown you how to disable webcam for your laptop in Ubuntu Linux.<\/p>\n<p>To disable internal laptop webcam, while allowing the one attached via USB, you may add a udev rule to tell to auto-remove the built-in device as soon as it is detected on system boot.<\/p>\n<p>To disable webcam completely, you may either un-load the Kernel driver that works until reboot, or add a rule to block loading that driver on every boot.<\/p>","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to disable your laptop&#8217;s built-in webcam in Ubuntu 24.04, Ubuntu 22.04, Ubuntu 20.04, and Ubuntu 18.04. If you rarely use the webcam in your laptop, then it&#8217;s a good choice to disable it for privacy and security reasons. Some laptops have physical buttons to do the job, but most others do [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":47089,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[1548],"class_list":["post-7858","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-disable-webcam-in-ubuntu"],"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/7858","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=7858"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/7858\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/47089"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=7858"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=7858"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=7858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}