<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.archlinux.org/api.php?action=feedcontributions&amp;user=Indigo&amp;feedformat=atom</id>
	<title>ArchWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.archlinux.org/api.php?action=feedcontributions&amp;user=Indigo&amp;feedformat=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/title/Special:Contributions/Indigo"/>
	<updated>2026-05-18T17:14:03Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Category_talk:Digital_signature&amp;diff=875629</id>
		<title>Category talk:Digital signature</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Category_talk:Digital_signature&amp;diff=875629"/>
		<updated>2026-05-17T19:20:34Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* How to group this category? */ re&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to group this category? ==&lt;br /&gt;
&lt;br /&gt;
Given we have [[:Category:OpenPGP]] for the [[OpenPGP]] article/group of implementations, and [[:Category:Transport Layer Security]] with the analogue [[Transport Layer Security]] for everything [[OpenSSL]]/TLS related, what&#039;s the aim for this category (ping @[[User:Davezerave|Davezerave]])?&lt;br /&gt;
&lt;br /&gt;
-- [[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 21:35, 29 February 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
:The new category is meant to collect all pages that concern themselves with creating digital signatures.&lt;br /&gt;
:Examples are articles doing so in all OpenPGP implementations (e.g. [[GnuPG]], and sequoia-pgp, the SOP interfaces in [[Stateless OpenPGP]]) and also for creating data signatures using [[OpenSSL]] (e.g. for release artifacts) or other systems (e.g. signify). [[User:Davezerave|Davezerave]] ([[User talk:Davezerave|talk]]) 20:07, 2 March 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
::Ok. I was asking to figure how we avoid duplication. For example, manually adding [[GnuPG]] to both categories (openpgp and digital signature) would be subject duplication. I read your &#039;&#039;all&#039;&#039; [[:Category:OpenPGP]] implementations as all its assigned articles, hence I&#039;ve changed its parent category with [[Special:diff/802129]]. While we lose a separate entry for OpenPGP in [[:Category:Cryptography]], it has the advantage that the subcategory is separated in its [[:Category:Digital signature]] overview and (mainly) we don&#039;t have to assign some/most openpgp articles to both groups, and the selected additions like [[OpenSSL]] are clearly separated. Does this reflect the plan? --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 12:37, 3 March 2024 (UTC)&lt;br /&gt;
:::Hmm, no not really.&lt;br /&gt;
:::OpenPGP is used both for digital signatures *and* encryption (but there are other mechanisms to do his for either of these two topics!). The OpenPGP category is more suitable as a subcategory of Cryptography than a subcategory of only Digital Signature.&lt;br /&gt;
:::Both Digital Signature and Encryption are suitable subcategories for Cryptography and as mentioned above, both of those topics can be assigned to other articles (not related to OpenPGP). [[User:Davezerave|Davezerave]] ([[User talk:Davezerave|talk]]) 18:12, 11 March 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
::::Yes, both Digital Signature and Encryption can be assigned independent of OpenPGP, that&#039;s not impeded. And, yes, both are subjects to be grouped under Cryptography academically, but I think its too academic for our purpose; most software implements specific protocols, those define the primary use case (category) and why applications depend on them. So, OpenPGP, TLS, OpenSSH, TLS, etc.&lt;br /&gt;
::::What would be a search/use case that is better served by double-assigning Digital Signature and OpenPGP categories separately to these articles?&lt;br /&gt;
::::--[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 19:42, 12 March 2024 (UTC)&lt;br /&gt;
::::There was a new article grouped under this Digital Signature category only ([[Autofirma_(Español)]]), and I&#039;d have trouble to group it otherwise. Also, in the meantime the wiki CSS switched categories to display at the bottom of the articles. That&#039;s much less intrusive if we double-assign articles.&lt;br /&gt;
::::So, let&#039;s keep it like you intended. I keep this item open until I had a go at assigning it to existing articles.&lt;br /&gt;
::::--[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 19:20, 17 May 2026 (UTC)&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Autofirma_(Espa%C3%B1ol)&amp;diff=875628</id>
		<title>Autofirma (Español)</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Autofirma_(Espa%C3%B1ol)&amp;diff=875628"/>
		<updated>2026-05-17T19:09:11Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Véase también */ fix dead link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Digital signature (Español)]]&lt;br /&gt;
[[Category:Software (Español)]]&lt;br /&gt;
&lt;br /&gt;
[https://firmaelectronica.gob.es/Home/Ciudadanos/Apps-Firma.html Autofirma] es una aplicación de firma electrónica desarrollada por el Ministerio de Asuntos Económicos y Transformación Digital de España. Permite firmar documentos localmente y a través del navegador en páginas de la administración pública.&lt;br /&gt;
&lt;br /&gt;
== Instalación ==&lt;br /&gt;
&lt;br /&gt;
[[Instalación (Español)|Instale]] el paquete {{AUR|autofirma}}, disponible en los [[AUR (Español)|Repositorios de Usuarios de Arch (AUR)]].&lt;br /&gt;
&lt;br /&gt;
Este paquete incluye las dependencias necesarias, como el entorno de ejecución de Java (JRE), que es fundamental para su funcionamiento.&lt;br /&gt;
&lt;br /&gt;
== Configuración ==&lt;br /&gt;
&lt;br /&gt;
=== Navegadores web ===&lt;br /&gt;
Para que Autofirma funcione correctamente con navegadores como [[Firefox (Español)|Firefox]] o [[Chromium (Español)|Chromium]], es posible que necesite reiniciar el navegador tras la instalación para que se reconozca el protocolo `afirma://`.&lt;br /&gt;
&lt;br /&gt;
== Uso ==&lt;br /&gt;
&lt;br /&gt;
Puede ejecutar Autofirma desde su menú de aplicaciones o mediante el comando:&lt;br /&gt;
&lt;br /&gt;
 $ autofirma&lt;br /&gt;
&lt;br /&gt;
Al acceder a una sede electrónica que requiera firma, el navegador lanzará automáticamente la aplicación para procesar el certificado digital.&lt;br /&gt;
&lt;br /&gt;
== Solución de problemas ==&lt;br /&gt;
&lt;br /&gt;
=== Problemas con el almacén de certificados ===&lt;br /&gt;
Si Autofirma no detecta sus certificados instalados en el navegador, asegúrese de que el paquete `nss` esté actualizado y que los certificados estén correctamente importados en el almacén de su navegador principal.&lt;br /&gt;
&lt;br /&gt;
== Véase también ==&lt;br /&gt;
* [https://firmaelectronica.gob.es/ciudadanos Sitio oficial de Autofirma]&lt;br /&gt;
* [[Certificados digitales (Español)|Certificados digitales en Arch Linux]]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Talk:Self-encrypting_drives&amp;diff=875623</id>
		<title>Talk:Self-encrypting drives</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Talk:Self-encrypting_drives&amp;diff=875623"/>
		<updated>2026-05-17T18:50:38Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* WD PC SN740 NVMe SSD setup doesn&amp;#039;t work with sedutil */ remove closed item&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Suspend doesn&#039;t work properly ==&lt;br /&gt;
&lt;br /&gt;
Suspend locks the drive (Dell E6410 + Samsung EVO 850) and drive is not accessible after wake up. One solution is to disable Suspend - see https://wiki.archlinux.org/index.php/Polkit#Disable_suspend_and_hibernate&lt;br /&gt;
&lt;br /&gt;
Is possible to unlock drive after wake up?&lt;br /&gt;
-&amp;gt; A fork to sedutil-cli is available that allows providing the password *BEFORE* sleeping such that the system can resume: https://aur.archlinux.org/packages/sedutil-sleep-git/&lt;br /&gt;
[[User:Germafab|Germafab]] ([[User talk:Germafab|talk]]) 12:39, 10 May 2020 (UTC)&lt;br /&gt;
&lt;br /&gt;
== UEFI boot problems on Asus H97M-E ==&lt;br /&gt;
&lt;br /&gt;
Unfortunately, OPAL breaks Linux UEFI boot on my Asus motherboard. I use a dualboot configuration. As I understand it, during the initial boot, when the firmware sees an &amp;quot;empty&amp;quot; SSD it removes all UEFI boot entries. When it gets rebooted after entering the encryption password in the PBA, the firmware notices the EFI boot partition and automatically inserts a single new boot entry (of course, only the Windows one). I have only tested it on Asus H97M-E, but I wouldn&#039;t be surprised to see this behaviour at least on other Asus motherboards.&lt;br /&gt;
&lt;br /&gt;
Maybe the possibility of firmware bugs of this kind should be mentioned in the &amp;quot;disadvantages&amp;quot; section?&lt;br /&gt;
&lt;br /&gt;
[[User:Catnip|Catnip]] ([[User talk:Catnip|talk]]) 14:40, 9 March 2020 (UTC)&lt;br /&gt;
&lt;br /&gt;
:: I see something similar as a consequence of the issue explained in &amp;quot;Troubleshooting: PBA Cold Reboot Locks Drives Again&amp;quot;: after unlocking the drive, if I manage to break the cold reboot (by hitting F2 at the right moment) and do a warm reboot instead, I see the unlocked drive in UEFI, but its boot entry doesn&#039;t work. My workaround is choosing &amp;quot;Boot From File&amp;quot; in UEFI and select the proper grubx64.efi. Then normal boot is possible. But this has to be done for each boot. -- [[User:XX|XX]] ([[User talk:XX|talk]]) 11:18, 3 October 2023 (UTC)&lt;br /&gt;
&lt;br /&gt;
:I&#039;ve added [https://wiki.archlinux.org/index.php?title=Self-encrypting_drives&amp;amp;diff=803377&amp;amp;oldid=803376]. Ideally, we could add example references of such firmware behaviour (bug report, BBS topic). Please add one, if you come across it (must not be yours, but conclusive for a firmware). --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 21:22, 15 March 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Article should be clearer early on about the negatives ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s unfortunate that there&#039;s barely any information on SED/OPAL online. Given that resume from sleep doesn&#039;t work, I suspect many notebook users will not want to go this route at all. While it&#039;s commendable that the article attempts to show the (hacky) ways of getting OPAL to work, I think there should an early notification about the flaky nature of current solutions, so users can make an informed choice.&lt;br /&gt;
&lt;br /&gt;
Having a cautionary message above every section is not the answer. I&#039;d rather the article be rewritten from scratch based on the current state of information. [[User:Adrian5|Adrian5]] ([[User talk:Adrian5|talk]]) 22:00, 25 February 2021 (UTC)&lt;br /&gt;
&lt;br /&gt;
:: According to my experience resume from sleep works. Resume from suspend may not work. -- [[User:XX|XX]] ([[User talk:XX|talk]]) 11:18, 3 October 2023 (UTC)&lt;br /&gt;
&lt;br /&gt;
== cryptsetup support for OPAL ==&lt;br /&gt;
&lt;br /&gt;
Heads-up: If all goes well, the upcoming {{Pkg|cryptsetup}} 2.7.0 gains OPAL support. While it won&#039;t be suitable for pre-boot authentification (whole drive encryption), it will make the hardware features much easier to deploy for individual devices. See the [https://mirrors.edge.kernel.org/pub/linux/utils/cryptsetup/v2.7/v2.7.0-ReleaseNotes release candidate Notes].&lt;br /&gt;
As a first thought how to integrate the new support, the [[Self-encrypting drives#Encrypting a non-root drive]] could be applicable for an initial example once the release lands.? -- [[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 23:10, 12 December 2023 (UTC)&lt;br /&gt;
&lt;br /&gt;
:I am so looking forward to this, it was [https://gitlab.com/cryptsetup/cryptsetup/-/merge_requests/461 merged] 5 months ago. Pottering on how this would fix OPAL and SecureBoot - https://github.com/systemd/systemd/issues/16089#issuecomment-1681980103  [[User:Strykar|What is bash?]] ([[User talk:Strykar|talk]]) 05:04, 25 December 2023 (UTC)&lt;br /&gt;
&lt;br /&gt;
::I did a first test with with a sata ssd. This now triggers a pre-boot pw on uefi and when I plug it into a legacy bios (no tcg support, hence no pre-boot pw), it opens opal with the luks device or also a luks header for opal-only (yay). Performance does not seem to differ with opal-only or opal+luks, could be the drive maxes sata in both cases. What did not work yet was (1) luksFormat on the legacy bios, and a nvme on uefi, (2) a FIDO2 cryptenroll on the opal-only device. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 16:20, 14 January 2024 (UTC)&lt;br /&gt;
::With cryptsetup 2.7.0-1 now in the repo, a luksFormat on legacy bios and a FIDO2 cryptenroll on the opal-only device was now possible. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 21:08, 28 January 2024 (UTC)&lt;br /&gt;
:::Is it possible for you to add some examples to the wiki? [[User:Strykar|What is bash?]] ([[User talk:Strykar|talk]]) 21:02, 2 February 2024 (UTC)&lt;br /&gt;
::::Yes, I&#039;ve collected example output for [[Special:diff/799562]] and will add first paras soon. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 16:27, 4 February 2024 (UTC)&lt;br /&gt;
::::I&#039;ve added initial examples. Welcome to add to it. I have not tried crypttab/resume yet and will add that if no-one is faster. If it works as expected, it should be enough to crosslink dm-crypt/suspend sections. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 19:26, 4 February 2024 (UTC)&lt;br /&gt;
:::::Does anyone know if there are any compatibility issues with [[dm-crypt/Drive preparation#Stacked block devices|stacked block devices]]? My gut says that it should not be possible to place LUKS on top of LVM or mdadm RAID, but {{ic|cryptsetup luksFormat --hw-opal-only}} didn&#039;t complain about creating LUKS on top of a LVM logical volume (a single LV in a single VG in a single PV) when I tested it. Unfortunately I don&#039;t have multiple spare OPAL drives to test RAID configurations. --[[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 10:11, 10 July 2024 (UTC)&lt;br /&gt;
::::::In theory it should work as well, but your gut sensing issues is spot on ([https://github.com/util-linux/util-linux/commit/93ba7961779789217a1f814ce3110ff8c040c8c3], [https://gitlab.com/cryptsetup/cryptsetup/-/issues/873#note_1843634341]). I can&#039;t try it currently, but also think it&#039;s too early to rely on it productively. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 00:55, 14 August 2024 (UTC)&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Talk:ECryptfs&amp;diff=875622</id>
		<title>Talk:ECryptfs</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Talk:ECryptfs&amp;diff=875622"/>
		<updated>2026-05-17T18:49:53Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* eCryptfs is deprecated and unmaintained – add prominent warning?  */ remove closed item&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Automounting ===&lt;br /&gt;
Just a short remark which took me several hours to figure out: &lt;br /&gt;
 &lt;br /&gt;
I tried to follow  3.2 manual setup without ecryptfs-utils and it worked very well until I tried to get my encrypted directory mounted on login. &lt;br /&gt;
&lt;br /&gt;
It is now working and two crucial steps seemed to be:&lt;br /&gt;
1. besides pam_mount.so use also pam_ecryptfs.so&lt;br /&gt;
2. put an empty file &amp;quot;auto-mount&amp;quot; into  /home/USER/.ecryptfs&lt;br /&gt;
&lt;br /&gt;
Especially figuring out 2. has taken a lot of time. It would be good if the article would mention this fact. &lt;br /&gt;
If someone who really knows ecryptfs can verify that I have done the right things, then one should add remarks about this to the page.&lt;br /&gt;
&lt;br /&gt;
Kind regards&lt;br /&gt;
[[User:DaAlx|DaAlx]] ([[User talk:DaAlx|talk]]) 21:20, 25 March 2015 (UTC)&lt;br /&gt;
&lt;br /&gt;
:Hi, can you please put a link here which section you followed? Did you use the ecryptfs-simple package (section 3.2)? Section 3.1 mentions the points you make ([[ECryptfs#Auto-mounting]]). Sections 3.2 and 3.3 dont. I assume you refer to 3.3 [[ECryptfs#Without_ecryptfs-utils]], please confirm. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 06:56, 26 March 2015 (UTC)&lt;br /&gt;
&lt;br /&gt;
::Hi, oh sorry for the imprecise section reference (must have been too tired) So I started my setup with 3.3.2 and followed up to 3.3.2.2. [[Ecryptfs#Auto-mounting_2]] -- [[User:DaAlx|DaAlx]] ([[User talk:DaAlx|talk]]) 08:22, 26 March 2015 (UTC)&lt;br /&gt;
&lt;br /&gt;
:::Thanks. I now re-tried the section 3.3.2 again. My results for the described pam_mount are different though, i.e. I did not need your points (1) and (2) above at all. It mounts like it should, but tor some reason the directory is user-mounted twice and does not unmount on logout. &lt;br /&gt;
:::Not sure what to make of that, maybe someone else has an idea. How do you login (console, gdm, kdm, slim,...)? Did you use the ecryptfs-utils default directory name (~/.Private,~/Private) or another one? Have you modified {{ic|/etc/pam.d/system-auth}} for other reasons before? --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 19:06, 26 March 2015 (UTC)&lt;br /&gt;
:::Edit: Now I figured why I had different results and was able to confirm yours. The reason was that I had an old /etc/modules-load.d autoload for ecryptfs and fuse (needed for other reasons) which I forgot about. Removing that I arrive at your results. The problems described above remain though. I have adjusted the section with [https://wiki.archlinux.org/index.php?title=ECryptfs&amp;amp;diff=367315&amp;amp;oldid=366857], does it reflect your experience now correctly? --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 20:06, 26 March 2015 (UTC)&lt;br /&gt;
&lt;br /&gt;
:::: Hi! Yes, your changes exactly make the right points. Thank you very much. By the way, in the pam mount article there is a remark that auto-umount does not work currently. I also noted the double mounting thing on login --[[User:DaAlx|DaAlx]] ([[User talk:DaAlx|talk]]) 22:20, 26 March 2015 (UTC)&lt;br /&gt;
&lt;br /&gt;
::::: Ok, good. Yes, the auto-umount does not work consistently with just pam_ecryptfs.so as well:[https://wiki.archlinux.org/index.php?title=ECryptfs&amp;amp;diff=365591&amp;amp;oldid=362767] The double-mounting I only noticed with configured pam_mount. Let&#039;s keep this item open a bit, maybe someone has an idea about the cause. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 23:19, 26 March 2015 (UTC)&lt;br /&gt;
&lt;br /&gt;
:::::: With reference to this talk I received a suggestion of a different approach via email. It employs pam_exec instead of pam_mount and it is suggested not to have the unmounting problem. See the short &amp;lt;s&amp;gt;write up&amp;lt;/s&amp;gt; - see below comment. Note it is used on systemd-based debian Jessie and I have not looked into porting/testing it to Arch yet. If someone does, please give some input on your results. Thanks. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 16:36, 14 February 2017 (UTC)&lt;br /&gt;
&lt;br /&gt;
::::::: Hi I am the person responsible for the link [[User:Indigo|Indigo]] posted I have made a second guide which corrects a very bad issue of your password ending up in the journal log, PLEASE MAKE SURE to update the code mentioned in my guide, [https://paste.debian.net/plainh/f2480500 new guide] and make sure to WIPE YOUR JOURNAL if you did use the previous guide. Sorry for the bad error. I will when I am not tethering for Internet spin up an Arch VM and test this on Arch but thus far I have only tested it on Debian. Improvements and reviews of the guide and its code are more than welcome! [[User:KonomiKitten|KonomiKitten]] ([[User talk:KonomiKitten|talk]]) 09:38, 10 March 2017 (UTC)&lt;br /&gt;
&lt;br /&gt;
:::::::: In any case thanks for reporting it! --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 15:06, 10 March 2017 (UTC)&lt;br /&gt;
:::::::: I forgot to mention you can of course just rewrap with the new passphrase after you ran &#039;&#039;passwd&#039;&#039;; more effective than wiping the journal. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 20:41, 17 March 2017 (UTC)&lt;br /&gt;
&lt;br /&gt;
::::::: Hey [[User:Indigo|Indigo]], concerning auto-umount of ecryptfs, I&#039;ve been adapting the solution proposed in [https://wiki.archlinux.org/index.php/Talk:Pam_mount the Pam_mount talk], and it works fine with console, lightdm and gdm logins (meaning the encrypted dir gets cleanly unmounted on logout, provided there are no process left using this dir), at least if one uses Ubuntu tools to encrypt the dir. It involves a different setup of /etc/pam.d (moving pam_ecryptfs.so calls to a separate conf file, so as to stop being interfered by {{ic|systemd --user}}). I am willing to expose it in lieu of the actual warning on auto-umounting ; just thought I could to tell you first. [[User:Lafleur|la Fleur]] ([[User talk:Lafleur|talk]]) 00:06, 13 October 2018 (UTC)&lt;br /&gt;
&lt;br /&gt;
::::::::Hey, thanks for the heads up. Sounds like great news, though I faintly remember the ecryptfs was always arguing that systemd does not warrant respecitve processes accessing the dir being stopped on user logout. Anyhow, please go ahead and share - it sure is something like a show-stopper for Arch usage of the package in some system environments. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 22:27, 14 November 2018 (UTC)&lt;br /&gt;
&lt;br /&gt;
::::::::: Well; I did it at last. Now it seems pretty clear to me, as I tested the setup on 2 machines of daily use. One way or the other, the {{ic|systemd-logind}} process can&#039;t quit on user logout if it did reach {{ic|session pam_ecryptfs.so}} in {{ic|system-auth}}. [[User:Lafleur|la Fleur]] ([[User talk:Lafleur|talk]]) 22:13, 14 September 2020 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Changes to /etc/pam.d/system-auth for auto-mounting ==&lt;br /&gt;
&lt;br /&gt;
Section 2.1.3.2 explains the changes to {{ic|/etc/pam.d/system-auth}} that are required for auto-mounting. As the contents of this file have [https://github.com/archlinux/svntogit-packages/commit/2d5af94ae55a5c98837ce9631f331ad2aad32bb3#diff-8d0411b338c83cd8cd8ad9d9db127101 changed], the guide needs to be updated.&lt;br /&gt;
The following works for me, however, I do not use systemd-homed. So, this needs to be verified / corrected:&lt;br /&gt;
&lt;br /&gt;
Open {{ic|/etc/pam.d/system-auth}} and &#039;&#039;after&#039;&#039; the line containing {{ic|auth       [default&amp;amp;#61;die]               pam_faillock.so      authfail}} add:&lt;br /&gt;
 auth    required    pam_ecryptfs.so unwrap&lt;br /&gt;
Next, &#039;&#039;above&#039;&#039; the line containing {{ic|-password  [success&amp;amp;#61;1 default&amp;amp;#61;ignore]  pam_systemd_home.so}} insert:&lt;br /&gt;
 password    optional    pam_ecryptfs.so&lt;br /&gt;
And finally, &#039;&#039;after&#039;&#039; the line {{ic|session required pam_unix.so}} add:&lt;br /&gt;
 session    optional    pam_ecryptfs.so unwrap&lt;br /&gt;
&lt;br /&gt;
[[User:Bananana|Bananana]] ([[User talk:Bananana|talk]]) 13:09, 19 August 2020 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[User:Msoulier|Msoulier]] ([[User talk:Msoulier|talk]]) 13:13, 10 March 2022 (UTC) So I tried the changes in auto-mount, and the corrections here, and in both cases my login fails. I nearly locked myself out of my laptop. Thankfully I kept a login in a virtual terminal so that I could undo the changes. The ecryptfs-migrate-user script seems to have already set up auto-mounting without modifying pam, as it worked on my first login. Are the pam changes needed?&lt;br /&gt;
&lt;br /&gt;
: You were right ! It was corrected (maybe you did) [[User:Lafleur|la Fleur]] ([[User talk:Lafleur|talk]]) 22:32, 14 September 2020 (UTC)&lt;br /&gt;
&lt;br /&gt;
=== Updating pam.d files used ===&lt;br /&gt;
&lt;br /&gt;
Why do we modify {{ic|system-auth}} ? [https://wiki.archlinux.org/index.php/Pam_mount pam_mount] actually modifies {{ic|system-login}} for {{ic|session}} and {{ic|auth}} instructions, and {{ic|password}} for {{ic|password}} instructions. It seems indeed adapted to process home-mounting sequences on login procedure. And I can really understand that {{ic|su}} fails for the reason that it can&#039;t access home directory if nobody has logged in. [[User:Lafleur|la Fleur]] ([[User talk:Lafleur|talk]]) 22:13, 14 September 2020 (UTC)&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Talk:File_recovery&amp;diff=875621</id>
		<title>Talk:File recovery</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Talk:File_recovery&amp;diff=875621"/>
		<updated>2026-05-17T18:49:17Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /*  dumpe2fs / superblocks */ remove closed item&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Talk:SSH_keys&amp;diff=875620</id>
		<title>Talk:SSH keys</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Talk:SSH_keys&amp;diff=875620"/>
		<updated>2026-05-17T18:46:15Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /*  pam_tally */ remove closed item&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== SSH public key passphrase ==&lt;br /&gt;
&lt;br /&gt;
I think that we should add `ssh -p -k ~/.ssh/id_ed25519.pub` to page, I saw a nice example from https://blog.0xbadc0de.be/archives/300. [[User:Pickfire|Pickfire]] ([[User talk:Pickfire|talk]]) 10:09, 13 April 2016 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Starting ssh-agent as a wrapper  ==&lt;br /&gt;
&lt;br /&gt;
In this section, there is a note which says that you &amp;quot;can&amp;quot; add eval$(ssh-agent) to your .xinitrc. &lt;br /&gt;
&lt;br /&gt;
When using ssh-agent as a wrapper to startx, I have noticed that if I have both -- the alias as well as the eval statement in .xinitrc, it spawns 2 ssh-agent processes. I believe this is a leftover note from earlier when we didn&#039;t have the section titled &amp;quot;ssh-agent&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Can someone confirm and I will remove that note from the &amp;quot;ssh-agent as a wrapper section&amp;quot;, because the way it stands today seems to indicate that you need to do both -- the alias to startx as well as add the eval statement to xinitrc in order for it to work when that is not the case.&lt;br /&gt;
&lt;br /&gt;
[[User:Inxsible|Inxsible]] ([[User talk:Inxsible|talk]]) 00:46, 4 January 2017 (UTC)&lt;br /&gt;
&lt;br /&gt;
:I&#039;m pretty sure the note was intended [https://wiki.archlinux.org/index.php?title=SSH_keys&amp;amp;diff=461444&amp;amp;oldid=460060 like this]. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 20:12, 4 January 2017 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Cleaner systemd-based ssh-agent setup ==&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/environment.d/ssh-agent.conf|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
SSH_AUTH_SOCK=&amp;quot;${XDG_RUNTIME_DIR}/ssh-agent.socket&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/systemd/user/ssh-agent.service|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
[Service]&lt;br /&gt;
ExecStart=/usr/bin/ssh-agent -D -a &amp;quot;${SSH_AUTH_SOCK}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=default.target&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.zshrc or ~/.bash_profile or ~/.profile or the equivalent|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
eval $(systemctl --user show-environment | grep SSH_AUTH_SOCK)&lt;br /&gt;
export SSH_AUTH_SOCK&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Touching three files, instead of two, but the path is defined only in one place. Something similar could be achieved with {{ic|EnvironmentFile}}. Thoughts?&lt;br /&gt;
&lt;br /&gt;
[[User:Jeremejevs|Jeremejevs]] ([[User talk:Jeremejevs|talk]]) 17:22, 23 November 2017 (UTC)&lt;br /&gt;
&lt;br /&gt;
:It&#039;s arguably not cleaner because you need eval, systemctl and grep to extract the path for the shell. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 18:29, 23 November 2017 (UTC)&lt;br /&gt;
&lt;br /&gt;
== SSH Keys generated without -o flag are not safe ==&lt;br /&gt;
&lt;br /&gt;
SSH Keys with default parameters are not safe [https://latacora.singles/2018/08/03/the-default-openssh.html], Hacker News discussion[https://news.ycombinator.com/item?id=17682946]. The wiki already suggests that we use -o for increased brute force protection, the suggested command for generating keys should include this. Would there be any compatibility issues with any mainstream system by always generating keys with this flag?&lt;br /&gt;
&lt;br /&gt;
[[User:Orekix|Orekix]] ([[User talk:Orekix|talk]]) 02:47, 4 August 2018 (UTC)&lt;br /&gt;
&lt;br /&gt;
:Good call. I&#039;m rearranging the section. It was much too detailed on the technical aspects. All we really want to know is which key type to use and why. There could be compatibility issues with older (pre 2014) implementations of OpenSSH. Hopefully no server you&#039;re running has an OS older than 2014.  -- [[User:Rdeckard|Rdeckard]] ([[User_talk:Rdeckard|talk]]) 14:07, 4 August 2018 (UTC)&lt;br /&gt;
&lt;br /&gt;
:: Unfortunately, this flag &amp;quot; -o&amp;quot; is not documented in ssh-keygen&#039;s manual page (man or info). If its usage is recommended in the wiki, I think we would need some more links, references, etc., about what it does, why it&#039;s not in the manual while being implemented and how you&#039;re supposed to find out its existence. [[User:Tétrapyle|Tétrapyle]] ([[User talk:Tétrapyle|talk]]) 09:22, 30 October 2018 (UTC)&lt;br /&gt;
&lt;br /&gt;
:: &#039;&#039;Update&#039;&#039;. Thanks to information kindly [https://bbs.archlinux.org/viewtopic.php?pid=1814785#p1814785 reported] by user /dev/zero, this flag is documented in [https://www.freebsd.org/cgi/man.cgi?query=ssh-keygen&amp;amp;sektion=1&amp;amp;manpath=OpenBSD BSD&#039;s ssh-keygen manpage]. The Gnu/Linux manpage is probably outdated. [[User:Tétrapyle|Tétrapyle]] ([[User talk:Tétrapyle|talk]])&lt;br /&gt;
&lt;br /&gt;
::: As far as I know, OpenSSH 7.8 and above set the OpenSSH format for private keys by default: &amp;quot;ssh-keygen(1): write OpenSSH format private keys by default instead of using OpenSSL&#039;s PEM format. The OpenSSH format, supported in OpenSSH releases since 2014 and described in the PROTOCOL.key file in the source distribution, offers substantially better protection against offline password guessing and supports key comments in private keys. If necessary, it is possible to write old PEM-style keys by adding &#039;-m PEM&#039; to ssh-keygen&#039;s arguments when generating or updating a key.&amp;quot; So, there is no need to set the &amp;quot;-o&amp;quot; flag anymore if you use OpenSSH &amp;gt; 7.7. --[[User:Ish|Ish]] ([[User talk:Ish|talk]]) 05:39, 8 January 2019 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Intro draft ==&lt;br /&gt;
&lt;br /&gt;
{{Comment|Draft to make the intro and &#039;&#039;Background&#039;&#039; section account for the server perspective. Section levels are only adjusted for the talk page. Copy editing may be done directly, comments should be added in the &#039;&#039;Comments&#039;&#039; subsection. --[[User:Larivact|Larivact]] ([[User talk:Larivact|talk]]) 05:58, 2 January 2019 (UTC)}} &lt;br /&gt;
&lt;br /&gt;
[[SSH]] uses [[Wikipedia:Public-key cryptography|public-key cryptography]] to authenticate servers, optionally it can also be used to authenticate clients.&lt;br /&gt;
&lt;br /&gt;
This article assumes you already have a basic understanding of the [[Secure Shell]] protocol and have [[install]]ed [[OpenSSH]].&lt;br /&gt;
&lt;br /&gt;
=== Key-based client authentication ===&lt;br /&gt;
&lt;br /&gt;
SSH keys can serve as a means of identifying yourself to an SSH server using [[Wikipedia:Challenge-response authentication|challenge-response authentication]]. The major advantage of key-based authentication is that in contrast to password authentication it is not prone to [[Wikipedia:Brute-force attack|brute-force attacks]] and you do not expose valid credentials, if the server has been compromised.[https://tools.ietf.org/html/rfc4251#section-9.4.4]&lt;br /&gt;
&lt;br /&gt;
Furthermore SSH key authentication can be more convenient than the more traditional password authentication. When used with a program known as an SSH agent, SSH keys can allow you to connect to a server, or multiple servers, without having to remember or enter your password for each system.&lt;br /&gt;
&lt;br /&gt;
Key-based authentication is not without its drawbacks and may not be appropriate for all environments, but in many circumstances it can offer some strong advantages. A general understanding of how SSH keys work will help you decide how and when to use them to meet your needs. &lt;br /&gt;
&lt;br /&gt;
==== Background ====&lt;br /&gt;
&lt;br /&gt;
If an SSH server has your [[Wikipedia:Public key|public key]] on file and sees you requesting a connection, it uses your public key to construct and send you a challenge.  This challenge is an encrypted message and it must be met with the appropriate response before the server will grant you access.  What makes this coded message particularly secure is that it can only be understood by the private key holder.  While the public key can be used to encrypt the message, it cannot be used to decrypt that very same message.  Only you, the holder of the private key, will be able to correctly understand the challenge and produce the proper response.&lt;br /&gt;
&lt;br /&gt;
This [[Wikipedia:Challenge-response authentication|challenge-response]] phase happens behind the scenes and is invisible to the user.  As long as you hold the private key, which is typically stored in the {{ic|~/.ssh/}} directory, your SSH client should be able to reply with the appropriate response to the server.&lt;br /&gt;
&lt;br /&gt;
A private key is a guarded secret and as such it is advisable to store it on disk in an encrypted form.  When the encrypted private key is required, a passphrase must first be entered in order to decrypt it.  While this might superficially appear as though you are providing a login password to the SSH server, the passphrase is only used to decrypt the private key on the local system.  The passphrase is not transmitted over the network.&lt;br /&gt;
&lt;br /&gt;
=== Comments ===&lt;br /&gt;
&lt;br /&gt;
So there is a new section title, the &amp;quot;public-key cryptography&amp;quot; was moved into a different sentence and the first paragraph of the current Background section is gone:&lt;br /&gt;
&lt;br /&gt;
:SSH keys are always generated in pairs with one known as the private key and the other as the public key. The private key is known only to you and it should be safely guarded. By contrast, the public key can be shared freely with any SSH server to which you wish to connect.&lt;br /&gt;
&lt;br /&gt;
-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 21:04, 10 February 2019 (UTC)&lt;br /&gt;
&lt;br /&gt;
== SSH Agent File Naming ==&lt;br /&gt;
&lt;br /&gt;
The current suggested ssh-agent file name is &amp;quot;~/.ssh-agent-thing&amp;quot;. I think &amp;quot;~/.ssh-agent.rc&amp;quot; would be more apt, as it bears a certain resemblance to other RC files. Moreover, this will leave the file in the user&#039;s home directory as it&#039;s never cleaned up. This could be mitigated by writing it to &amp;quot;/tmp/ssh-agent.rc&amp;quot;, although I&#039;m not sure what side effects this could have (e.g. on a multi-user system), hence proposing it here before changing the sample script on the page.&lt;br /&gt;
&lt;br /&gt;
[[User:CodingKoopa|CodingKoopa]] ([[User talk:CodingKoopa|talk]]) 18:07, 14 August 2019 (UTC)&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;It&#039;s never cleaned up&amp;quot; isn&#039;t a major problem as the script will start a new agent on every boot anyway. But you could put the file at {{ic|$XDG_RUNTIME_DIR/ssh-agent.env}} to get auto-cleanup and avoid multi-user issues.&lt;br /&gt;
:&lt;br /&gt;
:...Or you could just tell ssh-agent to put the socket itself at a fixed location such as {{ic|$XDG_RUNTIME_DIR/ssh-agent.sock}}, avoiding the extra indirection. That&#039;s how the systemd --user example works.&lt;br /&gt;
:&lt;br /&gt;
:[[User:Grawity|grawity]] ([[User talk:Grawity|talk]]) 19:37, 14 August 2019 (UTC)&lt;br /&gt;
&lt;br /&gt;
::I wasn&#039;t able to get it working by using {{ic|-a}} to set the socket location and then evaluate that (I got {{ic|/run/user/1000/ssh-agent.sock: No such device or address}}, so I assume that the socket can&#039;t be used in the way that I thought it could?). Regardless, {{ic|XDG_RUNTIME_DIR}} is exactly what I was looking for. Cheers.&lt;br /&gt;
::&lt;br /&gt;
::[[User:CodingKoopa|CodingKoopa]] ([[User talk:CodingKoopa|talk]]) 20:25, 14 August 2019 (UTC)&lt;br /&gt;
&lt;br /&gt;
Is there a reason why we don&#039;t suggest using the default socket {{ic|$TMPDIR/ssh-XXXXXXXXXX/agent.&amp;lt;ppid&amp;gt;}} mentioned in the ssh-agent manpage? That way there is no need for most of this configuration.&lt;br /&gt;
[[User:JoeCool|JoeCool]] ([[User talk:JoeCool|talk]])&lt;br /&gt;
&lt;br /&gt;
== ssh-agent invocation in .bashrc? ==&lt;br /&gt;
&lt;br /&gt;
In the section for ssh-agent it&#039;s recommended: &amp;quot;add the following to your ~/.bashrc&amp;quot;. I suggest changing that to .bash_profile, because of the following error.&lt;br /&gt;
&lt;br /&gt;
Programs like scp or rsync use ssh, and that calls .bashrc. The command &amp;quot;eval `ssh-agent`&amp;quot; outputs agent pid, which makes these programs fail.&lt;br /&gt;
&lt;br /&gt;
Since .bash_profile is for a login shell, it won&#039;t cause this problem (it doesn&#039;t).&lt;br /&gt;
&lt;br /&gt;
[[User:Ynikitenko|Ynikitenko]] ([[User talk:Ynikitenko|talk]]) 11:54, 26 February 2020 (UTC)&lt;br /&gt;
&lt;br /&gt;
:{{ic|.bashrc}} is sourced only for interactive shells, scp and rsync don&#039;t invoke an interactive shell on the remote host. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 12:55, 26 May 2020 (UTC)&lt;br /&gt;
&lt;br /&gt;
== ssh-agent systemd ==&lt;br /&gt;
&lt;br /&gt;
I tried setting &lt;br /&gt;
&lt;br /&gt;
   SSH_AUTH_SOCK DEFAULT=&amp;quot;${XDG_RUNTIME_DIR}/ssh-agent.socket&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in ~/.zshrc but it didn&#039;t work.  Supplied the solution of:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the file&lt;br /&gt;
&lt;br /&gt;
    ~/.pam_environment&lt;br /&gt;
&lt;br /&gt;
put &lt;br /&gt;
&lt;br /&gt;
    SSH_AUTH_SOCK DEFAULT=&amp;quot;${XDG_RUNTIME_DIR}/ssh-agent.socket&amp;quot;&lt;br /&gt;
&lt;br /&gt;
which works, so I think this is the better solution.&lt;br /&gt;
&lt;br /&gt;
{{Unsigned|18:23, 16 April 2021 (UTC)|Fenton.travers}}&lt;br /&gt;
&lt;br /&gt;
:You are not supposed to put the {{ic|DEFAULT}} after the first space in the variable for your shell. This is the syntax for {{ic|~/.pam_environment}}.&lt;br /&gt;
:-- [[User:NetSysFire|NetSysFire]] ([[User talk:NetSysFire|talk]]) 18:33, 16 April 2021 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== certificates ==&lt;br /&gt;
&lt;br /&gt;
There&#039;s no mention of certificates. Did I fail at searching? Or should we add it here?&lt;br /&gt;
&lt;br /&gt;
[[User:Gcb|Gcb]] ([[User talk:Gcb|talk]]) 01:18, 18 August 2021 (UTC)&lt;br /&gt;
&lt;br /&gt;
:This page covers the public key authentication, not certificate authentication. Feel free to draft a new page about SSH certificates in your user page. — [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 05:52, 19 August 2021 (UTC)&lt;br /&gt;
&lt;br /&gt;
== AddKeysToAgent Option ==&lt;br /&gt;
&lt;br /&gt;
The option to automatically add keys to the agent on first use is already mentioned in a tip at the ssh-agent section, however I would argue that its better to have this mentioned in the subsection for better visibility. When I tried to find a way to implement what this option does, I did not find this option in the wiki despite reading most of it. The subsection should make it easier to find. It may also be a good idea to mention this option in the chapters for external helper applications such as keychain, since many use cases for these programs are covered by OpenSSH natively after the new option was introduced. — [[User:Valoq|Valoq]] ([[User talk:Valoq|talk]]) 14:46, 16 October 2022 (UTC)&lt;br /&gt;
&lt;br /&gt;
:The tip is more accurate, shows all the options instead of just &amp;quot;yes&amp;quot;, and I think the formatting in a green box stands out sufficiently. There will always be somebody who will not find even the section. — [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 15:21, 16 October 2022 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Server perspective is ignored ==&lt;br /&gt;
&lt;br /&gt;
There is an expansion notice at the beginning with the reason:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The intro and &#039;&#039;Background&#039;&#039; section ignore the server perspective.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
I couldn&#039;t understand what that means. Mentioned sections state the relation between SSH keys and an SSH server. Or aren&#039;t those statements enough? [[User:Ismailarilik|Ismailarilik]] ([[User talk:Ismailarilik|talk]]) 07:51, 7 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
:The page describes how a user can create their client key for identifying themselves to an SSH server, but each SSH server must also have a key that clients can use to verify that they connect to the right server. I think if you search for &amp;quot;SSH host key&amp;quot;, you will find some text on this topic. — [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 21:24, 8 March 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Section 5.2 agent refused operation ==&lt;br /&gt;
&lt;br /&gt;
It appears that the problem described in this paragraph:&lt;br /&gt;
&lt;br /&gt;
There is currently an open [https://bugzilla.mindrot.org/show_bug.cgi?id=3572 bug] that triggers with the &amp;quot;agent refused operation&amp;quot; error when using authenticator keys like ED25519-sk and ECDSA-SK that were created with the option &amp;lt;code&amp;gt;-O verify-required&amp;lt;/code&amp;gt;. To avoid this issue, use the &amp;lt;code&amp;gt;-o IdentityAgent=none -o IdentitiesOnly=yes&amp;lt;/code&amp;gt; option for the &amp;lt;code&amp;gt;ssh&amp;lt;/code&amp;gt; command or add it to your &amp;lt;code&amp;gt;ssh_config&amp;lt;/code&amp;gt; file for the relevant hosts:&lt;br /&gt;
&lt;br /&gt;
has been fixed in OpenSSH 10.0.  At least it works for me now without any intervention. [[User:Eta-carinae|Eta-carinae]] ([[User talk:Eta-carinae|talk]]) 21:06, 17 April 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
== AddKeysToAgent requires default key names ==&lt;br /&gt;
&lt;br /&gt;
I noticed that the {{ic|AddKeysToAgent}} option doesn&#039;t work if the public and private keys aren&#039;t named one of the default options presented when generating them. &lt;br /&gt;
&lt;br /&gt;
More specifically: running {{ic|ssh -vT git@github.com}}, for example, gives:&lt;br /&gt;
&lt;br /&gt;
{{bc|[...]&lt;br /&gt;
debug1: Next authentication method: publickey&lt;br /&gt;
debug1: get_agent_identities: bound agent to hostkey&lt;br /&gt;
debug1: get_agent_identities: ssh_fetch_identitylist: agent contains no identities&lt;br /&gt;
debug1: Will attempt key: /home/user/.ssh/id_rsa&lt;br /&gt;
debug1: Will attempt key: /home/user/.ssh/id_ecdsa&lt;br /&gt;
debug1: Will attempt key: /home/user/.ssh/id_ecdsa_sk&lt;br /&gt;
debug1: Will attempt key: /home/user/.ssh/id_ed25519&lt;br /&gt;
debug1: Will attempt key: /home/user/.ssh/id_ed25519_sk&lt;br /&gt;
debug1: Will attempt key: /home/user/.ssh/id_xmss&lt;br /&gt;
debug1: Trying private key: /home/user/.ssh/id_rsa&lt;br /&gt;
debug1: Trying private key: /home/user/.ssh/id_ecdsa&lt;br /&gt;
debug1: Trying private key: /home/user/.ssh/id_ecdsa_sk&lt;br /&gt;
debug1: Trying private key: /home/user/.ssh/id_ed25519&lt;br /&gt;
debug1: Trying private key: /home/user/.ssh/id_ed25519_sk&lt;br /&gt;
debug1: Trying private key: /home/user/.ssh/id_xmss&lt;br /&gt;
debug1: No more authentication methods to try.&lt;br /&gt;
git@github.com: Permission denied (publickey).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Assuming that this is correct (I am making this discussion page partly because I&#039;m not 100% sure it isn&#039;t), I think a note or warning has to be added next to the existing note on {{ic|AddKeysToAgent}}, in the section on generating keys, or in both to clarify this. Personally, I feel a note/warning next to the {{ic|AddKeysToAgent}} note would be best; if a user generated their keys with a non-default name they can just do {{ic|mv oldname default}} without needing to regenerate them. [[User:Elizabeth|Elizabeth]] ([[User talk:Elizabeth|talk]]) 21:31, 14 May 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
:If you &amp;quot;add a key to the agent&amp;quot;, it doesn&#039;t mean that you can move the original key anywhere in the file system. Identities are specified by path (see {{man|5|ssh_config|IdentityFile}}) and when the file does not exist, you get the error above. This has nothing to do with {{ic|AddKeysToAgent}}. — [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 15:09, 25 May 2025 (UTC)&lt;br /&gt;
::Noted, ill explore why what I did worked to fix this for me on my own then, and thanks for the help. [[User:Elizabeth|Elizabeth]] ([[User talk:Elizabeth|talk]]) 18:08, 27 May 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Info on SSH Agent is obsolete ==&lt;br /&gt;
&lt;br /&gt;
Many things about using an SSH agent are now obsolete, and will just confuse users. I suggest:&lt;br /&gt;
&lt;br /&gt;
1. Removing the section on using ssh-agent as a wrapper program.&lt;br /&gt;
&lt;br /&gt;
2. Removing the OpenPGP card ssh-agent section, and moving it to the OpenPGP page (just like it is done for GnuPH Agent).&lt;br /&gt;
&lt;br /&gt;
3. Removing, or shortening Keychain section. I&#039;ve used keychain for a long time myself; but now with the systemd activated socket (which can last multiple login sessions), and GPG handling it&#039;s own agent automatically, there&#039;s no reason to use keychain anymore. Move it to it&#039;s own page, and link to it from here.&lt;br /&gt;
&lt;br /&gt;
4. The x11-ssh-askpass section belongs in the Keychain section, and not it&#039;s own subsection of ssh agents. (IMO it belongs in a separate page about keychain, which can be linked to from here.)&lt;br /&gt;
&lt;br /&gt;
--[[User:Gi1242|Gi1242]] ([[User talk:Gi1242|talk]]) 13:58, 10 August 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
:Honestly, after introducing ssh-agent, instead of the BashFu to ensure only one copy is running I would suggest:&lt;br /&gt;
:{{bc|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
:if [[ -z $SSH_CONNECTION &amp;amp;&amp;amp; -z $SSH_AUTH_SOCK ]]; then&lt;br /&gt;
:    export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket&lt;br /&gt;
:fi&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
:If the ssh agent is needed in systemd user scripts, then also do {{ic|&amp;lt;nowiki&amp;gt;systemctl --user set-environment SSH_AUTH_SOCK=$SSH_AUTH_SOCK&amp;lt;/nowiki&amp;gt;}} [[User:Gi1242|Gi1242]] ([[User talk:Gi1242|talk]]) 14:14, 10 August 2025 (UTC)&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Yt-dlp&amp;diff=875445</id>
		<title>Yt-dlp</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Yt-dlp&amp;diff=875445"/>
		<updated>2026-05-16T13:36:38Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Format selection */ add example for bestvideo, analog to bestaudio below&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Lowercase title}}&lt;br /&gt;
[[Category:Download utilities]]&lt;br /&gt;
[[Category:Streaming]]&lt;br /&gt;
[[de:yt-dlp]]&lt;br /&gt;
[[es:Yt-dlp]]&lt;br /&gt;
[[ja:Youtube-dl]]&lt;br /&gt;
[[pl:Youtube-dl]]&lt;br /&gt;
[[uk:Youtube-dl]]&lt;br /&gt;
[[zh-hans:yt-dlp]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|mpv}}&lt;br /&gt;
{{Related|FFmpeg}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;yt-dlp&#039;&#039;&#039; is a command-line program that lets you easily download videos and audio from more than a thousand websites. See the [https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md list of supported sites]. &lt;br /&gt;
&lt;br /&gt;
{{Note|yt-dlp is a fork of [https://ytdl-org.github.io/youtube-dl/ youtube-dl] that was created after the parent project became stagnant. The upstream youtube-dl can still be [[install]]ed as {{AUR|youtube-dl}}; commands on this page should still work, but check the [https://github.com/yt-dlp/yt-dlp#differences-in-default-behavior list of differences].}}&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
[[Install]] the {{Pkg|yt-dlp}} package. See the optional dependencies, a notable one to install is [[FFmpeg]] for muxing on some sites. &lt;br /&gt;
&lt;br /&gt;
There are also various [https://www.reddit.com/r/youtubedl/wiki/info-guis graphical frontends] to yt-dlp, such as {{AUR|tartube}} and {{AUR|yt-dlg-git}}. &lt;br /&gt;
&lt;br /&gt;
You can also install {{AUR|yt-dlp-drop-in}} which provides a dummy {{ic|/usr/bin/youtube-dl}} executable (that just redirects to &#039;&#039;yt-dlp&#039;&#039;) for outdated programs that still look for a &#039;&#039;youtube-dl&#039;&#039; executable.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The system-wide configuration file is {{ic|/etc/yt-dlp.conf}} and the user-specific configuration file is {{ic|~/.config/yt-dlp/config}}. The syntax is simply one command-line option per line. Example configuration:&lt;br /&gt;
&lt;br /&gt;
 --ignore-errors&lt;br /&gt;
 # --no-playlist&lt;br /&gt;
 &lt;br /&gt;
 # Save in ~/Videos&lt;br /&gt;
 -o ~/Videos/%(title)s.%(ext)s&lt;br /&gt;
 &lt;br /&gt;
 # Prefer 1080p or lower resolutions&lt;br /&gt;
 -f bestvideo[height&amp;lt;=?1080]+bestaudio/best&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/yt-dlp/yt-dlp/blob/master/README.md#configuration] for more information.&lt;br /&gt;
&lt;br /&gt;
A custom configuration file can also be specified with:&lt;br /&gt;
&lt;br /&gt;
 $ yt-dlp &#039;&#039;URL&#039;&#039; --config-locations &#039;&#039;PATH&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
See {{man|1|yt-dlp}} for the manual.&lt;br /&gt;
&lt;br /&gt;
 $ yt-dlp [OPTIONS] &#039;&#039;URL&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{tip|In some cases (like YouTube) {{ic|&#039;&#039;URL&#039;&#039;}} can be substituted with the video ID.}}&lt;br /&gt;
&lt;br /&gt;
=== Format selection ===&lt;br /&gt;
&lt;br /&gt;
When multiple formats of a video are available, &#039;&#039;youtube-dl&#039;&#039; will download the best ones by default.&lt;br /&gt;
&lt;br /&gt;
To get a list of the available formats:&lt;br /&gt;
&lt;br /&gt;
 $ yt-dlp -F &#039;&#039;URL&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To select a specific one to download:&lt;br /&gt;
&lt;br /&gt;
 $ yt-dlp -f &#039;&#039;format&#039;&#039; &#039;&#039;URL&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To automatically select the best video format, but exclude specific formats - for example, when the system does not support H.265:&lt;br /&gt;
&lt;br /&gt;
 $ yt-dlp -f &amp;quot;bestvideo[vcodec!=h265]+bestaudio&amp;quot; &#039;&#039;URL&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Extract audio ===&lt;br /&gt;
&lt;br /&gt;
Use {{ic|-x}} for audio-only downloads (requires [[FFmpeg]]):&lt;br /&gt;
&lt;br /&gt;
 $ yt-dlp -x -f bestaudio &#039;&#039;URL&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Depending on the available source streams, this will often correct the audio-only container. If an audio-only stream is not available, exclude {{ic|-f bestaudio}} from the example above. This will download the video and copy its audio as post process. By default this will remove the downloaded video, include {{ic|-k}} to keep it.&lt;br /&gt;
&lt;br /&gt;
To also include album art (requires {{Pkg|atomicparsley}}):&lt;br /&gt;
&lt;br /&gt;
 $ yt-dlp -x -f bestaudio[ext=m4a] --add-metadata --embed-thumbnail &#039;&#039;URL&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Subtitles ===&lt;br /&gt;
&lt;br /&gt;
To see which languages are available:&lt;br /&gt;
&lt;br /&gt;
 $ yt-dlp --list-subs &#039;&#039;URL&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To download a video with selected subtitles (comma separated):&lt;br /&gt;
&lt;br /&gt;
 $ yt-dlp --write-sub --sub-lang &#039;&#039;LANG&#039;&#039; &#039;&#039;URL&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For auto-generated subtitles:&lt;br /&gt;
&lt;br /&gt;
 $ yt-dlp --write-auto-sub --sub-lang &#039;&#039;LANG&#039;&#039; &#039;&#039;URL&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add {{ic|--skip-download}} to get only subtitles.&lt;br /&gt;
&lt;br /&gt;
=== Cookies ===&lt;br /&gt;
&lt;br /&gt;
To import cookies add the {{ic|--cookies-from-browser &amp;lt;browser&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Example of importing cookies from chromium&lt;br /&gt;
&lt;br /&gt;
 $ yt-dlp --cookies-from-browser chromium &#039;&#039;URL&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Faster downloads ===&lt;br /&gt;
&lt;br /&gt;
Some websites throttle transfer speeds. You can often get around this by choosing non DASH streams or by using [[aria2]], an external downloader which supports multi-connection downloads. For example:&lt;br /&gt;
&lt;br /&gt;
 $ yt-dlp --downloader aria2c --downloader-args &#039;-c -j 3 -x 3 -s 3 -k 1M&#039; &#039;&#039;URL&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Playlist ===&lt;br /&gt;
&lt;br /&gt;
Using youtube-dl for a playlist usually boils down to the following options:&lt;br /&gt;
&lt;br /&gt;
 $ yt-dlp --ignore-errors --continue --no-overwrites --download-archive progress.txt &#039;&#039;usual options&#039;&#039; &#039;&#039;URL&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This set of options allow for the download to effectively continue even after interruption. If you are archiving, add the usual {{ic|--write-xxx}} and {{ic|--embed-xxx}} options you may have.&lt;br /&gt;
&lt;br /&gt;
=== Trim (partial download) ===&lt;br /&gt;
&lt;br /&gt;
Parts of videos can be downloaded by using the output of {{ic|yt-dlp -g -f &#039;&#039;format&#039;&#039; &#039;&#039;URL&#039;&#039;}} as &#039;&#039;ffmpeg&#039;&#039; input with the {{ic|-ss}} (for input), {{ic|-t}} and {{ic|-c copy}} [https://ffmpeg.org/ffmpeg.html#Main-options options].&lt;br /&gt;
&lt;br /&gt;
=== URL from clipboard ===&lt;br /&gt;
&lt;br /&gt;
A shell [[alias]], a [[desktop launcher]] or a keyboard shortcut can be set to download a video (or audio) of a selected (or copied) URL by outputting it from the [[Wikipedia:X_Window_selection|X selection]]. See [[Clipboard#Tools]].&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/yt-dlp/yt-dlp GitHub repository] for documentation.&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=MEncoder&amp;diff=875444</id>
		<title>MEncoder</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=MEncoder&amp;diff=875444"/>
		<updated>2026-05-16T13:09:23Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Basics */ adjust external link title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Multimedia]]&lt;br /&gt;
[[ja:MEncoder]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|DVD Ripping}}&lt;br /&gt;
{{Related|MPlayer}}&lt;br /&gt;
{{Related|Video2dvdiso}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
An overview of [[Wikipedia:MEncoder|MEncoder]], the video encoding/decoding tool provided by [[MPlayer]] as part of the {{Pkg|mencoder}} package.&lt;br /&gt;
&lt;br /&gt;
== Basics ==&lt;br /&gt;
&lt;br /&gt;
The basic syntax for a conversion is:&lt;br /&gt;
&lt;br /&gt;
 $ mencoder &#039;&#039;original_video&#039;&#039;.mpg -o &#039;&#039;new_video&#039;&#039;.avi -ovc &#039;&#039;output_video_codec&#039;&#039; -oac &#039;&#039;output_audio_codec&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is basically how one converts a video. However, there are &#039;&#039;&#039;many&#039;&#039;&#039; more options available.&lt;br /&gt;
&lt;br /&gt;
For input formats, MEncoder can use any format that MPlayer can play, so to verify whether it will work with your video, just try playing it in MPlayer.&lt;br /&gt;
&lt;br /&gt;
To list &#039;&#039;o&#039;&#039;utput &#039;&#039;v&#039;&#039;ideo &#039;&#039;c&#039;&#039;odecs, run:&lt;br /&gt;
&lt;br /&gt;
 $ mencoder -ovc help&lt;br /&gt;
&lt;br /&gt;
Similarly, to list &#039;&#039;o&#039;&#039;utput &#039;&#039;a&#039;&#039;udio &#039;&#039;c&#039;&#039;odecs, run:&lt;br /&gt;
&lt;br /&gt;
 $ mencoder -oac help&lt;br /&gt;
&lt;br /&gt;
This information can also be found in the [https://mplayerhq.hu/DOCS/HTML/en/menc-feat-selecting-codec.html project online documentation] where it is better explained, although non-specific.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
This approach allows one to make a .mkv file with an [[Wikipedia:H.264/MPEG-4 AVC|H.264]]-encoded video and any number of Vorbis-encoded audio tracks.&lt;br /&gt;
&lt;br /&gt;
We will use &#039;&#039;mencoder&#039;&#039; for ripping and encoding and &#039;&#039;mkvmerge&#039;&#039; (part of {{Pkg|mkvtoolnix-cli}}) for making the &#039;&#039;.mkv&#039;&#039; file itself.&lt;br /&gt;
&lt;br /&gt;
=== Ripping and encoding the video ===&lt;br /&gt;
&lt;br /&gt;
The H.264 encoder is usually used in two passes: the first reads information about the movie, the second uses that information to encode. We will not extract any audio for now.&lt;br /&gt;
&lt;br /&gt;
Commands follow; remember to replace the variables with the proper values:&lt;br /&gt;
&lt;br /&gt;
First pass: we are just collecting information, so the normal output is thrown away:&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
$ mencoder -dvd-device &amp;quot;$ISO&amp;quot; dvd://&amp;quot;$TITLE&amp;quot; -chapter &amp;quot;$CHAPTER&amp;quot; -o /dev/null -nosound -ovc x264 \&lt;br /&gt;
-x264encopts direct=auto:pass=1:turbo:bitrate=900:bframes=1:\&lt;br /&gt;
me=umh:partitions=all:trellis=1:qp_step=4:qcomp=0.7:direct_pred=auto:keyint=300 \&lt;br /&gt;
-vf scale=-1:-10,harddup&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Second pass: here we compress the video track using the information from the first step:&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
$ mencoder -dvd-device &amp;quot;$ISO&amp;quot; dvd://&amp;quot;$TITLE&amp;quot; -chapter &amp;quot;$CHAPTER&amp;quot; -nosound -ovc x264 \&lt;br /&gt;
-x264encopts direct=auto:pass=2:bitrate=900:frameref=5:bframes=1:\&lt;br /&gt;
me=umh:partitions=all:trellis=1:qp_step=4:qcomp=0.7:direct_pred=auto:keyint=300 \&lt;br /&gt;
-vf scale=-1:-10,harddup -o video.avi&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This will create a {{ic|video.avi}} file containing the video. You can play with the {{ic|-x264encopts}} options and the {{ic|-vf}} filters to improve the quality or reduce the file size. For example, a movie with a black border should be cropped with {{ic|1=-vf crop=$X:$Y,scale=-1:-10,harddup}} with the proper values instead of {{ic|$X}} and {{ic|$Y}} (see {{man|1|mencoder|3=cropdetect_=limit:round_:reset__|fragment=cropdetect_=limit:round_:reset__}}). You may want to scale down the movie with {{ic|1=-vf scale=$WIDTH:-10,harddup}} the width of the movie will become {{ic|$WIDTH}} (keep {{ic|$WIDTH}} a multiple of 16: 640, 480, or 320 are usually fine), the height will be correctly calculated in order to keep the aspect ratio.&lt;br /&gt;
&lt;br /&gt;
You can also use any other of the filters MEncoder has to offer, like {{ic|pullup,softskip}} or you can change the frame rate using {{ic|-ofps}}. (If you do so, remember to use the same frame rate everywhere including in the commands to rip audio.)&lt;br /&gt;
&lt;br /&gt;
It is important that you use {{ic|harddup}} as the last filter: it will force MEncoder to write every frame (even duplicate ones) in the output. Also, it is necessary to use {{ic|1=scale=$WIDTH,-10}}} with {{ic|$WIDTH}} as {{ic|-1}} to keep the original width or a new, usually smaller, width: it is necessary since the H.264 codec uses square pixels and DVDs instead use rectangular pixels.&lt;br /&gt;
&lt;br /&gt;
=== Ripping and encoding the audio ===&lt;br /&gt;
&lt;br /&gt;
You can extract audio tracks as needed. Here we compress with the Vorbis algorithm, but you may want to check the MEncoder manual in order to see alternatives.&lt;br /&gt;
&lt;br /&gt;
The command follows (replace the variables with desired values) where we rip and compress the audio:&lt;br /&gt;
&lt;br /&gt;
 $ mencoder -dvd-device &amp;quot;$ISO&amp;quot; dvd://&amp;quot;$TITLE&amp;quot; -alang &amp;quot;$AUDIOLANG&amp;quot; -chapter &amp;quot;$CHAPTER&amp;quot; -ovc frameno \&lt;br /&gt;
 -oac lavc -lavcopts acodec=vorbis:abitrate=224 -channels 2 -srate 48000 -o &amp;quot;$AUDIOLANG&amp;quot;.avi&lt;br /&gt;
&lt;br /&gt;
You should repeat the command for every audio track you want, so we will have .avi files with the audio track.&lt;br /&gt;
&lt;br /&gt;
You may also want to use {{ic|-channels 6}} to exact all the channels of a 5.1 DVD or changing the bit rate. As with the video, you can use audio filters via {{ic|-af}} but it is not necessary.&lt;br /&gt;
&lt;br /&gt;
=== Making the final .mkv file ===&lt;br /&gt;
&lt;br /&gt;
Putting it all together in a single file is simple. Add other audio tracks if needed:&lt;br /&gt;
&lt;br /&gt;
 $ mkvmerge -D audio.avi -A video.avi -o mymovie.mkv&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;.mkv&#039;&#039; file will contain everything, so you can store your movie keeping all the audio track you want. Even if you are not interested in keeping multiple sound tracks, the H.264/Vorbis format pair should ensure great quality.&lt;br /&gt;
&lt;br /&gt;
=== Encoding for Nokia 5800 XM and Nokia N97 ===&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;2 pass&#039;&#039;&#039;es with small bitrates (640kbps video vbitrate and 96kbps audio abitrate) yields pretty watchable video mp4 for Nokia 5800 xm and Nokia N97 phones&#039; default video player. &lt;br /&gt;
&lt;br /&gt;
==== mkv to mp4 (nokia 97, 5800 compatible) ====&lt;br /&gt;
&lt;br /&gt;
# convert the mkv to mpg ; many mkv files do not directly get converted to mp4: {{bc|1=$ mencoder &#039;&#039;original_file&#039;&#039;.mkv -ovc lavc -lavcopts vcodec=mpeg1video -aid 0 -oac pcm -o delete_me.mpg}}&lt;br /&gt;
# convert the mpg file to mp4: {{bc|1=&amp;lt;nowiki&amp;gt;$ mencoder -of lavf -lavfopts format=mp4 -oac lavc -ovc lavc \&lt;br /&gt;
-lavcopts aglobal=1:vglobal=1:acodec=libfaac:vcodec=mpeg4:abitrate=128:vbitrate=640:keyint=250:mbd=1:vqmax=10:lmax=10:turbo \&lt;br /&gt;
-af lavcresample=44100 -vf harddup,scale=640:-3 &amp;quot;delete_me.mpg&amp;quot; -o &amp;quot;converted_file.mp4&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
#delete the temporary huge sized mpg file: {{bc|$ rm &amp;quot;delete_me.mpg&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
Here {{ic|-aid 0}} is the first audio track in the original mkv.&lt;br /&gt;
&lt;br /&gt;
==== avi to mp4 (nokia 97, 5800 compatible) using multipass (2 passes) ====&lt;br /&gt;
&lt;br /&gt;
# First pass: {{bc|1=&amp;lt;nowiki&amp;gt;$ mencoder -of lavf -lavfopts format=mp4 -oac lavc -ovc lavc \&lt;br /&gt;
-lavcopts aglobal=1:vglobal=1:acodec=libfaac:vcodec=mpeg4:abitrate=96:vbitrate=640:keyint=250:mbd=1:vqmax=10:lmax=10:vpass=1:turbo \&lt;br /&gt;
-af lavcresample=44100 -vf harddup,scale=640:-3 &amp;quot;video.avi&amp;quot; -o &amp;quot;video.mp4&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
# Second pass: {{bc|1=&amp;lt;nowiki&amp;gt;$ mencoder -of lavf -lavfopts format=mp4 -oac lavc -ovc lavc \&lt;br /&gt;
-lavcopts aglobal=1:vglobal=1:acodec=libfaac:vcodec=mpeg4:abitrate=96:vbitrate=640:keyint=250:mbd=1:vqmax=10:lmax=10:vpass=2 \&lt;br /&gt;
-af lavcresample=44100 -vf harddup,scale=640:-3 &amp;quot;video.avi&amp;quot; -o &amp;quot;video.mp4&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Play around with abitrate, vbitrate, and scale values to get video quality and size of your liking.&lt;br /&gt;
&lt;br /&gt;
{{ic|1=scale=640:-3}} will try to keep the video width to 640 and resize the video height accordingly. Do use the &amp;quot;original&amp;quot; aspect in Nokia&#039;s mp4 player &#039;&#039;Option &amp;gt; aspect&#039;&#039; for 16:9 and 4:3 aspect ratio videos.&lt;br /&gt;
&lt;br /&gt;
=== Encoding a multi audio / multi language MKV video to an MP4 with different audio streams ===&lt;br /&gt;
&lt;br /&gt;
To encode multi-audio file to mp4 we need to use the {{ic|-aid &#039;&#039;audio_stream_number&#039;&#039;}} like {{ic|-map 0:1}} in &#039;&#039;ffmpeg&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
# To extract video+audio stream1 (e.g. english) of mkv file: {{bc|$ mencoder -oac copy -ovc copy &#039;&#039;&#039;-aid 0&#039;&#039;&#039; sample.mkv -o sample.mp4}}&lt;br /&gt;
# To extract video+audio stream2 (e.g. Hindi, French, etc.) of mkv file: {{bc|$ mencoder -oac copy -ovc copy &#039;&#039;&#039;-aid 1&#039;&#039;&#039; sample.mkv -o sample.mp4}}&lt;br /&gt;
&lt;br /&gt;
=== Adding SubRip subtitles to a file ===&lt;br /&gt;
&lt;br /&gt;
The following output video codec ({{ic|-ovc}}) options are suggested as very high-quality settings and should suffice for most transcoding, including the addition of subtitles to a stream.&lt;br /&gt;
&lt;br /&gt;
==== Two-pass x264 (very high-quality) ====&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
$ mencoder original_video.avi -oac copy -ovc x264 \&lt;br /&gt;
-x264encopts pass=1:preset=veryslow:fast_pskip=0:tune=film:frameref=15:bitrate=3000:threads=auto \&lt;br /&gt;
-sub original_video.srt -subfont-text-scale 3 -o /dev/null&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
$ mencoder original_video.avi -oac copy -ovc x264 \&lt;br /&gt;
-x264encopts pass=2:preset=veryslow:fast_pskip=0:tune=film:frameref=15:bitrate=3000:threads=auto \&lt;br /&gt;
-sub original_video.srt -subfont-text-scale 3 -o output_video.avi&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
* {{ic|1=fast_pskip=0}} is a maximum quality {{ic|placebo}} preset option.&lt;br /&gt;
* {{ic|frameref}} is the only other major option undefined by {{ic|preset}} settings.&lt;br /&gt;
* {{ic|bitrate}} values can be modified to suit desired file size and quality needs. &lt;br /&gt;
* {{ic|tune}} should be set to match the type and content of the media being encoded.&lt;br /&gt;
&lt;br /&gt;
==== Single-pass x264 (very high-quality) ====&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
$ mencoder original_video.avi -oac copy -ovc x264 \&lt;br /&gt;
-x264encopts preset=veryslow:tune=film:crf=15:frameref=15:fast_pskip=0:threads=auto \&lt;br /&gt;
-sub original_video.srt -subfont-text-scale 3 -o output_video.avi&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
* The following example uses the option {{ic|-of lavf}} to mux the output into a [[Wikipedia:Matroska|Matroska]] container which is autodetected from the output file extension &#039;&#039;.mkv&#039;&#039;: {{bc|1=&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mencoder original_video.avi -oac copy -of lavf -ovc x264 \&lt;br /&gt;
-x264encopts preset=veryslow:tune=film:crf=15:frameref=15:fast_pskip=0:global_header:threads=auto \&lt;br /&gt;
-sub original_video.srt -subfont-text-scale 3 -o output_video.mkv&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* {{ic|global_header}} writes global video headers to extradata, or in front of keyframes and is typically required for .mp4 and .mkv containers.&lt;br /&gt;
&lt;br /&gt;
==== Two-pass xvid (very high-quality) ====&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
$ mencoder original_video.avi -oac copy -ovc xvid \&lt;br /&gt;
-xvidencopts pass=1:chroma_opt:vhq=4:max_bframes=1:quant_type=mpeg:threads=6 \&lt;br /&gt;
-sub original_video.srt -subfont-text-scale 3 -o /dev/null&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
$ mencoder original_video.avi -oac copy -ovc xvid \&lt;br /&gt;
-xvidencopts pass=2:chroma_opt:vhq=4:max_bframes=1:quant_type=mpeg:bitrate=3000:threads=6 \&lt;br /&gt;
-sub original_video.srt -subfont-text-scale 3 -o output_video.avi&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
* {{ic|1=threads=n}} where n = physical, or CPU cores. &lt;br /&gt;
* Recent versions of mencoder enable {{ic|1=bvhq=1}} as a default setting. &lt;br /&gt;
* Xvid does not accept {{ic|bitrate}} settings on the first of multiple-pass encodings.&lt;br /&gt;
* {{ic|subfont-text-scale 2-3}} helps with proper sizing with 16:9 format screens.&lt;br /&gt;
* {{ic|1=max_bframes=0}} can be set so long as the bitrate is high enough.&lt;br /&gt;
&lt;br /&gt;
==== Three-pass lavc (very high-quality mpeg4) ====&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
$ mencoder original_video.avi -oac copy -ffourcc DX50 -ovc lavc \&lt;br /&gt;
-lavcopts vpass=1:mbd=2:mv0:trell:v4mv:cbp:predia=6:dia=6:precmp=6:cmp=6:subcmp=6:preme=2:qns=2:vbitrate=3000 \&lt;br /&gt;
-sub original_video.srt -subfont-text-scale 3 -o output_video.avi&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
$ mencoder original_video.avi -oac copy -ffourcc DX50 -ovc lavc \&lt;br /&gt;
-lavcopts vpass=3:mbd=2:mv0:trell:v4mv:cbp:predia=6:dia=6:precmp=6:cmp=6:subcmp=6:preme=2:qns=2:vbitrate=3000 \&lt;br /&gt;
-sub original_video.srt -subfont-text-scale 3 -o output_video.avi&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
$ mencoder original_video.avi -oac copy -ffourcc DX50 -ovc lavc \&lt;br /&gt;
-lavcopts vpass=3:mbd=2:mv0:trell:v4mv:cbp:predia=6:dia=6:precmp=6:cmp=6:subcmp=6:preme=2:qns=2:vbitrate=3000 \&lt;br /&gt;
-sub original_video.srt -subfont-text-scale 3 -o output_video.avi&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
* Introducing {{ic|1=threads=n}} (with n above 1) for {{ic|-vcodec mpeg4}} may skew the effects of [[Wikipedia:Motion_estimation|motion estimation]] and lead to [https://ffmpeg.org/faq.html#SEC16 reduced video quality] and compression efficiency.&lt;br /&gt;
* {{ic|1=predia=6:dia=6:precmp=6:cmp=6:subcmp=6}} to {{ic|1=predia=3:dia=3:precmp=3:cmp=3:subcmp=3}} can reduce encoding times without incurring much loss in quality.&lt;br /&gt;
* {{ic|vmax_b_frames}} not included as referenced in the official mencoder documentation as the current default setting is to not to use [[Wikipedia:Video_compression_picture_types|B-frames]] at all.&lt;br /&gt;
* {{ic|vb_strategy}} not included as referenced in the official mencoder documentation for the same reason as above. Else {{ic|1=vb_strategy=2}}.&lt;br /&gt;
&lt;br /&gt;
==== Single-pass lavc (very high-quality mpeg-2) ====&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
$ mencoder -mc 0 -noskip -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf scale=720:576,harddup -srate 48000 -af lavcresample=48000 \&lt;br /&gt;
-lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:vstrict=0:acodec=mp2:abitrate=192:aspect=16/9 \&lt;br /&gt;
-sub-bg-alpha 100 -subpos 95 -subfont-text-scale 2.5 -subcp cp1250 -sub subFile.srt -o outFile.mpg inFile.mkv&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
* {{ic|-mc 0 -noskip}} to ensure A/V sync&lt;br /&gt;
* {{ic|aspect}} - setting video aspect manually&lt;br /&gt;
* subtitle background, subtitle encoding and subtitle scaling&lt;br /&gt;
&lt;br /&gt;
There are as always many options that can be set, this combination ensures that picture looks almost the same as original with slightly smaller file size (great for converting FULL HD videos so that they are playable on older devices).&lt;br /&gt;
&lt;br /&gt;
=== Adding VOBsub subtitles to a file ===&lt;br /&gt;
&lt;br /&gt;
==== Two-pass x264 (very high-quality) ====&lt;br /&gt;
&lt;br /&gt;
* Direct {{ic|-vobsub}} to the {{ic|subtitle_file}} using the full pathname of the file without extensions (&#039;&#039;.idx&#039;&#039; or &#039;&#039;.sub&#039;&#039;).&lt;br /&gt;
* Select the second subtitle ID language ({{ic|-vobsubid 2}}) contained within the VOBsub files (&#039;&#039;.idx&#039;&#039; or &#039;&#039;.sub&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
$ mencoder original_video.avi -oac copy -ovc x264 \&lt;br /&gt;
-x264encopts pass=1:preset=veryslow:fast_pskip=0:tune=film:frameref=15:bitrate=3000:threads=auto \&lt;br /&gt;
-vobsub subtitle_file -vobsubid 2 -o /dev/null&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
$ mencoder original_video.avi -oac copy -ovc x264 \&lt;br /&gt;
-x264encopts pass=2:preset=veryslow:fast_pskip=0:tune=film:frameref=15:bitrate=3000:threads=auto \&lt;br /&gt;
-vobsub subtitle_file -vobsubid 2 -o output_video.avi&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Testing subtitle muxing results ====&lt;br /&gt;
&lt;br /&gt;
Avoid passing resource intensive encoding options in order to verify desired results sooner rather than later.&lt;br /&gt;
&lt;br /&gt;
===== Single-pass x264 (low quality) =====&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
$ mencoder original_video.avi -oac copy -ovc x264 \&lt;br /&gt;
-x264encopts preset=ultrafast:threads=auto \&lt;br /&gt;
-sub original_video.srt -subfont-text-scale 3 -o output_video.avi&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== mp2 vs. mp3lame vs. aac ===&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|toolame}} is recommended over [https://www.ffmpeg.org/ FFmpeg] lavc (libavcodec) for mp2 encoding.&lt;br /&gt;
* [https://lame.sourceforge.net/ mp3lame] is recommended over [https://faac.sourceforge.net/ FAAC] (not fully developed) encoding at all bitrates.&lt;br /&gt;
&lt;br /&gt;
=== Encoding AVI videos in Windows and Mac readable formats ===&lt;br /&gt;
&lt;br /&gt;
Use these commands:&lt;br /&gt;
&lt;br /&gt;
 $ opt=&amp;quot;vbitrate=2160000:mbd=2:keyint=132:vqblur=1.0:cmp=2:subcmp=2:dia=2:mv0:last_pred=3&amp;quot;&lt;br /&gt;
 $ mencoder -ovc lavc -lavcopts vcodec=msmpeg4v2:vpass=1:$opt -oac mp3lame -o /dev/null input.avi&lt;br /&gt;
 $ mencoder -ovc lavc -lavcopts vcodec=msmpeg4v2:vpass=2:$opt -oac mp3lame -o output.avi input.avi&lt;br /&gt;
&lt;br /&gt;
{{ic|input.avi}} is the AVI you made using Linux utilities, and &amp;quot;output.avi&amp;quot; is the AVI you want to make which will be readable by Windows and Mac users.&lt;br /&gt;
&lt;br /&gt;
== GUI frontends ==&lt;br /&gt;
&lt;br /&gt;
The official MPlayer homepage has a comprehensive list of available front-ends [http://www.mplayerhq.hu/design7/projects.html#mencoder_frontends here].&lt;br /&gt;
&lt;br /&gt;
* {{App|OGMRip|An application and a set of libraries for ripping and encoding DVD into AVI, OGM, MP4, or Matroska files using a wide variety of codecs. It relies on mplayer, mencoder, ogmtools, mkvtoolnix, mp4box, oggenc, lame, and faac to perform its tasks.|https://ogmrip.sourceforge.net/|{{AUR|ogmrip}}}}&lt;br /&gt;
* {{App|Hybrid|A multi platform (Linux/macOS/Windows) Qt based frontend for a bunch of other tools which can convert nearly every input to x264/Xvid/VP8 + ac3/ogg/mp3/aac/flac inside an avi/mp4/m2ts/mkv/webm container, a BluRay or an AVCHD structure.|https://www.selur.de/|{{AUR|hybrid-encoder}}}}&lt;br /&gt;
* {{App|Hyper Video Converter|A frontend for various cli videoencoder tools I have made because I wanted something, that lets me quickly convert videos from konqueror without typing 3-line-commands in the console.|https://hypervideoconve.sourceforge.net/|{{AUR|hypervc-qt4}}}}&lt;br /&gt;
* {{App|jmencode|A simple java front-end for the free and very useful MPlayer software, for the purpose of encoding video. Initially the focus is on converting DVD into MPEG-4.|https://jmencode.sourceforge.net/|{{AUR|jmencode}}}}&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Mobile_phone&amp;diff=875441</id>
		<title>Mobile phone</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Mobile_phone&amp;diff=875441"/>
		<updated>2026-05-16T12:47:19Z</updated>

		<summary type="html">&lt;p&gt;Indigo: remove stray masking from redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Category:Mobile devices]]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=HTML&amp;diff=875440</id>
		<title>HTML</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=HTML&amp;diff=875440"/>
		<updated>2026-05-16T12:44:58Z</updated>

		<summary type="html">&lt;p&gt;Indigo: remove stray category from redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Category:Web]]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Init&amp;diff=875248</id>
		<title>Init</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Init&amp;diff=875248"/>
		<updated>2026-05-15T11:14:02Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Rootless X */ add talk to template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Lowercase title}}&lt;br /&gt;
[[Category:Init]]&lt;br /&gt;
[[es:Init]]&lt;br /&gt;
[[hu:Init]]&lt;br /&gt;
[[ja:Init]]&lt;br /&gt;
[[pt:Init]]&lt;br /&gt;
[[zh-hans:Init]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|Arch boot process}}&lt;br /&gt;
{{Related|ConsoleKit}}&lt;br /&gt;
{{Related|Init package guidelines}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|Arch Linux only has official support for [[systemd]]. [https://lists.archlinux.org/archives/list/arch-general@lists.archlinux.org/message/RSVHZP56KEQ4C6PRTROIMJRM45MTOFK7/] When using a different init system, please mention so in support requests.}}&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:Init|Init]] is the first process started during system boot. It is a daemon process that continues running until the system is shut down. Init is the direct or indirect ancestor of all other processes, and automatically adopts all orphaned processes. It is started by the kernel using a hard-coded filename; if the kernel is unable to start it, [[Kernel panic|panic]] will result. Init is typically assigned [[Wikipedia:process identifier|process identifier]] 1.&lt;br /&gt;
&lt;br /&gt;
The init &#039;&#039;scripts&#039;&#039; (or &#039;&#039;rc&#039;&#039;) are launched by the init process to guarantee basic functionality on system start and shutdown. This includes (un)mounting of [[file system]]s and launching of [[daemons]]. A &#039;&#039;service manager&#039;&#039; takes this one step further by providing active control over launched processes, or [[Wikipedia:Process Supervision|process supervision]]. An example is to monitor for crashes and restart processes accordingly.&lt;br /&gt;
&lt;br /&gt;
These components combine to the init &#039;&#039;system&#039;&#039;. Some inits include the service manager in the init process, or have init scripts in close relation to them. These inits are below referred to as &#039;&#039;integrated&#039;&#039;, though entries in different categories may explicitly depend on each other.&lt;br /&gt;
&lt;br /&gt;
== Inits (integrated) ==&lt;br /&gt;
&lt;br /&gt;
* {{App|anopa|Init system built around the s6 supervision suite.|https://jjacky.com/anopa/|{{AUR|anopa}}}}&lt;br /&gt;
* {{App|GNU Shepherd|Init system written in [https://www.gnu.org/software/guile/ Guile].|https://www.gnu.org/software/shepherd/|{{AUR|shepherd}}}}&lt;br /&gt;
* {{App|[[OpenRC]]|Dependency-based init system.|https://www.gentoo.org/proj/en/base/openrc/|{{AUR|openrc}} {{AUR|openrc-arch-services-git}}}}&lt;br /&gt;
* {{App|[[systemd]]|Dependency-based init system with aggressive parallelization, process supervision using cgroups, and the ability to depend on a given mount point or dbus service.|https://systemd.io/|{{Pkg|systemd}}}}&lt;br /&gt;
&lt;br /&gt;
== Inits ==&lt;br /&gt;
&lt;br /&gt;
* {{App|[[BusyBox]]|Utilities for rescue and embedded systems.|https://busybox.net/|{{Pkg|busybox}}}}&lt;br /&gt;
* {{App|sinit|Simple init initially based on Rich Felker’s minimal init.|https://core.suckless.org/sinit|{{AUR|sinit}}}}&lt;br /&gt;
&lt;br /&gt;
== Init scripts ==&lt;br /&gt;
&lt;br /&gt;
* {{App|kisslinux-init|Init framework of KISS Linux.|https://github.com/kisslinux/init|{{AUR|kisslinux-init}}}}&lt;br /&gt;
&lt;br /&gt;
== Service managers ==&lt;br /&gt;
&lt;br /&gt;
* {{App|[[Monit]]|Monit is a process supervision tool for Unix and Linux. With monit, system status can be viewed directly from the command line, or via the native HTTP(S) web server.|https://mmonit.com/monit/|{{Pkg|monit}}}}&lt;br /&gt;
* {{App|perp|Persistent process (service) supervisor and management framework for UNIX.|http://b0llix.net/perp/|{{AUR|perp}}}}&lt;br /&gt;
* {{App|[[runit]]|UNIX init scheme with service supervision, a replacement for SysVinit, and other init schemes.|https://smarden.org/runit/|{{Pkg|busybox}}}}&lt;br /&gt;
* {{App|s6|Small suite of programs for UNIX, designed to allow service supervision in the line of daemontools and runit.|https://skarnet.org/software/s6/|{{AUR|s6}}}}&lt;br /&gt;
* {{App|Supervisor|A system that allows its users to monitor and control processes on UNIX-like operating systems.|https://supervisord.org/|{{Pkg|supervisor}}}}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Migrate running services ===&lt;br /&gt;
&lt;br /&gt;
To run daemons under the new init, save a list of running daemons:&lt;br /&gt;
&lt;br /&gt;
 $ systemctl list-units --state=running &amp;quot;*.service&amp;quot; &amp;gt; daemons.list&lt;br /&gt;
&lt;br /&gt;
and configure the [[#Init scripts]] accordingly. See also [https://unix.stackexchange.com/questions/175380/how-to-list-all-running-daemons].&lt;br /&gt;
&lt;br /&gt;
{{Note|{{man|8|systemd-tmpfiles}}, [[kernel modules]] and [[sysctl]] may also need configuration.}}&lt;br /&gt;
&lt;br /&gt;
=== logind ===&lt;br /&gt;
&lt;br /&gt;
[https://www.freedesktop.org/wiki/Software/systemd/logind/ logind] requires &#039;&#039;systemd&#039;&#039; to be the init process. [https://systemd.io/PORTABILITY_AND_STABILITY/] As such, [[General troubleshooting#Session permissions|local sessions]] and other functionality is not available.&lt;br /&gt;
&lt;br /&gt;
=== Device permissions ===&lt;br /&gt;
&lt;br /&gt;
Add users to respective [[user group]]s for device access and reboot. Current group membership should first be checked with {{ic|id &#039;&#039;user&#039;&#039;}}.&lt;br /&gt;
&lt;br /&gt;
 # usermod -a -G video,audio,power,disk,storage,optical,lp,scanner,input &#039;&#039;user&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See also [[Users and groups#Pre-systemd groups]]. To create group rules for use with [[Polkit]], see [[Polkit#Bypass password prompt]].&lt;br /&gt;
&lt;br /&gt;
=== Rootless X ===&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|People on [https://github.com/void-linux/void-docs/issues/547 Void Linux] can get X runnning rootless even without logind, we should probably promote this instead of suggesting to run X as root.|section=rootless X void workaround}}&lt;br /&gt;
&lt;br /&gt;
As {{ic|Xorg.wrap}} does not check if logind is active [https://bugs.freedesktop.org/show_bug.cgi?id=86975#c5], root rights for Xorg need be [[Xorg#Xorg as Root|enabled manually]].&lt;br /&gt;
&lt;br /&gt;
=== Power management ===&lt;br /&gt;
&lt;br /&gt;
See {{AUR|pm-utils}} and [[acpid]] to replace [[Systemd#Power management|Power management with systemd]].&lt;br /&gt;
&lt;br /&gt;
=== Scheduled tasks ===&lt;br /&gt;
&lt;br /&gt;
Arch uses [[systemd/Timers|timer]] files instead of [[cron]] by default.&lt;br /&gt;
&lt;br /&gt;
=== Dbus ===&lt;br /&gt;
&lt;br /&gt;
{{Expansion|1=Explanative section removed with [[Special:Diff/458617|458617]]}}&lt;br /&gt;
&lt;br /&gt;
User instances of &#039;&#039;dbus-daemon&#039;&#039; are launched by [[systemd/User]] [https://archlinux.org/news/d-bus-now-launches-user-buses/]. When requiring IPC between desktop applications, restore {{ic|30-dbus.sh}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|1=/etc/X11/xinit/xinitrc.d/30-dbus.sh|2=&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# launches a session dbus instance&lt;br /&gt;
if [ -z &amp;quot;${DBUS_SESSION_BUS_ADDRESS-}&amp;quot; ] &amp;amp;&amp;amp; type dbus-launch &amp;gt;/dev/null; then&lt;br /&gt;
  eval $(dbus-launch --sh-syntax --exit-with-session)&lt;br /&gt;
fi&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== systemd-nspawn ===&lt;br /&gt;
&lt;br /&gt;
[[systemd-nspawn]] is a tool for systemd systems. Since Linux 2.6.19, it is possible, however, to run systemd on a non-systemd system by using PID namespace. For it, the kernel needs to be configured with {{ic|CONFIG_PID_NS}} and {{ic|CONFIG_NAMESPACES}}). &lt;br /&gt;
&lt;br /&gt;
The PID namespace creates a new hierarchy of processes starting with PID 1. In addition to this, systemd requires a chrooted root filesystem to be mounted. Hence, you have to at least make a bind mount, because otherwise some services will fail with &lt;br /&gt;
&lt;br /&gt;
 &amp;quot;Failed at step NAMESPACE spawning&amp;quot; due to &amp;quot;Invalid operation&amp;quot; &lt;br /&gt;
&lt;br /&gt;
as systemd tries to remount the root with {{ic|private}} option. &lt;br /&gt;
&lt;br /&gt;
To setup a chroot with a new PID namespace, you can use jchroot.[https://vincent.bernat.im/en/blog/2011-jchroot-isolation.html] [https://github.com/vincentbernat/jchroot]. &lt;br /&gt;
Make sure not to mount {{ic|/proc}} inside the new root before chrooting, otherwise systemd will detect the chroot environment. You can mount it later once systemd is running.&lt;br /&gt;
&lt;br /&gt;
=== Replacing udev ===&lt;br /&gt;
&lt;br /&gt;
{{Warning|Replacing udev is not required as &#039;&#039;systemd-udev&#039;&#039; is functional without &#039;&#039;systemd&#039;&#039; as PID 1. Some replacements can also not coexist with {{Pkg|systemd}}—ensure an alternative init is booted &#039;&#039;&#039;prior&#039;&#039;&#039; to their installation.}}&lt;br /&gt;
&lt;br /&gt;
* {{App|mdev|Device manager for usage in embedded systems.|https://git.busybox.net/busybox/plain/docs/mdev.txt|{{Pkg|busybox}}}}&lt;br /&gt;
* {{App|smdev|smdev is a simple program to manage device nodes. It is mostly compatible with mdev but does not have all of its features.|https://git.suckless.org/smdev/|{{AUR|smdev}}}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Debian:Debate/initsystem]]&lt;br /&gt;
* [https://skarnet.org/software/s6/s6-svscan-1.html How to run s6-svscan as process 1]&lt;br /&gt;
* [https://bbs.archlinux.org/viewtopic.php?id=162606&amp;amp;p=1 Replace systemd with busybox + minirc]&lt;br /&gt;
* [https://busybox.net/~vda/init_vs_runsv.html Init vs. runsv]&lt;br /&gt;
* [https://felipec.wordpress.com/2013/11/04/init/ Demystifying the init system]&lt;br /&gt;
* [https://web.archive.org/web/20201108092524/https://blog.darknedgy.net/technology/2015/09/05/0/ A history of modern init systems (1992-2015)]&lt;br /&gt;
* [[Gentoo:Comparison of init systems]]&lt;br /&gt;
* [https://github.com/InitWare/InitWare/wiki/Contributors&#039;-Study-Guide InitWare: Contributors&#039; Study Guide]&lt;br /&gt;
* [https://jdebp.uk/Softwares/nosh/ The nosh package]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Talk:Init&amp;diff=875247</id>
		<title>Talk:Init</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Talk:Init&amp;diff=875247"/>
		<updated>2026-05-15T11:13:21Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* rootless X void workaround */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== rootless X void workaround ==&lt;br /&gt;
&lt;br /&gt;
To my understanding the Void discussion offers two solutions: (1) adding users to the input group (unsafe as they note) and (2) relying on elogind, a forked systemd-logind (for X during packaging and thereafter). Did I miss a solution? What should be promoted? --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 11:13, 15 May 2026 (UTC)&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Init&amp;diff=875246</id>
		<title>Init</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Init&amp;diff=875246"/>
		<updated>2026-05-15T10:50:59Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Scheduled tasks */ remove sentence with 404 link (not found in aur either); cron would be better suited for it anyway, and repo has both cronie and fcron options&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Lowercase title}}&lt;br /&gt;
[[Category:Init]]&lt;br /&gt;
[[es:Init]]&lt;br /&gt;
[[hu:Init]]&lt;br /&gt;
[[ja:Init]]&lt;br /&gt;
[[pt:Init]]&lt;br /&gt;
[[zh-hans:Init]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|Arch boot process}}&lt;br /&gt;
{{Related|ConsoleKit}}&lt;br /&gt;
{{Related|Init package guidelines}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|Arch Linux only has official support for [[systemd]]. [https://lists.archlinux.org/archives/list/arch-general@lists.archlinux.org/message/RSVHZP56KEQ4C6PRTROIMJRM45MTOFK7/] When using a different init system, please mention so in support requests.}}&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:Init|Init]] is the first process started during system boot. It is a daemon process that continues running until the system is shut down. Init is the direct or indirect ancestor of all other processes, and automatically adopts all orphaned processes. It is started by the kernel using a hard-coded filename; if the kernel is unable to start it, [[Kernel panic|panic]] will result. Init is typically assigned [[Wikipedia:process identifier|process identifier]] 1.&lt;br /&gt;
&lt;br /&gt;
The init &#039;&#039;scripts&#039;&#039; (or &#039;&#039;rc&#039;&#039;) are launched by the init process to guarantee basic functionality on system start and shutdown. This includes (un)mounting of [[file system]]s and launching of [[daemons]]. A &#039;&#039;service manager&#039;&#039; takes this one step further by providing active control over launched processes, or [[Wikipedia:Process Supervision|process supervision]]. An example is to monitor for crashes and restart processes accordingly.&lt;br /&gt;
&lt;br /&gt;
These components combine to the init &#039;&#039;system&#039;&#039;. Some inits include the service manager in the init process, or have init scripts in close relation to them. These inits are below referred to as &#039;&#039;integrated&#039;&#039;, though entries in different categories may explicitly depend on each other.&lt;br /&gt;
&lt;br /&gt;
== Inits (integrated) ==&lt;br /&gt;
&lt;br /&gt;
* {{App|anopa|Init system built around the s6 supervision suite.|https://jjacky.com/anopa/|{{AUR|anopa}}}}&lt;br /&gt;
* {{App|GNU Shepherd|Init system written in [https://www.gnu.org/software/guile/ Guile].|https://www.gnu.org/software/shepherd/|{{AUR|shepherd}}}}&lt;br /&gt;
* {{App|[[OpenRC]]|Dependency-based init system.|https://www.gentoo.org/proj/en/base/openrc/|{{AUR|openrc}} {{AUR|openrc-arch-services-git}}}}&lt;br /&gt;
* {{App|[[systemd]]|Dependency-based init system with aggressive parallelization, process supervision using cgroups, and the ability to depend on a given mount point or dbus service.|https://systemd.io/|{{Pkg|systemd}}}}&lt;br /&gt;
&lt;br /&gt;
== Inits ==&lt;br /&gt;
&lt;br /&gt;
* {{App|[[BusyBox]]|Utilities for rescue and embedded systems.|https://busybox.net/|{{Pkg|busybox}}}}&lt;br /&gt;
* {{App|sinit|Simple init initially based on Rich Felker’s minimal init.|https://core.suckless.org/sinit|{{AUR|sinit}}}}&lt;br /&gt;
&lt;br /&gt;
== Init scripts ==&lt;br /&gt;
&lt;br /&gt;
* {{App|kisslinux-init|Init framework of KISS Linux.|https://github.com/kisslinux/init|{{AUR|kisslinux-init}}}}&lt;br /&gt;
&lt;br /&gt;
== Service managers ==&lt;br /&gt;
&lt;br /&gt;
* {{App|[[Monit]]|Monit is a process supervision tool for Unix and Linux. With monit, system status can be viewed directly from the command line, or via the native HTTP(S) web server.|https://mmonit.com/monit/|{{Pkg|monit}}}}&lt;br /&gt;
* {{App|perp|Persistent process (service) supervisor and management framework for UNIX.|http://b0llix.net/perp/|{{AUR|perp}}}}&lt;br /&gt;
* {{App|[[runit]]|UNIX init scheme with service supervision, a replacement for SysVinit, and other init schemes.|https://smarden.org/runit/|{{Pkg|busybox}}}}&lt;br /&gt;
* {{App|s6|Small suite of programs for UNIX, designed to allow service supervision in the line of daemontools and runit.|https://skarnet.org/software/s6/|{{AUR|s6}}}}&lt;br /&gt;
* {{App|Supervisor|A system that allows its users to monitor and control processes on UNIX-like operating systems.|https://supervisord.org/|{{Pkg|supervisor}}}}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Migrate running services ===&lt;br /&gt;
&lt;br /&gt;
To run daemons under the new init, save a list of running daemons:&lt;br /&gt;
&lt;br /&gt;
 $ systemctl list-units --state=running &amp;quot;*.service&amp;quot; &amp;gt; daemons.list&lt;br /&gt;
&lt;br /&gt;
and configure the [[#Init scripts]] accordingly. See also [https://unix.stackexchange.com/questions/175380/how-to-list-all-running-daemons].&lt;br /&gt;
&lt;br /&gt;
{{Note|{{man|8|systemd-tmpfiles}}, [[kernel modules]] and [[sysctl]] may also need configuration.}}&lt;br /&gt;
&lt;br /&gt;
=== logind ===&lt;br /&gt;
&lt;br /&gt;
[https://www.freedesktop.org/wiki/Software/systemd/logind/ logind] requires &#039;&#039;systemd&#039;&#039; to be the init process. [https://systemd.io/PORTABILITY_AND_STABILITY/] As such, [[General troubleshooting#Session permissions|local sessions]] and other functionality is not available.&lt;br /&gt;
&lt;br /&gt;
=== Device permissions ===&lt;br /&gt;
&lt;br /&gt;
Add users to respective [[user group]]s for device access and reboot. Current group membership should first be checked with {{ic|id &#039;&#039;user&#039;&#039;}}.&lt;br /&gt;
&lt;br /&gt;
 # usermod -a -G video,audio,power,disk,storage,optical,lp,scanner,input &#039;&#039;user&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See also [[Users and groups#Pre-systemd groups]]. To create group rules for use with [[Polkit]], see [[Polkit#Bypass password prompt]].&lt;br /&gt;
&lt;br /&gt;
=== Rootless X ===&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|People on [https://github.com/void-linux/void-docs/issues/547 Void Linux] can get X runnning rootless even without logind, we should probably promote this instead of suggesting to run X as root.}}&lt;br /&gt;
&lt;br /&gt;
As {{ic|Xorg.wrap}} does not check if logind is active [https://bugs.freedesktop.org/show_bug.cgi?id=86975#c5], root rights for Xorg need be [[Xorg#Xorg as Root|enabled manually]].&lt;br /&gt;
&lt;br /&gt;
=== Power management ===&lt;br /&gt;
&lt;br /&gt;
See {{AUR|pm-utils}} and [[acpid]] to replace [[Systemd#Power management|Power management with systemd]].&lt;br /&gt;
&lt;br /&gt;
=== Scheduled tasks ===&lt;br /&gt;
&lt;br /&gt;
Arch uses [[systemd/Timers|timer]] files instead of [[cron]] by default.&lt;br /&gt;
&lt;br /&gt;
=== Dbus ===&lt;br /&gt;
&lt;br /&gt;
{{Expansion|1=Explanative section removed with [[Special:Diff/458617|458617]]}}&lt;br /&gt;
&lt;br /&gt;
User instances of &#039;&#039;dbus-daemon&#039;&#039; are launched by [[systemd/User]] [https://archlinux.org/news/d-bus-now-launches-user-buses/]. When requiring IPC between desktop applications, restore {{ic|30-dbus.sh}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|1=/etc/X11/xinit/xinitrc.d/30-dbus.sh|2=&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# launches a session dbus instance&lt;br /&gt;
if [ -z &amp;quot;${DBUS_SESSION_BUS_ADDRESS-}&amp;quot; ] &amp;amp;&amp;amp; type dbus-launch &amp;gt;/dev/null; then&lt;br /&gt;
  eval $(dbus-launch --sh-syntax --exit-with-session)&lt;br /&gt;
fi&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== systemd-nspawn ===&lt;br /&gt;
&lt;br /&gt;
[[systemd-nspawn]] is a tool for systemd systems. Since Linux 2.6.19, it is possible, however, to run systemd on a non-systemd system by using PID namespace. For it, the kernel needs to be configured with {{ic|CONFIG_PID_NS}} and {{ic|CONFIG_NAMESPACES}}). &lt;br /&gt;
&lt;br /&gt;
The PID namespace creates a new hierarchy of processes starting with PID 1. In addition to this, systemd requires a chrooted root filesystem to be mounted. Hence, you have to at least make a bind mount, because otherwise some services will fail with &lt;br /&gt;
&lt;br /&gt;
 &amp;quot;Failed at step NAMESPACE spawning&amp;quot; due to &amp;quot;Invalid operation&amp;quot; &lt;br /&gt;
&lt;br /&gt;
as systemd tries to remount the root with {{ic|private}} option. &lt;br /&gt;
&lt;br /&gt;
To setup a chroot with a new PID namespace, you can use jchroot.[https://vincent.bernat.im/en/blog/2011-jchroot-isolation.html] [https://github.com/vincentbernat/jchroot]. &lt;br /&gt;
Make sure not to mount {{ic|/proc}} inside the new root before chrooting, otherwise systemd will detect the chroot environment. You can mount it later once systemd is running.&lt;br /&gt;
&lt;br /&gt;
=== Replacing udev ===&lt;br /&gt;
&lt;br /&gt;
{{Warning|Replacing udev is not required as &#039;&#039;systemd-udev&#039;&#039; is functional without &#039;&#039;systemd&#039;&#039; as PID 1. Some replacements can also not coexist with {{Pkg|systemd}}—ensure an alternative init is booted &#039;&#039;&#039;prior&#039;&#039;&#039; to their installation.}}&lt;br /&gt;
&lt;br /&gt;
* {{App|mdev|Device manager for usage in embedded systems.|https://git.busybox.net/busybox/plain/docs/mdev.txt|{{Pkg|busybox}}}}&lt;br /&gt;
* {{App|smdev|smdev is a simple program to manage device nodes. It is mostly compatible with mdev but does not have all of its features.|https://git.suckless.org/smdev/|{{AUR|smdev}}}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Debian:Debate/initsystem]]&lt;br /&gt;
* [https://skarnet.org/software/s6/s6-svscan-1.html How to run s6-svscan as process 1]&lt;br /&gt;
* [https://bbs.archlinux.org/viewtopic.php?id=162606&amp;amp;p=1 Replace systemd with busybox + minirc]&lt;br /&gt;
* [https://busybox.net/~vda/init_vs_runsv.html Init vs. runsv]&lt;br /&gt;
* [https://felipec.wordpress.com/2013/11/04/init/ Demystifying the init system]&lt;br /&gt;
* [https://web.archive.org/web/20201108092524/https://blog.darknedgy.net/technology/2015/09/05/0/ A history of modern init systems (1992-2015)]&lt;br /&gt;
* [[Gentoo:Comparison of init systems]]&lt;br /&gt;
* [https://github.com/InitWare/InitWare/wiki/Contributors&#039;-Study-Guide InitWare: Contributors&#039; Study Guide]&lt;br /&gt;
* [https://jdebp.uk/Softwares/nosh/ The nosh package]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=River_Classic&amp;diff=873900</id>
		<title>River Classic</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=River_Classic&amp;diff=873900"/>
		<updated>2026-05-14T09:23:37Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Configuration */ apply Help:Style/Formatting and punctuation#Executable/application names&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Lowercase title}}&lt;br /&gt;
[[Category:Wayland compositors]]&lt;br /&gt;
[[ja:River Classic]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|river}}&lt;br /&gt;
{{Related|Wayland#Compositors}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
[https://codeberg.org/river/river-classic river classic] is a wlroots-based Wayland dynamic tiling compositor, inspired by, but not based on dwm, xmonad and bspwm. Configuration is by an external executable file. It is the old branch of the now non-monolithic compositor [[river]].&lt;br /&gt;
&lt;br /&gt;
Its declared design goals are:&lt;br /&gt;
&lt;br /&gt;
* Simple and predictable behavior, river should be easy to use and have a low cognitive load.&lt;br /&gt;
* Window management based on a stack of views and tags.&lt;br /&gt;
* Dynamic layouts generated by external, user-written executables. A default rivertile layout generator is provided.&lt;br /&gt;
* Scriptable configuration and control through a custom Wayland protocol and separate riverctl binary implementing it.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
River Classic is [[install]]ed with the {{pkg|river-classic}} package.&lt;br /&gt;
&lt;br /&gt;
== Starting ==&lt;br /&gt;
&lt;br /&gt;
A single executable file is used as a configuration file. No initialisation file is set up for the user by default, so no keybindings or default applications are available until an init file is created. Note that this includes the exit keybinding, so set up in tty or another desktop environment before running river.&lt;br /&gt;
&lt;br /&gt;
An example config init file is available in {{ic|/usr/share/river/example/}}.&lt;br /&gt;
Copy this as {{ic|~/.config/river/init}} and ensure it is [[executable]].&lt;br /&gt;
&lt;br /&gt;
=== Manually ===&lt;br /&gt;
&lt;br /&gt;
Enter {{ic|river}} (exits to tty with user still logged in) or {{ic|exec river}} (more securely exits to tty with user logged out)&lt;br /&gt;
&lt;br /&gt;
=== From TTY ===&lt;br /&gt;
&lt;br /&gt;
River can be autostarted in a similar manner to &#039;&#039;startx&#039;&#039;, by setting up the environment variable checks in {{ic|.bash_profile}} or the equivalent file for other shells. See [[Xinit#Autostart X at login]], replacing {{ic|$DISPLAY}} with {{ic|$WAYLAND_DISPLAY}}, and running {{ic|exec river}}.&lt;br /&gt;
&lt;br /&gt;
=== Display manager ===&lt;br /&gt;
&lt;br /&gt;
River does not officially support display managers but many will work with no or minimal effort. A session entry is installed by default in {{ic|/usr/share/wayland-sessions/}}.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The configuration file can be a shell script or executable program, comprising a list of &#039;&#039;riverctl&#039;&#039; individual commands which define key bindings, input settings and window rules. It is executed once at start-up but can be re-run like any other shell script (consider the effects of duplicating any autostarted spawned actions).&lt;br /&gt;
Each setting can also be run individually by simply running the relevant &#039;&#039;riverctl&#039;&#039; line in a terminal. This allows temporary override of the init settings, dynamic updates and testing new settings.&lt;br /&gt;
&lt;br /&gt;
For example, to map the shortcut {{ic|Super+PrtSc}} to take a screenshot with the application {{Pkg|grim}} and display a temporary [[desktop notification]]:&lt;br /&gt;
&lt;br /&gt;
 riverctl map normal Super Print spawn &amp;quot;grim &amp;amp;&amp;amp; notify-send -t 2000 &#039;Screenshot taken&#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;spawn&#039;&#039; command can launch any application or script but expects a single word argument. Quote any longer expressions.&lt;br /&gt;
&lt;br /&gt;
=== Keyboard layout ===&lt;br /&gt;
&lt;br /&gt;
 riverctl keyboard-layout gb&lt;br /&gt;
&lt;br /&gt;
Multiple layouts can be entered as a comma-separated list, e.g. {{ic|gb,fr}}.&lt;br /&gt;
&lt;br /&gt;
Variables and other shell constructs can be used: {{ic|1=mod=&#039;Mod4&#039;}}, {{ic|set term foot}}, etc, as per your shell.&lt;br /&gt;
&lt;br /&gt;
=== Touchpad examples ===&lt;br /&gt;
&lt;br /&gt;
Certain touchpad behaviour and focus preferences are available.&lt;br /&gt;
&lt;br /&gt;
 riverctl input pointer-2-7-SynPS/2_Synaptics_TouchPad tap enabled&lt;br /&gt;
 riverctl focus-follows-cursor normal&lt;br /&gt;
&lt;br /&gt;
Exact keyboard, mouse and touchpad models for use in these settings can be identified using:&lt;br /&gt;
&lt;br /&gt;
 $ riverctl list-inputs&lt;br /&gt;
&lt;br /&gt;
=== Window rules ===&lt;br /&gt;
&lt;br /&gt;
It is sometimes desirable to set certain windows to be non-tiling by default. Floating windows can be defined by class or title:&lt;br /&gt;
&lt;br /&gt;
 riverctl rule-add -app-id &#039;galculator&#039; float&lt;br /&gt;
 riverctl rule-add -app-id &#039;thunar&#039; float       # make all Thunar windows floating&lt;br /&gt;
 riverctl rule-add -app-id &#039;thunar&#039; -title &#039;* - Thunar&#039; no-float  # except main window&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Autostart ===&lt;br /&gt;
&lt;br /&gt;
Use {{ic|riverctl spawn}} without a keybinding to launch any executable at startup, for example:&lt;br /&gt;
&lt;br /&gt;
 riverctl spawn &amp;quot;i3-battery-popup -n -m &#039;Battery Low!&#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Scratchpads ===&lt;br /&gt;
&lt;br /&gt;
River does not define any scratchpads by default, but these can be set up on any tag beyond the default 0-9. First, define the tag number, then the key mapping to move an application to the scratchpad tag and toggle its appearance, and, finally, prevent new windows being assigned to the scratchpad.&lt;br /&gt;
&lt;br /&gt;
 scratch_tag=$((1 &amp;lt;&amp;lt; 20 ))&lt;br /&gt;
 &lt;br /&gt;
 riverctl map normal Super P toggle-focused-tags ${scratch_tag}		# toggle the scratchpad&lt;br /&gt;
 riverctl map normal Super+Shift P set-view-tags ${scratch_tag}		# send windows to the scratchpad&lt;br /&gt;
 &lt;br /&gt;
 # Set spawn tagmask to ensure new windows do not have the scratchpad tag unless explicitly set.&lt;br /&gt;
 all_but_scratch_tag=$(( ((1 &amp;lt;&amp;lt; 32) - 1) ^ $scratch_tag ))&lt;br /&gt;
 riverctl spawn-tagmask ${all_but_scratch_tag}&lt;br /&gt;
&lt;br /&gt;
=== Modes ===&lt;br /&gt;
&lt;br /&gt;
River supports modes for key mapping, which allows for reuse of mappings, and combinations of fewer keys. There are two default modes of &#039;normal&#039; and &#039;locked&#039; (defining allowed key mappings when the screen is locked).&lt;br /&gt;
Custom modes can be added. Eg. if floating windows are rarely used, the key mapping to manipulate those windows can be defined in a &#039;float&#039; mode. Entry and exit key mappings for the mode are set as the first and last mappings, with other mapping between these.&lt;br /&gt;
&lt;br /&gt;
 riverctl declare-mode float&lt;br /&gt;
 riverctl map normal Super R enter-mode float		# Super+R to enter float mode&lt;br /&gt;
  &lt;br /&gt;
 ### Floating window mappings but note that these also apply to tiled windows.&lt;br /&gt;
 #&lt;br /&gt;
 # Super {Arrows} to move views&lt;br /&gt;
   riverctl map float Super Left move left 100&lt;br /&gt;
   riverctl map float Super Down move down 100&lt;br /&gt;
   riverctl map float Super Up move up 100&lt;br /&gt;
   riverctl map float Super Right move right 100&lt;br /&gt;
  &lt;br /&gt;
 # Alt+{arrows} to snap views to screen edges&lt;br /&gt;
   riverctl map float Alt Left snap left&lt;br /&gt;
   riverctl map float Alt Down snap down&lt;br /&gt;
   riverctl map float Alt Up snap up&lt;br /&gt;
   riverctl map float Alt Right snap right&lt;br /&gt;
  &lt;br /&gt;
 # Shift+{arrows} to resize views&lt;br /&gt;
   riverctl map float Shift Left resize horizontal -100&lt;br /&gt;
   riverctl map float Shift Down resize vertical 100&lt;br /&gt;
   riverctl map float Shift Up resize vertical -100&lt;br /&gt;
   riverctl map float Shift Right resize horizontal 100&lt;br /&gt;
  &lt;br /&gt;
 riverctl map float None Escape enter-mode normal	# Escape to exit float mode and return to normal mode&lt;br /&gt;
&lt;br /&gt;
Note that floating window modifiers also work on tiled windows, making them floating and giving potentially unpredictable layouts.&lt;br /&gt;
&lt;br /&gt;
=== External tools ===&lt;br /&gt;
&lt;br /&gt;
In common with many other Wayland minimalist tiling clients, other tools are not included. Example external bars, screenshot tools, launchers, etc. are listed in the [https://codeberg.org/river/wiki-classic River wiki], including several with River-specific functionality.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Screencasting ===&lt;br /&gt;
&lt;br /&gt;
If Screencasting is not working with river, check if the needed [[environment variables]] are properly set for systemd:&lt;br /&gt;
 $ systemctl --user show-environment&lt;br /&gt;
&lt;br /&gt;
You should find something like:&lt;br /&gt;
 WAYLAND_DISPLAY=wayland-1&lt;br /&gt;
 XDG_CURRENT_DESKTOP=river&lt;br /&gt;
&lt;br /&gt;
If any of these variables are not set, you may add this to your {{ic|.config/river/init}}:&lt;br /&gt;
 systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP&lt;br /&gt;
 dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=river&lt;br /&gt;
 systemctl --user restart xdg-desktop-portal&lt;br /&gt;
&lt;br /&gt;
If you need further troubleshooting, try to:&lt;br /&gt;
* Make sure [[XDG Desktop Portal]] services are running:&lt;br /&gt;
 $ systemctl --user status xdg-desktop-portal.service&lt;br /&gt;
 $ systemctl --user status xdg-desktop-portal-wlr.service&lt;br /&gt;
&lt;br /&gt;
* Stop the {{ic|xdg-desktop-portal.service}} and run it manually to see if it works:&lt;br /&gt;
 $ systemctl --user stop xdg-desktop-portal&lt;br /&gt;
 $ XDG_CURRENT_DESKTOP=river /usr/lib/xdg-desktop-portal&lt;br /&gt;
&lt;br /&gt;
* Test it using [https://mozilla.github.io/webrtc-landing/gum_test.html Mozilla WebRTC test]&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
Contrary to what you may find in older posts in the internet, it is not necessary to install {{Pkg|pipewire-media-session}}, since {{Pkg|wireplumber}} is working just fine now.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://codeberg.org/river/river-classic/ River Codeberg repository]&lt;br /&gt;
* [https://codeberg.org/river/wiki-classic/ River wiki]&lt;br /&gt;
* [https://leon_plickat.srht.site/writing/river-setup-guide/article.html Developer set-up blog post]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=River_Classic&amp;diff=873899</id>
		<title>River Classic</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=River_Classic&amp;diff=873899"/>
		<updated>2026-05-14T09:20:32Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Touchpad examples */ apply Help:Style#Code formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Lowercase title}}&lt;br /&gt;
[[Category:Wayland compositors]]&lt;br /&gt;
[[ja:River Classic]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|river}}&lt;br /&gt;
{{Related|Wayland#Compositors}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
[https://codeberg.org/river/river-classic river classic] is a wlroots-based Wayland dynamic tiling compositor, inspired by, but not based on dwm, xmonad and bspwm. Configuration is by an external executable file. It is the old branch of the now non-monolithic compositor [[river]].&lt;br /&gt;
&lt;br /&gt;
Its declared design goals are:&lt;br /&gt;
&lt;br /&gt;
* Simple and predictable behavior, river should be easy to use and have a low cognitive load.&lt;br /&gt;
* Window management based on a stack of views and tags.&lt;br /&gt;
* Dynamic layouts generated by external, user-written executables. A default rivertile layout generator is provided.&lt;br /&gt;
* Scriptable configuration and control through a custom Wayland protocol and separate riverctl binary implementing it.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
River Classic is [[install]]ed with the {{pkg|river-classic}} package.&lt;br /&gt;
&lt;br /&gt;
== Starting ==&lt;br /&gt;
&lt;br /&gt;
A single executable file is used as a configuration file. No initialisation file is set up for the user by default, so no keybindings or default applications are available until an init file is created. Note that this includes the exit keybinding, so set up in tty or another desktop environment before running river.&lt;br /&gt;
&lt;br /&gt;
An example config init file is available in {{ic|/usr/share/river/example/}}.&lt;br /&gt;
Copy this as {{ic|~/.config/river/init}} and ensure it is [[executable]].&lt;br /&gt;
&lt;br /&gt;
=== Manually ===&lt;br /&gt;
&lt;br /&gt;
Enter {{ic|river}} (exits to tty with user still logged in) or {{ic|exec river}} (more securely exits to tty with user logged out)&lt;br /&gt;
&lt;br /&gt;
=== From TTY ===&lt;br /&gt;
&lt;br /&gt;
River can be autostarted in a similar manner to &#039;&#039;startx&#039;&#039;, by setting up the environment variable checks in {{ic|.bash_profile}} or the equivalent file for other shells. See [[Xinit#Autostart X at login]], replacing {{ic|$DISPLAY}} with {{ic|$WAYLAND_DISPLAY}}, and running {{ic|exec river}}.&lt;br /&gt;
&lt;br /&gt;
=== Display manager ===&lt;br /&gt;
&lt;br /&gt;
River does not officially support display managers but many will work with no or minimal effort. A session entry is installed by default in {{ic|/usr/share/wayland-sessions/}}.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The configuration file can be a shell script or executable program, comprising a list of &#039;&#039;riverctl&#039;&#039; individual commands which define key bindings, input settings and window rules. It is executed once at start-up but can be re-run like any other shell script (consider the effects of duplicating any autostarted spawned actions).&lt;br /&gt;
Each setting can also be run individually by simply running the relevant riverctl line in a terminal. This allows temporary override of the init settings, dynamic updates and testing new settings.&lt;br /&gt;
&lt;br /&gt;
For example, to map the shortcut {{ic|Super+PrtSc}} to take a screenshot with the application {{Pkg|grim}} and display a temporary [[desktop notification]]:&lt;br /&gt;
&lt;br /&gt;
 riverctl map normal Super Print spawn &amp;quot;grim &amp;amp;&amp;amp; notify-send -t 2000 &#039;Screenshot taken&#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;spawn&#039;&#039; command can launch any application or script but expects a single word argument. Quote any longer expressions.&lt;br /&gt;
&lt;br /&gt;
=== Keyboard layout ===&lt;br /&gt;
&lt;br /&gt;
 riverctl keyboard-layout gb&lt;br /&gt;
&lt;br /&gt;
Multiple layouts can be entered as a comma-separated list, e.g. {{ic|gb,fr}}.&lt;br /&gt;
&lt;br /&gt;
Variables and other shell constructs can be used: {{ic|1=mod=&#039;Mod4&#039;}}, {{ic|set term foot}}, etc, as per your shell.&lt;br /&gt;
&lt;br /&gt;
=== Touchpad examples ===&lt;br /&gt;
&lt;br /&gt;
Certain touchpad behaviour and focus preferences are available.&lt;br /&gt;
&lt;br /&gt;
 riverctl input pointer-2-7-SynPS/2_Synaptics_TouchPad tap enabled&lt;br /&gt;
 riverctl focus-follows-cursor normal&lt;br /&gt;
&lt;br /&gt;
Exact keyboard, mouse and touchpad models for use in these settings can be identified using:&lt;br /&gt;
&lt;br /&gt;
 $ riverctl list-inputs&lt;br /&gt;
&lt;br /&gt;
=== Window rules ===&lt;br /&gt;
&lt;br /&gt;
It is sometimes desirable to set certain windows to be non-tiling by default. Floating windows can be defined by class or title:&lt;br /&gt;
&lt;br /&gt;
 riverctl rule-add -app-id &#039;galculator&#039; float&lt;br /&gt;
 riverctl rule-add -app-id &#039;thunar&#039; float       # make all Thunar windows floating&lt;br /&gt;
 riverctl rule-add -app-id &#039;thunar&#039; -title &#039;* - Thunar&#039; no-float  # except main window&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Autostart ===&lt;br /&gt;
&lt;br /&gt;
Use {{ic|riverctl spawn}} without a keybinding to launch any executable at startup, for example:&lt;br /&gt;
&lt;br /&gt;
 riverctl spawn &amp;quot;i3-battery-popup -n -m &#039;Battery Low!&#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Scratchpads ===&lt;br /&gt;
&lt;br /&gt;
River does not define any scratchpads by default, but these can be set up on any tag beyond the default 0-9. First, define the tag number, then the key mapping to move an application to the scratchpad tag and toggle its appearance, and, finally, prevent new windows being assigned to the scratchpad.&lt;br /&gt;
&lt;br /&gt;
 scratch_tag=$((1 &amp;lt;&amp;lt; 20 ))&lt;br /&gt;
 &lt;br /&gt;
 riverctl map normal Super P toggle-focused-tags ${scratch_tag}		# toggle the scratchpad&lt;br /&gt;
 riverctl map normal Super+Shift P set-view-tags ${scratch_tag}		# send windows to the scratchpad&lt;br /&gt;
 &lt;br /&gt;
 # Set spawn tagmask to ensure new windows do not have the scratchpad tag unless explicitly set.&lt;br /&gt;
 all_but_scratch_tag=$(( ((1 &amp;lt;&amp;lt; 32) - 1) ^ $scratch_tag ))&lt;br /&gt;
 riverctl spawn-tagmask ${all_but_scratch_tag}&lt;br /&gt;
&lt;br /&gt;
=== Modes ===&lt;br /&gt;
&lt;br /&gt;
River supports modes for key mapping, which allows for reuse of mappings, and combinations of fewer keys. There are two default modes of &#039;normal&#039; and &#039;locked&#039; (defining allowed key mappings when the screen is locked).&lt;br /&gt;
Custom modes can be added. Eg. if floating windows are rarely used, the key mapping to manipulate those windows can be defined in a &#039;float&#039; mode. Entry and exit key mappings for the mode are set as the first and last mappings, with other mapping between these.&lt;br /&gt;
&lt;br /&gt;
 riverctl declare-mode float&lt;br /&gt;
 riverctl map normal Super R enter-mode float		# Super+R to enter float mode&lt;br /&gt;
  &lt;br /&gt;
 ### Floating window mappings but note that these also apply to tiled windows.&lt;br /&gt;
 #&lt;br /&gt;
 # Super {Arrows} to move views&lt;br /&gt;
   riverctl map float Super Left move left 100&lt;br /&gt;
   riverctl map float Super Down move down 100&lt;br /&gt;
   riverctl map float Super Up move up 100&lt;br /&gt;
   riverctl map float Super Right move right 100&lt;br /&gt;
  &lt;br /&gt;
 # Alt+{arrows} to snap views to screen edges&lt;br /&gt;
   riverctl map float Alt Left snap left&lt;br /&gt;
   riverctl map float Alt Down snap down&lt;br /&gt;
   riverctl map float Alt Up snap up&lt;br /&gt;
   riverctl map float Alt Right snap right&lt;br /&gt;
  &lt;br /&gt;
 # Shift+{arrows} to resize views&lt;br /&gt;
   riverctl map float Shift Left resize horizontal -100&lt;br /&gt;
   riverctl map float Shift Down resize vertical 100&lt;br /&gt;
   riverctl map float Shift Up resize vertical -100&lt;br /&gt;
   riverctl map float Shift Right resize horizontal 100&lt;br /&gt;
  &lt;br /&gt;
 riverctl map float None Escape enter-mode normal	# Escape to exit float mode and return to normal mode&lt;br /&gt;
&lt;br /&gt;
Note that floating window modifiers also work on tiled windows, making them floating and giving potentially unpredictable layouts.&lt;br /&gt;
&lt;br /&gt;
=== External tools ===&lt;br /&gt;
&lt;br /&gt;
In common with many other Wayland minimalist tiling clients, other tools are not included. Example external bars, screenshot tools, launchers, etc. are listed in the [https://codeberg.org/river/wiki-classic River wiki], including several with River-specific functionality.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Screencasting ===&lt;br /&gt;
&lt;br /&gt;
If Screencasting is not working with river, check if the needed [[environment variables]] are properly set for systemd:&lt;br /&gt;
 $ systemctl --user show-environment&lt;br /&gt;
&lt;br /&gt;
You should find something like:&lt;br /&gt;
 WAYLAND_DISPLAY=wayland-1&lt;br /&gt;
 XDG_CURRENT_DESKTOP=river&lt;br /&gt;
&lt;br /&gt;
If any of these variables are not set, you may add this to your {{ic|.config/river/init}}:&lt;br /&gt;
 systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP&lt;br /&gt;
 dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=river&lt;br /&gt;
 systemctl --user restart xdg-desktop-portal&lt;br /&gt;
&lt;br /&gt;
If you need further troubleshooting, try to:&lt;br /&gt;
* Make sure [[XDG Desktop Portal]] services are running:&lt;br /&gt;
 $ systemctl --user status xdg-desktop-portal.service&lt;br /&gt;
 $ systemctl --user status xdg-desktop-portal-wlr.service&lt;br /&gt;
&lt;br /&gt;
* Stop the {{ic|xdg-desktop-portal.service}} and run it manually to see if it works:&lt;br /&gt;
 $ systemctl --user stop xdg-desktop-portal&lt;br /&gt;
 $ XDG_CURRENT_DESKTOP=river /usr/lib/xdg-desktop-portal&lt;br /&gt;
&lt;br /&gt;
* Test it using [https://mozilla.github.io/webrtc-landing/gum_test.html Mozilla WebRTC test]&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
Contrary to what you may find in older posts in the internet, it is not necessary to install {{Pkg|pipewire-media-session}}, since {{Pkg|wireplumber}} is working just fine now.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://codeberg.org/river/river-classic/ River Codeberg repository]&lt;br /&gt;
* [https://codeberg.org/river/wiki-classic/ River wiki]&lt;br /&gt;
* [https://leon_plickat.srht.site/writing/river-setup-guide/article.html Developer set-up blog post]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=River_Classic&amp;diff=873897</id>
		<title>River Classic</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=River_Classic&amp;diff=873897"/>
		<updated>2026-05-14T09:14:43Z</updated>

		<summary type="html">&lt;p&gt;Indigo: grammar fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Lowercase title}}&lt;br /&gt;
[[Category:Wayland compositors]]&lt;br /&gt;
[[ja:River Classic]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|river}}&lt;br /&gt;
{{Related|Wayland#Compositors}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
[https://codeberg.org/river/river-classic river classic] is a wlroots-based Wayland dynamic tiling compositor, inspired by, but not based on dwm, xmonad and bspwm. Configuration is by an external executable file. It is the old branch of the now non-monolithic compositor [[river]].&lt;br /&gt;
&lt;br /&gt;
Its declared design goals are:&lt;br /&gt;
&lt;br /&gt;
* Simple and predictable behavior, river should be easy to use and have a low cognitive load.&lt;br /&gt;
* Window management based on a stack of views and tags.&lt;br /&gt;
* Dynamic layouts generated by external, user-written executables. A default rivertile layout generator is provided.&lt;br /&gt;
* Scriptable configuration and control through a custom Wayland protocol and separate riverctl binary implementing it.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
River Classic is [[install]]ed with the {{pkg|river-classic}} package.&lt;br /&gt;
&lt;br /&gt;
== Starting ==&lt;br /&gt;
&lt;br /&gt;
A single executable file is used as a configuration file. No initialisation file is set up for the user by default, so no keybindings or default applications are available until an init file is created. Note that this includes the exit keybinding, so set up in tty or another desktop environment before running river.&lt;br /&gt;
&lt;br /&gt;
An example config init file is available in {{ic|/usr/share/river/example/}}.&lt;br /&gt;
Copy this as {{ic|~/.config/river/init}} and ensure it is [[executable]].&lt;br /&gt;
&lt;br /&gt;
=== Manually ===&lt;br /&gt;
&lt;br /&gt;
Enter {{ic|river}} (exits to tty with user still logged in) or {{ic|exec river}} (more securely exits to tty with user logged out)&lt;br /&gt;
&lt;br /&gt;
=== From TTY ===&lt;br /&gt;
&lt;br /&gt;
River can be autostarted in a similar manner to &#039;&#039;startx&#039;&#039;, by setting up the environment variable checks in {{ic|.bash_profile}} or the equivalent file for other shells. See [[Xinit#Autostart X at login]], replacing {{ic|$DISPLAY}} with {{ic|$WAYLAND_DISPLAY}}, and running {{ic|exec river}}.&lt;br /&gt;
&lt;br /&gt;
=== Display manager ===&lt;br /&gt;
&lt;br /&gt;
River does not officially support display managers but many will work with no or minimal effort. A session entry is installed by default in {{ic|/usr/share/wayland-sessions/}}.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The configuration file can be a shell script or executable program, comprising a list of &#039;&#039;riverctl&#039;&#039; individual commands which define key bindings, input settings and window rules. It is executed once at start-up but can be re-run like any other shell script (consider the effects of duplicating any autostarted spawned actions).&lt;br /&gt;
Each setting can also be run individually by simply running the relevant riverctl line in a terminal. This allows temporary override of the init settings, dynamic updates and testing new settings.&lt;br /&gt;
&lt;br /&gt;
For example, to map the shortcut {{ic|Super+PrtSc}} to take a screenshot with the application {{Pkg|grim}} and display a temporary [[desktop notification]]:&lt;br /&gt;
&lt;br /&gt;
 riverctl map normal Super Print spawn &amp;quot;grim &amp;amp;&amp;amp; notify-send -t 2000 &#039;Screenshot taken&#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;spawn&#039;&#039; command can launch any application or script but expects a single word argument. Quote any longer expressions.&lt;br /&gt;
&lt;br /&gt;
=== Keyboard layout ===&lt;br /&gt;
&lt;br /&gt;
 riverctl keyboard-layout gb&lt;br /&gt;
&lt;br /&gt;
Multiple layouts can be entered as a comma-separated list, e.g. {{ic|gb,fr}}.&lt;br /&gt;
&lt;br /&gt;
Variables and other shell constructs can be used: {{ic|1=mod=&#039;Mod4&#039;}}, {{ic|set term foot}}, etc, as per your shell.&lt;br /&gt;
&lt;br /&gt;
=== Touchpad examples ===&lt;br /&gt;
&lt;br /&gt;
Certain touchpad behaviour and focus preferences are available.&lt;br /&gt;
&lt;br /&gt;
 riverctl input pointer-2-7-SynPS/2_Synaptics_TouchPad tap enabled&lt;br /&gt;
 riverctl focus-follows-cursor normal&lt;br /&gt;
&lt;br /&gt;
Exact keyboard, mouse and touchpad models for use in these settings can be identified using:&lt;br /&gt;
&lt;br /&gt;
 riverctl list-inputs&lt;br /&gt;
&lt;br /&gt;
=== Window rules ===&lt;br /&gt;
&lt;br /&gt;
It is sometimes desirable to set certain windows to be non-tiling by default. Floating windows can be defined by class or title:&lt;br /&gt;
&lt;br /&gt;
 riverctl rule-add -app-id &#039;galculator&#039; float&lt;br /&gt;
 riverctl rule-add -app-id &#039;thunar&#039; float       # make all Thunar windows floating&lt;br /&gt;
 riverctl rule-add -app-id &#039;thunar&#039; -title &#039;* - Thunar&#039; no-float  # except main window&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Autostart ===&lt;br /&gt;
&lt;br /&gt;
Use {{ic|riverctl spawn}} without a keybinding to launch any executable at startup, for example:&lt;br /&gt;
&lt;br /&gt;
 riverctl spawn &amp;quot;i3-battery-popup -n -m &#039;Battery Low!&#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Scratchpads ===&lt;br /&gt;
&lt;br /&gt;
River does not define any scratchpads by default, but these can be set up on any tag beyond the default 0-9. First, define the tag number, then the key mapping to move an application to the scratchpad tag and toggle its appearance, and, finally, prevent new windows being assigned to the scratchpad.&lt;br /&gt;
&lt;br /&gt;
 scratch_tag=$((1 &amp;lt;&amp;lt; 20 ))&lt;br /&gt;
 &lt;br /&gt;
 riverctl map normal Super P toggle-focused-tags ${scratch_tag}		# toggle the scratchpad&lt;br /&gt;
 riverctl map normal Super+Shift P set-view-tags ${scratch_tag}		# send windows to the scratchpad&lt;br /&gt;
 &lt;br /&gt;
 # Set spawn tagmask to ensure new windows do not have the scratchpad tag unless explicitly set.&lt;br /&gt;
 all_but_scratch_tag=$(( ((1 &amp;lt;&amp;lt; 32) - 1) ^ $scratch_tag ))&lt;br /&gt;
 riverctl spawn-tagmask ${all_but_scratch_tag}&lt;br /&gt;
&lt;br /&gt;
=== Modes ===&lt;br /&gt;
&lt;br /&gt;
River supports modes for key mapping, which allows for reuse of mappings, and combinations of fewer keys. There are two default modes of &#039;normal&#039; and &#039;locked&#039; (defining allowed key mappings when the screen is locked).&lt;br /&gt;
Custom modes can be added. Eg. if floating windows are rarely used, the key mapping to manipulate those windows can be defined in a &#039;float&#039; mode. Entry and exit key mappings for the mode are set as the first and last mappings, with other mapping between these.&lt;br /&gt;
&lt;br /&gt;
 riverctl declare-mode float&lt;br /&gt;
 riverctl map normal Super R enter-mode float		# Super+R to enter float mode&lt;br /&gt;
  &lt;br /&gt;
 ### Floating window mappings but note that these also apply to tiled windows.&lt;br /&gt;
 #&lt;br /&gt;
 # Super {Arrows} to move views&lt;br /&gt;
   riverctl map float Super Left move left 100&lt;br /&gt;
   riverctl map float Super Down move down 100&lt;br /&gt;
   riverctl map float Super Up move up 100&lt;br /&gt;
   riverctl map float Super Right move right 100&lt;br /&gt;
  &lt;br /&gt;
 # Alt+{arrows} to snap views to screen edges&lt;br /&gt;
   riverctl map float Alt Left snap left&lt;br /&gt;
   riverctl map float Alt Down snap down&lt;br /&gt;
   riverctl map float Alt Up snap up&lt;br /&gt;
   riverctl map float Alt Right snap right&lt;br /&gt;
  &lt;br /&gt;
 # Shift+{arrows} to resize views&lt;br /&gt;
   riverctl map float Shift Left resize horizontal -100&lt;br /&gt;
   riverctl map float Shift Down resize vertical 100&lt;br /&gt;
   riverctl map float Shift Up resize vertical -100&lt;br /&gt;
   riverctl map float Shift Right resize horizontal 100&lt;br /&gt;
  &lt;br /&gt;
 riverctl map float None Escape enter-mode normal	# Escape to exit float mode and return to normal mode&lt;br /&gt;
&lt;br /&gt;
Note that floating window modifiers also work on tiled windows, making them floating and giving potentially unpredictable layouts.&lt;br /&gt;
&lt;br /&gt;
=== External tools ===&lt;br /&gt;
&lt;br /&gt;
In common with many other Wayland minimalist tiling clients, other tools are not included. Example external bars, screenshot tools, launchers, etc. are listed in the [https://codeberg.org/river/wiki-classic River wiki], including several with River-specific functionality.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Screencasting ===&lt;br /&gt;
&lt;br /&gt;
If Screencasting is not working with river, check if the needed [[environment variables]] are properly set for systemd:&lt;br /&gt;
 $ systemctl --user show-environment&lt;br /&gt;
&lt;br /&gt;
You should find something like:&lt;br /&gt;
 WAYLAND_DISPLAY=wayland-1&lt;br /&gt;
 XDG_CURRENT_DESKTOP=river&lt;br /&gt;
&lt;br /&gt;
If any of these variables are not set, you may add this to your {{ic|.config/river/init}}:&lt;br /&gt;
 systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP&lt;br /&gt;
 dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=river&lt;br /&gt;
 systemctl --user restart xdg-desktop-portal&lt;br /&gt;
&lt;br /&gt;
If you need further troubleshooting, try to:&lt;br /&gt;
* Make sure [[XDG Desktop Portal]] services are running:&lt;br /&gt;
 $ systemctl --user status xdg-desktop-portal.service&lt;br /&gt;
 $ systemctl --user status xdg-desktop-portal-wlr.service&lt;br /&gt;
&lt;br /&gt;
* Stop the {{ic|xdg-desktop-portal.service}} and run it manually to see if it works:&lt;br /&gt;
 $ systemctl --user stop xdg-desktop-portal&lt;br /&gt;
 $ XDG_CURRENT_DESKTOP=river /usr/lib/xdg-desktop-portal&lt;br /&gt;
&lt;br /&gt;
* Test it using [https://mozilla.github.io/webrtc-landing/gum_test.html Mozilla WebRTC test]&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
Contrary to what you may find in older posts in the internet, it is not necessary to install {{Pkg|pipewire-media-session}}, since {{Pkg|wireplumber}} is working just fine now.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://codeberg.org/river/river-classic/ River Codeberg repository]&lt;br /&gt;
* [https://codeberg.org/river/wiki-classic/ River wiki]&lt;br /&gt;
* [https://leon_plickat.srht.site/writing/river-setup-guide/article.html Developer set-up blog post]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=River_Classic&amp;diff=873896</id>
		<title>River Classic</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=River_Classic&amp;diff=873896"/>
		<updated>2026-05-14T09:13:34Z</updated>

		<summary type="html">&lt;p&gt;Indigo: add related articles to link back to river&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Lowercase title}}&lt;br /&gt;
[[Category:Wayland compositors]]&lt;br /&gt;
[[ja:River Classic]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|River}}&lt;br /&gt;
{{Related|Wayland#Compositors}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
[https://codeberg.org/river/river-classic river classic] is a wlroots-based Wayland dynamic tiling compositor, inspired by, but not based on dwm, xmonad and bspwm. Configuration is by an external executable file. It is the old branch of the now non-monolithic compositor [[river]]&lt;br /&gt;
&lt;br /&gt;
Its declared design goals are:&lt;br /&gt;
&lt;br /&gt;
* Simple and predictable behavior, river should be easy to use and have a low cognitive load.&lt;br /&gt;
* Window management based on a stack of views and tags.&lt;br /&gt;
* Dynamic layouts generated by external, user-written executables. A default rivertile layout generator is provided.&lt;br /&gt;
* Scriptable configuration and control through a custom Wayland protocol and separate riverctl binary implementing it.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
River Classic is [[install]]ed with the {{pkg|river-classic}} package.&lt;br /&gt;
&lt;br /&gt;
== Starting ==&lt;br /&gt;
&lt;br /&gt;
A single executable file is used as a configuration file. No initialisation file is set up for the user by default, so no keybindings or default applications are available until an init file is created. Note that this includes the exit keybinding, so set up in tty or another desktop environment before running river.&lt;br /&gt;
&lt;br /&gt;
An example config init file is available in {{ic|/usr/share/river/example/}}.&lt;br /&gt;
Copy this as {{ic|~/.config/river/init}} and ensure it is [[executable]].&lt;br /&gt;
&lt;br /&gt;
=== Manually ===&lt;br /&gt;
&lt;br /&gt;
Enter {{ic|river}} (exits to tty with user still logged in) or {{ic|exec river}} (more securely exits to tty with user logged out)&lt;br /&gt;
&lt;br /&gt;
=== From TTY ===&lt;br /&gt;
&lt;br /&gt;
River can be autostarted in a similar manner to &#039;&#039;startx&#039;&#039;, by setting up the environment variable checks in {{ic|.bash_profile}} or the equivalent file for other shells. See [[Xinit#Autostart X at login]], replacing {{ic|$DISPLAY}} with {{ic|$WAYLAND_DISPLAY}}, and running {{ic|exec river}}.&lt;br /&gt;
&lt;br /&gt;
=== Display manager ===&lt;br /&gt;
&lt;br /&gt;
River does not officially support display managers but many will work with no or minimal effort. A session entry is installed by default in {{ic|/usr/share/wayland-sessions/}}.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The configuration file can be a shell script or executable program, comprising a list of &#039;&#039;riverctl&#039;&#039; individual commands which define key bindings, input settings and window rules. It is executed once at start-up but can be re-run like any other shell script (consider the effects of duplicating any autostarted spawned actions).&lt;br /&gt;
Each setting can also be run individually by simply running the relevant riverctl line in a terminal. This allows temporary override of the init settings, dynamic updates and testing new settings.&lt;br /&gt;
&lt;br /&gt;
For example, to map the shortcut {{ic|Super+PrtSc}} to take a screenshot with the application {{Pkg|grim}} and display a temporary [[desktop notification]]:&lt;br /&gt;
&lt;br /&gt;
 riverctl map normal Super Print spawn &amp;quot;grim &amp;amp;&amp;amp; notify-send -t 2000 &#039;Screenshot taken&#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;spawn&#039;&#039; command can launch any application or script but expects a single word argument. Quote any longer expressions.&lt;br /&gt;
&lt;br /&gt;
=== Keyboard layout ===&lt;br /&gt;
&lt;br /&gt;
 riverctl keyboard-layout gb&lt;br /&gt;
&lt;br /&gt;
Multiple layouts can be entered as a comma-separated list, e.g. {{ic|gb,fr}}.&lt;br /&gt;
&lt;br /&gt;
Variables and other shell constructs can be used: {{ic|1=mod=&#039;Mod4&#039;}}, {{ic|set term foot}}, etc, as per your shell.&lt;br /&gt;
&lt;br /&gt;
=== Touchpad examples ===&lt;br /&gt;
&lt;br /&gt;
Certain touchpad behaviour and focus preferences are available.&lt;br /&gt;
&lt;br /&gt;
 riverctl input pointer-2-7-SynPS/2_Synaptics_TouchPad tap enabled&lt;br /&gt;
 riverctl focus-follows-cursor normal&lt;br /&gt;
&lt;br /&gt;
Exact keyboard, mouse and touchpad models for use in these settings can be identified using:&lt;br /&gt;
&lt;br /&gt;
 riverctl list-inputs&lt;br /&gt;
&lt;br /&gt;
=== Window rules ===&lt;br /&gt;
&lt;br /&gt;
It is sometimes desirable to set certain windows to be non-tiling by default. Floating windows can be defined by class or title:&lt;br /&gt;
&lt;br /&gt;
 riverctl rule-add -app-id &#039;galculator&#039; float&lt;br /&gt;
 riverctl rule-add -app-id &#039;thunar&#039; float       # make all Thunar windows floating&lt;br /&gt;
 riverctl rule-add -app-id &#039;thunar&#039; -title &#039;* - Thunar&#039; no-float  # except main window&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Autostart ===&lt;br /&gt;
&lt;br /&gt;
Use {{ic|riverctl spawn}} without a keybinding to launch any executable at startup, for example:&lt;br /&gt;
&lt;br /&gt;
 riverctl spawn &amp;quot;i3-battery-popup -n -m &#039;Battery Low!&#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Scratchpads ===&lt;br /&gt;
&lt;br /&gt;
River does not define any scratchpads by default, but these can be set up on any tag beyond the default 0-9. First, define the tag number, then the key mapping to move an application to the scratchpad tag and toggle its appearance, and, finally, prevent new windows being assigned to the scratchpad.&lt;br /&gt;
&lt;br /&gt;
 scratch_tag=$((1 &amp;lt;&amp;lt; 20 ))&lt;br /&gt;
 &lt;br /&gt;
 riverctl map normal Super P toggle-focused-tags ${scratch_tag}		# toggle the scratchpad&lt;br /&gt;
 riverctl map normal Super+Shift P set-view-tags ${scratch_tag}		# send windows to the scratchpad&lt;br /&gt;
 &lt;br /&gt;
 # Set spawn tagmask to ensure new windows do not have the scratchpad tag unless explicitly set.&lt;br /&gt;
 all_but_scratch_tag=$(( ((1 &amp;lt;&amp;lt; 32) - 1) ^ $scratch_tag ))&lt;br /&gt;
 riverctl spawn-tagmask ${all_but_scratch_tag}&lt;br /&gt;
&lt;br /&gt;
=== Modes ===&lt;br /&gt;
&lt;br /&gt;
River supports modes for key mapping, which allows for reuse of mappings, and combinations of fewer keys. There are two default modes of &#039;normal&#039; and &#039;locked&#039; (defining allowed key mappings when the screen is locked).&lt;br /&gt;
Custom modes can be added. Eg. if floating windows are rarely used, the key mapping to manipulate those windows can be defined in a &#039;float&#039; mode. Entry and exit key mappings for the mode are set as the first and last mappings, with other mapping between these.&lt;br /&gt;
&lt;br /&gt;
 riverctl declare-mode float&lt;br /&gt;
 riverctl map normal Super R enter-mode float		# Super+R to enter float mode&lt;br /&gt;
  &lt;br /&gt;
 ### Floating window mappings but note that these also apply to tiled windows.&lt;br /&gt;
 #&lt;br /&gt;
 # Super {Arrows} to move views&lt;br /&gt;
   riverctl map float Super Left move left 100&lt;br /&gt;
   riverctl map float Super Down move down 100&lt;br /&gt;
   riverctl map float Super Up move up 100&lt;br /&gt;
   riverctl map float Super Right move right 100&lt;br /&gt;
  &lt;br /&gt;
 # Alt+{arrows} to snap views to screen edges&lt;br /&gt;
   riverctl map float Alt Left snap left&lt;br /&gt;
   riverctl map float Alt Down snap down&lt;br /&gt;
   riverctl map float Alt Up snap up&lt;br /&gt;
   riverctl map float Alt Right snap right&lt;br /&gt;
  &lt;br /&gt;
 # Shift+{arrows} to resize views&lt;br /&gt;
   riverctl map float Shift Left resize horizontal -100&lt;br /&gt;
   riverctl map float Shift Down resize vertical 100&lt;br /&gt;
   riverctl map float Shift Up resize vertical -100&lt;br /&gt;
   riverctl map float Shift Right resize horizontal 100&lt;br /&gt;
  &lt;br /&gt;
 riverctl map float None Escape enter-mode normal	# Escape to exit float mode and return to normal mode&lt;br /&gt;
&lt;br /&gt;
Note that floating window modifiers also work on tiled windows, making them floating and giving potentially unpredictable layouts.&lt;br /&gt;
&lt;br /&gt;
=== External tools ===&lt;br /&gt;
&lt;br /&gt;
In common with many other Wayland minimalist tiling clients, other tools are not included. Example external bars, screenshot tools, launchers, etc. are listed in the [https://codeberg.org/river/wiki-classic River wiki], including several with River-specific functionality.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Screencasting ===&lt;br /&gt;
&lt;br /&gt;
If Screencasting is not working with river, check if the needed [[environment variables]] are properly set for systemd:&lt;br /&gt;
 $ systemctl --user show-environment&lt;br /&gt;
&lt;br /&gt;
You should find something like:&lt;br /&gt;
 WAYLAND_DISPLAY=wayland-1&lt;br /&gt;
 XDG_CURRENT_DESKTOP=river&lt;br /&gt;
&lt;br /&gt;
If any of these variables are not set, you may add this to your {{ic|.config/river/init}}:&lt;br /&gt;
 systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP&lt;br /&gt;
 dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=river&lt;br /&gt;
 systemctl --user restart xdg-desktop-portal&lt;br /&gt;
&lt;br /&gt;
If you need further troubleshooting, try to:&lt;br /&gt;
* Make sure [[XDG Desktop Portal]] services are running:&lt;br /&gt;
 $ systemctl --user status xdg-desktop-portal.service&lt;br /&gt;
 $ systemctl --user status xdg-desktop-portal-wlr.service&lt;br /&gt;
&lt;br /&gt;
* Stop the {{ic|xdg-desktop-portal.service}} and run it manually to see if it works:&lt;br /&gt;
 $ systemctl --user stop xdg-desktop-portal&lt;br /&gt;
 $ XDG_CURRENT_DESKTOP=river /usr/lib/xdg-desktop-portal&lt;br /&gt;
&lt;br /&gt;
* Test it using [https://mozilla.github.io/webrtc-landing/gum_test.html Mozilla WebRTC test]&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
Contrary to what you may find in older posts in the internet, it is not necessary to install {{Pkg|pipewire-media-session}}, since {{Pkg|wireplumber}} is working just fine now.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://codeberg.org/river/river-classic/ River Codeberg repository]&lt;br /&gt;
* [https://codeberg.org/river/wiki-classic/ River wiki]&lt;br /&gt;
* [https://leon_plickat.srht.site/writing/river-setup-guide/article.html Developer set-up blog post]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=River&amp;diff=873895</id>
		<title>River</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=River&amp;diff=873895"/>
		<updated>2026-05-14T09:12:26Z</updated>

		<summary type="html">&lt;p&gt;Indigo: move note below article preface including grammar fixes.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Wayland compositors]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|River Classic}}&lt;br /&gt;
{{Related|Wayland#Compositors}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
According to [https://isaacfreund.com/software/river River&#039;s homepage]:&lt;br /&gt;
:River is a non-monolithic Wayland compositor. Unlike other Wayland compositors, river does not combine the compositor and window manager into one program. Instead, users can choose any window manager implementing the river-window-management-v1 protocol. &lt;br /&gt;
&lt;br /&gt;
The stated goals for River is to make getting into Wayland development easier and to allow its &amp;quot;window managers&amp;quot; to be more experimental as they do not need to write a whole compositor. This also allows for things not normally possible with Wayland Compositors such as reloading configurations without closing all windows.&lt;br /&gt;
&lt;br /&gt;
{{note|This page is about the non-monolithic version of River, if you are looking for the dynamic tiling version, look at [[River Classic]].}}&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
River is [[install]]ed with the {{pkg|river}} package.&lt;br /&gt;
&lt;br /&gt;
A separate window manager will need to be installed as well. See also [https://codeberg.org/river/wiki/src/branch/main/pages/wm-list.md River&#039;s wiki] for a more comprehensive list of window managers.&lt;br /&gt;
&lt;br /&gt;
=== Stacking ===&lt;br /&gt;
*{{App|Canoe|Stacking window manager with classic look and feel written in Rust.|https://github.com/roblillack/canoe|{{AUR|canoe}}}}&lt;br /&gt;
&lt;br /&gt;
=== Tiling ===&lt;br /&gt;
* {{App|Kwm|Window manager inspired by [[dwm]] with its built in bar.|https://github.com/kewuaa/kwm|{{AUR|kwm}}}}&lt;br /&gt;
=== Other ===&lt;br /&gt;
* {{App|Rill|A minimalist scrolling window manager with simple animation.|https://codeberg.org/lzj15/rill|{{AUR|rill}}}}&lt;br /&gt;
&lt;br /&gt;
== Starting ==&lt;br /&gt;
&lt;br /&gt;
River can be started by a [[display manager]] or with the command below.&lt;br /&gt;
&lt;br /&gt;
 river&lt;br /&gt;
&lt;br /&gt;
River can be started with select window manager with the &amp;quot;c&amp;quot; argument.&lt;br /&gt;
&lt;br /&gt;
 river -c foo&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
River is configured through a executable shell file, by default it is located in {{ic|$XDG_CONFIG_HOME/river/init}}. By default this is {{ic|~/.config/river/init}}.&lt;br /&gt;
&lt;br /&gt;
River can use a different configuration if it is called with the &amp;quot;c&amp;quot; argument.&lt;br /&gt;
&lt;br /&gt;
 river -c customConfPath&lt;br /&gt;
=== Selecting a default window manager ===&lt;br /&gt;
A window manager can be made the default by appending it to River&#039;s configuration file.&lt;br /&gt;
&lt;br /&gt;
=== Autostart ===&lt;br /&gt;
Since the configuration is executed by the [https://en.wikipedia.org/wiki/Bourne_shell bourne shell]. Commands placed inside the configuration will be executed on start up, certain window managers also allow for autostarting in their configurations.&lt;br /&gt;
&lt;br /&gt;
=== Input configuration ===&lt;br /&gt;
Input configuration can be done in multiple ways. Some window managers support input configuration.&lt;br /&gt;
&lt;br /&gt;
There are separate  input managers such as [https://codeberg.org/Sivecano/channel Channel] and {{AUR|kwim}} that can be used.&lt;br /&gt;
&lt;br /&gt;
If only the keyboard layout needs to be changed. Change the [[environment variable]]{{ic|XKB_DEFAULT_LAYOUT}} to the needed layout; example &amp;quot;gb&amp;quot; for UK keyboards.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Configuration file does nothing ===&lt;br /&gt;
&lt;br /&gt;
This may be caused by the configuration file lacking execution permissions. See [[File permissions and attributes]].&lt;br /&gt;
&lt;br /&gt;
=== Screencast via WebRTC does not work ===&lt;br /&gt;
&lt;br /&gt;
See [[River Classic#Troubleshooting]].&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://isaacfreund.com/docs/wayland/ River protocols specifications]&lt;br /&gt;
* [https://codeberg.org/river/tinyrwm Example window manager]&lt;br /&gt;
*[https://codeberg.org/river/wiki River wiki]&lt;br /&gt;
*[https://codeberg.org/river/river Official Codeberg repository]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Niri&amp;diff=873893</id>
		<title>Niri</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Niri&amp;diff=873893"/>
		<updated>2026-05-14T08:38:54Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Starting */ apply Help:Style#Command line text&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Wayland compositors]]&lt;br /&gt;
[[ja:Niri]]&lt;br /&gt;
[[zh-hans:Niri]]&lt;br /&gt;
[https://github.com/niri-wm/niri Niri] is a scrollable tiling [[Wayland]] compositor. Unlike [[Sway]] or [[Hyprland]], Niri arranges the windows in an infinite horizontal desktop, where you can scroll to the left or to the right (although more advanced layouts are possible). It is similar to [[GNOME]]&#039;s PaperWM and [[KDE]]&#039;s [https://aur.archlinux.org/packages/kwin-karousel Karousel].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Niri can be [[install]]ed with the {{pkg|niri}} package. Additionally, to have a better experience, you may want to install:&lt;br /&gt;
&lt;br /&gt;
* {{pkg|fuzzel}}: default application launcher in Niri&lt;br /&gt;
* {{pkg|mako}}: notifications&lt;br /&gt;
* [[waybar]]: a Wayland bar&lt;br /&gt;
* {{pkg|xdg-desktop-portal-gtk}}, {{pkg|xdg-desktop-portal-gnome}}: to be able to do screen sharing&lt;br /&gt;
* [[alacritty]]: default terminal in Niri&lt;br /&gt;
* {{pkg|swaybg}}: background image&lt;br /&gt;
* {{pkg|swayidle}}, {{pkg|swaylock}}: to lock the screen on idle status&lt;br /&gt;
* {{pkg|xwayland-satellite}}: to run X11 apps&lt;br /&gt;
* {{pkg|udiskie}}: to manage and auto-mount USB drives&lt;br /&gt;
* {{pkg|dms-shell-niri}} or {{AUR|noctalia-shell}}: complete desktop shell&lt;br /&gt;
&lt;br /&gt;
== Starting ==&lt;br /&gt;
&lt;br /&gt;
Niri comes with a [[desktop entry]] that can be sourced by [[display manager]]s; selecting it will run {{ic|niri-session}} which handles exporting [[environment variables]] to [[systemd]].&lt;br /&gt;
&lt;br /&gt;
Additionally you can start Niri from a [[getty]] by executing:&lt;br /&gt;
&lt;br /&gt;
 $ niri-session -l&lt;br /&gt;
&lt;br /&gt;
This can be paired with [[Getty#Automatic login to virtual console|auto login]] to have a seamless [[boot]] experience.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
Niri reads the configuration from {{ic|~/.config/niri/config.kdl}}. It is a KDL file, divided by sections. The default configuration, created on the first run, documents the default options with comments. However, options introduced with updates will not be documented in the user&#039;s configuration; you may check [https://niri-wm.github.io/niri/Configuration:-Introduction.html Niri&#039;s official documentation] instead.&lt;br /&gt;
&lt;br /&gt;
{{Note|When using LXQt, the configuration needs to be stored in a different location; see [[LXQt#Wayland Session]].}}&lt;br /&gt;
&lt;br /&gt;
Niri automatically applies the configuration when it is saved. The live reload of invalid configuration will not crash Niri; instead, the last working state is preserved, and the user is notified of the configuration error. {{ic|niri validate}} can be invoked to validate the configuration outside of a Niri session.&lt;br /&gt;
&lt;br /&gt;
=== Keymap ===&lt;br /&gt;
&lt;br /&gt;
To configure the keymap, edit the {{ic|input/keyboard/xkb}} section. &lt;br /&gt;
&lt;br /&gt;
For example, if you want to have a &amp;quot;US Int Alt Gr&amp;quot; layout with {{ic|CapsLock}} acting as {{ic|Ctrl}} key:&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/niri/config.kdl|&lt;br /&gt;
input {&lt;br /&gt;
    keyboard {&lt;br /&gt;
        xkb {&lt;br /&gt;
            layout &amp;quot;us&amp;quot;&lt;br /&gt;
            variant &amp;quot;altgr-intl&amp;quot;&lt;br /&gt;
            options &amp;quot;ctrl:nocaps&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    ...&lt;br /&gt;
}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Outputs ===&lt;br /&gt;
&lt;br /&gt;
First run {{ic|niri msg outputs}} to get an overview of the outputs recognized by Niri. Then you can apply configs to each monitor. For example to set the HDMI monitor to 2560x1440 60Hz with a 1.2 scaling, and turning off the laptop monitor, set the following:&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/niri/config.kdl|&lt;br /&gt;
output &amp;quot;HDMI-A-1&amp;quot; {&lt;br /&gt;
    mode &amp;quot;2560x1440@60.000&amp;quot;&lt;br /&gt;
    scale 1.2&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
output &amp;quot;eDP-1&amp;quot; {&lt;br /&gt;
    off&lt;br /&gt;
}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Alternatively, you can use [[kanshi]] to set up dynamic layouts, for example, if you want to turn off an internal laptop screen when docked to a monitor.}}&lt;br /&gt;
&lt;br /&gt;
=== Bindings ===&lt;br /&gt;
&lt;br /&gt;
The binds section allows to set up the different key combinations that have effect on Niri. Many bindings are already set in the default configuration generated on first launch. These are all remappable.  &lt;br /&gt;
&lt;br /&gt;
Please note that Niri does &#039;&#039;not&#039;&#039; load any default bindings. If a binding is not specified in the configuration, it will not be active. &amp;quot;Defaults&amp;quot; are simply bindings that are present in the automatically generated configuration. Therefore, take care when removing the bindings. It is recommended to instead comment out unused bindings.&lt;br /&gt;
&lt;br /&gt;
Bindings are defined using the modifiers keys appended with a {{ic|+}} sign and the action between brackets. The special action &#039;spawn&#039; will launch a program. For example, you will find the following bindings that spawn [[alacritty]] and {{pkg|fuzzel}} on {{ic|Mod+T}} and {{ic|Mod+D}} respectively. {{ic|Mod}} is usually the {{ic|Super}} key if running standalone, but it is {{ic|Alt}} if it is running inside of another compositor.&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/niri/config.kdl|&lt;br /&gt;
binds {&lt;br /&gt;
    ...&lt;br /&gt;
    Mod+T { spawn &amp;quot;alacritty&amp;quot;; }&lt;br /&gt;
    Mod+D { spawn &amp;quot;fuzzel&amp;quot;; }&lt;br /&gt;
    ...&lt;br /&gt;
}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Note that all space-separated arguments to processes started by {{ic|spawn}} must be enclosed in quotes:&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/niri/config.kdl|&lt;br /&gt;
binds {&lt;br /&gt;
    ...&lt;br /&gt;
    Mod+Ctrl+semicolon {&lt;br /&gt;
        spawn &amp;quot;swaylock&amp;quot; &amp;quot;-c&amp;quot; &amp;quot;121212&amp;quot; &amp;quot;-e&amp;quot; &amp;quot;-f&amp;quot; &amp;quot;-F&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    ...&lt;br /&gt;
}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== WASD-like navigation ====&lt;br /&gt;
&lt;br /&gt;
It is possible to configure Niri workspaces and bindings so that jumping through windows follows a navigation similar to WASD as in games.&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/niri/config.kdl|&lt;br /&gt;
binds {&lt;br /&gt;
    ...&lt;br /&gt;
    Mod+A { focus-column-left; }&lt;br /&gt;
    Mod+S { focus-window-or-workspace-down; }&lt;br /&gt;
    Mod+W { focus-window-or-workspace-up; }&lt;br /&gt;
    Mod+D { focus-column-right; }&lt;br /&gt;
    ...&lt;br /&gt;
}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Be aware that this config will probably need other bindings to be remapped as well. Also, some people may prefer to have the WASD navigation on the right-hand side, or have a more Vim-like navigation.&lt;br /&gt;
&lt;br /&gt;
=== Autostart ===&lt;br /&gt;
&lt;br /&gt;
Niri allows some programs to be started alongside with Niri. &lt;br /&gt;
For example, some of the programs mentioned beforehand like {{Pkg|mako}}, {{Pkg|waybar}} and {{Pkg|swayidle}}/{{Pkg|swaylock}} can be configured:&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/niri/config.kdl|&lt;br /&gt;
spawn-at-startup &amp;quot;mako&amp;quot;&lt;br /&gt;
spawn-at-startup &amp;quot;waybar&amp;quot;&lt;br /&gt;
spawn-at-startup &amp;quot;swayidle&amp;quot; &amp;quot;-w&amp;quot; &amp;quot;timeout&amp;quot; &amp;quot;601&amp;quot; &amp;quot;niri msg action power-off-monitors&amp;quot; &amp;quot;timeout&amp;quot; &amp;quot;600&amp;quot; &amp;quot;swaylock -f&amp;quot; &amp;quot;before-sleep&amp;quot; &amp;quot;swaylock -f&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Note that these processes are tied to the Niri session, and they will be killed when Niri exits &#039;&#039;&#039;or&#039;&#039;&#039; is suspended. To make a process persist, you may set it to a background task by providing the {{ic|&amp;quot;&amp;amp;&amp;quot;}} argument.&lt;br /&gt;
&lt;br /&gt;
=== XWayland ===&lt;br /&gt;
&lt;br /&gt;
Niri does not provide XWayland support for running X11 applications. Instead, it recommends using an external tool: {{Pkg|xwayland-satellite}} is listed in the optional dependencies. After installation, no configuration is required.&lt;br /&gt;
&lt;br /&gt;
{{Note|1=Since niri 25.08, {{Pkg|xwayland-satellite}} is integrated out of the box. Ensure xwayland-satellite &amp;gt;= 0.7 is installed and available in $PATH. No manual configuration is required.}}&lt;br /&gt;
&lt;br /&gt;
=== Multi GPU Configuration ===&lt;br /&gt;
&lt;br /&gt;
In laptop (or PC) setups with both integrated graphics and a dedicated GPU, Niri may default to using the dedicated GPU for both the compositor and starting other applications, causing unnecessary battery drain.&lt;br /&gt;
&lt;br /&gt;
{{Note|For NVIDIA cards, see [[PRIME]] for how to set your GPU to properly enter a low power state, and how to launch applications with that GPU.}}&lt;br /&gt;
&lt;br /&gt;
To set what GPU Niri should use, first check which render devices are available on your system:&lt;br /&gt;
{{hc|&lt;br /&gt;
$ ls -l /dev/dri/by-path/*-render|&lt;br /&gt;
lrwxrwxrwx 1 root root 13 Jan 10 13:02 /dev/dri/by-path/pci-0000:c1:00.0-render -&amp;gt; ../renderD129&lt;br /&gt;
lrwxrwxrwx 1 root root 13 Jan 10 13:02 /dev/dri/by-path/pci-0000:c2:00.0-render -&amp;gt; ../renderD128&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Then, use the PCI address to identify the correct device you want to use for Niri in {{ic|/dev/dri}}:&lt;br /&gt;
{{hc|&lt;br /&gt;
$ lspci -s c1:00.0|&lt;br /&gt;
c1:00.0 VGA compatible controller: NVIDIA Corporation GB206M [GeForce RTX 5070 Max-Q / Mobile] (rev a1)&lt;br /&gt;
}}&lt;br /&gt;
If the first PCI address is the wrong card, try the next one.&lt;br /&gt;
&lt;br /&gt;
Finally add to Niri&#039;s configuration and specify the correct render device based on the PCI address you identified:&lt;br /&gt;
{{hc|&lt;br /&gt;
~/.config/niri/config.kdl|&lt;br /&gt;
debug {&lt;br /&gt;
    render-drm-device &amp;quot;/dev/dri/renderD128&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Reboot your computer. You can now check if one of the rendering devices is correctly in a low power state using:&lt;br /&gt;
{{hc|&lt;br /&gt;
$ cat /sys/class/drm/card*/device/power_state|&lt;br /&gt;
D3cold&lt;br /&gt;
D0&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://niri-wm.github.io/niri/ Niri&#039;s own wiki]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Proxy_server&amp;diff=873827</id>
		<title>Proxy server</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Proxy_server&amp;diff=873827"/>
		<updated>2026-05-13T13:15:33Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* HTTPS MITM proxies */ reorder as subsection&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Proxy servers]]&lt;br /&gt;
[[Category:Network configuration]]&lt;br /&gt;
[[ja:プロキシ設定]]&lt;br /&gt;
[[zh-hans:Proxy server]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|HTTP tunneling}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
&lt;br /&gt;
According to [[Wikipedia:Proxy server|Wikipedia]]:&lt;br /&gt;
:In computer networks, a proxy server is a server (a computer system or an application) that acts as an intermediary for requests from clients seeking resources from other servers.&lt;br /&gt;
&lt;br /&gt;
Proxying can be applied in common Internet protocols such as HTTP or [[Wikipedia:SOCKS|SOCKS]].&lt;br /&gt;
&lt;br /&gt;
== Environment variables ==&lt;br /&gt;
&lt;br /&gt;
{{Expansion|To export the environment everywhere (more or less), they could be set in {{ic|/etc/environment}}, {{ic|/etc/environment.d/*.conf}} and {{ic|~/.config/environment.d/*.conf}}.}}&lt;br /&gt;
&lt;br /&gt;
Some programs, such as [[wget]] and (used by [[pacman]]) [[CURL]], use environment variables of the form {{ic|&#039;&#039;protocol&#039;&#039;_proxy}} to determine the proxy for a given protocol (e.g. HTTP, FTP, ...).&lt;br /&gt;
&lt;br /&gt;
Below is an example on how to set these variables in a shell:&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
export http_proxy=http://10.203.0.1:5187/&lt;br /&gt;
export https_proxy=$http_proxy&lt;br /&gt;
export ftp_proxy=$http_proxy&lt;br /&gt;
export rsync_proxy=$http_proxy&lt;br /&gt;
export no_proxy=&amp;quot;localhost,127.0.0.1,localaddress,.localdomain.com&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Some programs look for the all caps version of the environment variables.&lt;br /&gt;
&lt;br /&gt;
If the proxy environment variables are to be made available to all users and all applications, the above mentioned export commands may be added to a script, say {{ic|proxy.sh}} inside {{ic|/etc/profile.d/}}. The script has to be then made [[executable]]. This method is helpful while using a desktop environment like [[Xfce]] which does not provide an option for proxy configuration. For example, [[Chromium]] browser will make use of the variables set using this method while running XFCE. &lt;br /&gt;
&lt;br /&gt;
Alternatively, there is a tool named {{AUR|proxyman-git}} which claims to configure system-wide proxy settings easily. It also handles proxy configurations of other software like [[git]], [[npm]], [[Dropbox]], etc.&lt;br /&gt;
 &lt;br /&gt;
Alternatively you can automate the toggling of the variables by adding a function to your {{ic|.bashrc}}:&lt;br /&gt;
&lt;br /&gt;
{{bc|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
function proxy_on() {&lt;br /&gt;
    export no_proxy=&amp;quot;localhost,127.0.0.1,localaddress,.localdomain.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    if (( $# &amp;gt; 0 )); then&lt;br /&gt;
        valid=$(echo $@ | sed -n &#039;s/\([0-9]\{1,3\}.\?\)\{4\}:\([0-9]\+\)/&amp;amp;/p&#039;)&lt;br /&gt;
        if [[ $valid != $@ ]]; then&lt;br /&gt;
            &amp;gt;&amp;amp;2 echo &amp;quot;Invalid address&amp;quot;&lt;br /&gt;
            return 1&lt;br /&gt;
        fi&lt;br /&gt;
        local proxy=$1&lt;br /&gt;
        export http_proxy=&amp;quot;$proxy&amp;quot; \&lt;br /&gt;
               https_proxy=$proxy \&lt;br /&gt;
               ftp_proxy=$proxy \&lt;br /&gt;
               rsync_proxy=$proxy&lt;br /&gt;
        echo &amp;quot;Proxy environment variable set.&amp;quot;&lt;br /&gt;
        return 0&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    echo -n &amp;quot;username: &amp;quot;; read username&lt;br /&gt;
    if [[ $username != &amp;quot;&amp;quot; ]]; then&lt;br /&gt;
        echo -n &amp;quot;password: &amp;quot;&lt;br /&gt;
        read -es password&lt;br /&gt;
        local pre=&amp;quot;$username:$password@&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    echo -n &amp;quot;server: &amp;quot;; read server&lt;br /&gt;
    echo -n &amp;quot;port: &amp;quot;; read port&lt;br /&gt;
    local proxy=$pre$server:$port&lt;br /&gt;
    export http_proxy=&amp;quot;$proxy&amp;quot; \&lt;br /&gt;
           https_proxy=$proxy \&lt;br /&gt;
           ftp_proxy=$proxy \&lt;br /&gt;
           rsync_proxy=$proxy \&lt;br /&gt;
           HTTP_PROXY=$proxy \&lt;br /&gt;
           HTTPS_PROXY=$proxy \&lt;br /&gt;
           FTP_PROXY=$proxy \&lt;br /&gt;
           RSYNC_PROXY=$proxy&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function proxy_off(){&lt;br /&gt;
    unset http_proxy https_proxy ftp_proxy rsync_proxy \&lt;br /&gt;
          HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY&lt;br /&gt;
    echo -e &amp;quot;Proxy environment variable removed.&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Omit username or password if they are not needed.&lt;br /&gt;
&lt;br /&gt;
As an alternative, you may want to use the following script.&lt;br /&gt;
Change the strings {{ic|YourUserName}}, {{ic|ProxyServerAddress:Port}}, {{ic|LocalAddress}} and {{ic|LocalDomain}} to match your own data, then edit your {{ic|~/.bashrc}} to include the edited functions. Any new bash window will have the new functions. In existing bash windows, type {{ic|source ~/.bashrc}}.&lt;br /&gt;
You may prefer to put function definitions in a separate file like {{ic|functions}} then add {{ic|source functions}} to {{ic|.bashrc}} instead of putting everything in {{ic|.bashrc}}. You may also want to change the name &amp;quot;myProxy&amp;quot; into something short and easy to write.&lt;br /&gt;
&lt;br /&gt;
{{bc|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
assignProxy(){&lt;br /&gt;
   PROXY_ENV=&amp;quot;http_proxy ftp_proxy https_proxy all_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY ALL_PROXY&amp;quot;&lt;br /&gt;
   for envar in $PROXY_ENV&lt;br /&gt;
   do&lt;br /&gt;
      export $envar=$1&lt;br /&gt;
   done&lt;br /&gt;
   for envar in &amp;quot;no_proxy NO_PROXY&amp;quot;&lt;br /&gt;
   do&lt;br /&gt;
      export $envar=$2&lt;br /&gt;
   done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
clrProxy(){&lt;br /&gt;
    PROXY_ENV=&amp;quot;http_proxy ftp_proxy https_proxy all_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY ALL_PROXY&amp;quot;&lt;br /&gt;
    for envar in $PROXY_ENV&lt;br /&gt;
    do&lt;br /&gt;
       unset $envar&lt;br /&gt;
    done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
myProxy(){&lt;br /&gt;
   user=YourUserName&lt;br /&gt;
   read -p &amp;quot;Password: &amp;quot; -s pass &amp;amp;&amp;amp;  echo -e &amp;quot; &amp;quot;&lt;br /&gt;
   proxy_value=&amp;quot;http://$user:$pass@ProxyServerAddress:Port&amp;quot;&lt;br /&gt;
   no_proxy_value=&amp;quot;localhost,127.0.0.1,LocalAddress,LocalDomain.com&amp;quot;&lt;br /&gt;
   assignProxy $proxy_value $no_proxy_value&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Keep proxy through sudo ===&lt;br /&gt;
&lt;br /&gt;
If the proxy [[environment variables]] are set for the user only they will get lost when running commands with [[sudo]] (or when programs use sudo internally).&lt;br /&gt;
&lt;br /&gt;
A way to prevent that is to add the following line to a [[sudo]] configuration file:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/sudoers.d/05_proxy|2=&lt;br /&gt;
Defaults env_keep += &amp;quot;*_proxy *_PROXY&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Automation with network managers ===&lt;br /&gt;
&lt;br /&gt;
* [[NetworkManager]] cannot change the environment variables.&lt;br /&gt;
* [[netctl]] could set-up these environment variables but they would not be seen by other applications as they are not child of netctl.&lt;br /&gt;
&lt;br /&gt;
== About libproxy ==&lt;br /&gt;
&lt;br /&gt;
{{Pkg|libproxy}} is an abstraction library which should be used by all applications that want to access a network resource. It still is in development but could lead to a unified and automated handling of proxies in GNU/Linux if widely adopted.&lt;br /&gt;
&lt;br /&gt;
The role of libproxy is to read the proxy settings from different sources and make them available to applications which use the library. The interesting part with libproxy is that it offers an implementation of the [[Wikipedia:Web_Proxy_Autodiscovery_Protocol|Web Proxy Autodiscovery Protocol]] and an implementation of [[Wikipedia:Proxy_auto-config|Proxy Auto-Config]] that goes with it.&lt;br /&gt;
&lt;br /&gt;
The {{ic|/usr/bin/proxy}} binary takes URL(s) as argument(s) and returns the proxy/proxies that could be used to fetch this/these network resource(s).&lt;br /&gt;
&lt;br /&gt;
{{Note|1=the version 0.4.11 does not support {{ic|1=http_proxy=&#039;wpad:&#039;}} because {{ic|1={ pkg-config &#039;mozjs185 &amp;gt;= 1.8.5&#039;; } }} fails .}}&lt;br /&gt;
&lt;br /&gt;
== Web proxy options ==&lt;br /&gt;
&lt;br /&gt;
* [[Squid]] is a very popular caching/optimizing proxy.&lt;br /&gt;
* [[Privoxy]] is an anonymizing and ad-blocking proxy.&lt;br /&gt;
* {{Pkg|tinyproxy}} is a small, efficient HTTP/SSL proxy daemon.&lt;br /&gt;
* For a simple proxy, [[ssh]] with port forwarding can be used.&lt;br /&gt;
&lt;br /&gt;
=== Simple Proxy with SSH ===&lt;br /&gt;
&lt;br /&gt;
Connect to a server (HOST) on which you have an account (USER) as follows&lt;br /&gt;
&lt;br /&gt;
 $ ssh -D &#039;&#039;PORT&#039;&#039; &#039;&#039;USER&#039;&#039;@&#039;&#039;HOST&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For PORT, choose some number which is not an IANA registered port. This specifies that traffic on the local &#039;&#039;PORT&#039;&#039; will be forwarded to the remote &#039;&#039;HOST&#039;&#039;. ssh will act as a [[Wikipedia:SOCKS|SOCKS]] server. Software supporting SOCKS proxy servers can simply be configured to connect to &#039;&#039;PORT&#039;&#039; on localhost. See  [[OpenSSH#Forwarding other ports]].&lt;br /&gt;
&lt;br /&gt;
=== HTTPS MITM proxies ===&lt;br /&gt;
&lt;br /&gt;
When debugging HTTPS connections it is sometimes useful to intercept them outside of the browser. In order for the TLS MITM to work you need to trust a [[certificate authority]] of the proxy either in your browser or system-wide.&lt;br /&gt;
&lt;br /&gt;
* {{App|Charles|Graphical trialware written in Java.|https://www.charlesproxy.com/|{{AUR|charles}}}}&lt;br /&gt;
* {{App|Fiddler|Proprietary and graphical, running on Mono.|https://www.telerik.com/fiddler|{{AUR|fiddler-appimage}}}}&lt;br /&gt;
* {{App|microsocks|Plain simple SOCKS5 proxy server, written in C.|https://github.com/rofl0r/microsocks|{{Pkg|microsocks}}}}&lt;br /&gt;
* {{App|mitmproxy|Command-line and web interface, written in Python, also has API.|https://mitmproxy.org/|{{Pkg|mitmproxy}}}}&lt;br /&gt;
* {{App|sslsplit|Works with any TLS connections but cannot act as a HTTP proxy in a browser, written in C.|https://www.roe.ch/SSLsplit|{{Pkg|sslsplit}}}}&lt;br /&gt;
&lt;br /&gt;
== Using a SOCKS proxy ==&lt;br /&gt;
&lt;br /&gt;
There are two cases:&lt;br /&gt;
&lt;br /&gt;
* the application you want to use handles [[Wikipedia:SOCKS#SOCKS5|SOCKS5]] proxies (for example [[Firefox]]), then you just have to configure it to use the proxy.&lt;br /&gt;
* the application you want to use does not handle SOCKS proxies, then you can try to use {{Pkg|proxychains-ng}}, {{AUR|proxy-ns}}, or [[tor#Torsocks|torsocks]].&lt;br /&gt;
&lt;br /&gt;
In Firefox, you can use the SOCKS proxy in the menu &#039;&#039;Preferences &amp;gt; Network &amp;gt; Settings&#039;&#039;. Choose &#039;&#039;Manual Proxy Configuration&#039;&#039;, and set the SOCKS Host (and only this one, make sure the other fields, such as HTTP Proxy or SSL Proxy are left empty). For example, if a SOCKS5 proxy is running on localhost port 8080, put {{ic|127.0.0.1}} in the SOCKS Host field, {{ic|8080}} in the Port field, and validate.&lt;br /&gt;
&lt;br /&gt;
If using &#039;&#039;proxychains-ng&#039;&#039;, the configuration takes place in {{ic|/etc/proxychains.conf}}. You may have to uncomment the last line (set by default to use [[Tor]]), and replace it with the parameters of the SOCKS proxy. For example, if you are using the same SOCKS5 proxy as above, you will have to replace the last line by:&lt;br /&gt;
&lt;br /&gt;
 socks5 127.0.0.1 8080&lt;br /&gt;
&lt;br /&gt;
Then, &#039;&#039;proxychains-ng&#039;&#039; can be launched with &lt;br /&gt;
&lt;br /&gt;
 $ proxychains &#039;&#039;program&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Where {{ic|&#039;&#039;program&#039;&#039;}} can be any program already installed on your system (e.g. xterm, gnome-terminal, etc).&lt;br /&gt;
&lt;br /&gt;
If using &#039;&#039;proxy-ns&#039;&#039;, the configuration takes place in {{ic|/etc/proxy-ns/config.json}}. You may have to change the &#039;&#039;socks5_address&#039;&#039;. An example configuration using SOCKS5 proxy as above looks like this:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/proxy-ns/config.json|2=&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;tun_name&amp;quot;: &amp;quot;tun0&amp;quot;,&lt;br /&gt;
  &amp;quot;tun_ip&amp;quot;: &amp;quot;10.0.0.1/24&amp;quot;,&lt;br /&gt;
  &amp;quot;socks5_address&amp;quot;: &amp;quot;127.0.0.1:8080&amp;quot;,&lt;br /&gt;
  &amp;quot;fake_dns&amp;quot;: true,&lt;br /&gt;
  &amp;quot;fake_network&amp;quot;: &amp;quot;240.0.0.0/4&amp;quot;,&lt;br /&gt;
  &amp;quot;dns_server&amp;quot;: &amp;quot;9.9.9.9&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Then, &#039;&#039;proxy-ns&#039;&#039; can be launched with:&lt;br /&gt;
&lt;br /&gt;
 $ proxy-ns &#039;&#039;program&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The usage is the same as &#039;&#039;proxychains&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If using &#039;&#039;tsocks&#039;&#039;, the configuration takes place in {{ic|/etc/tsocks.conf}}. See {{man|5|tsocks.conf}} for the options. An example minimum configuration looks like this:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/tsocks.conf|2=&lt;br /&gt;
server = 127.0.0.1&lt;br /&gt;
server_port = 8080&lt;br /&gt;
server_type = 5&lt;br /&gt;
default_user = &amp;quot;&amp;quot;&lt;br /&gt;
default_pass = &amp;quot;&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
=== curl and pacman ===&lt;br /&gt;
&lt;br /&gt;
You may set the {{ic|all_proxy}} environment variable to let curl and pacman (which uses curl) use your socks5 proxy:&lt;br /&gt;
&lt;br /&gt;
 $ export all_proxy=&amp;quot;socks5://your.proxy:1080&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Proxy settings on GNOME ==&lt;br /&gt;
&lt;br /&gt;
Some programs like [[Chromium]] and [[Firefox]] can use the settings stored by GNOME. These settings can be modified through the gnome-control-center front end and also through &#039;&#039;gsettings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
 gsettings set org.gnome.system.proxy mode &#039;manual&#039; &lt;br /&gt;
 gsettings set org.gnome.system.proxy.http host &#039;proxy.localdomain.com&#039;&lt;br /&gt;
 gsettings set org.gnome.system.proxy.http port 8080&lt;br /&gt;
 gsettings set org.gnome.system.proxy.ftp host &#039;proxy.localdomain.com&#039;&lt;br /&gt;
 gsettings set org.gnome.system.proxy.ftp port 8080&lt;br /&gt;
 gsettings set org.gnome.system.proxy.https host &#039;proxy.localdomain.com&#039;&lt;br /&gt;
 gsettings set org.gnome.system.proxy.https port 8080&lt;br /&gt;
 gsettings set org.gnome.system.proxy.socks host &#039;proxy.localdomain.com&#039;&lt;br /&gt;
 gsettings set org.gnome.system.proxy.socks port 8080&lt;br /&gt;
 gsettings set org.gnome.system.proxy ignore-hosts &amp;quot;[&#039;localhost&#039;, &#039;127.0.0.0/8&#039;, &#039;10.0.0.0/8&#039;, &#039;192.168.0.0/16&#039;, &#039;172.16.0.0/12&#039; , &#039;*.localdomain.com&#039; ]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
As GNOME is often used with NetworkManager, see also [[NetworkManager#Proxy settings]]. It does not appear that NetworkManager supports fetching the configuration from the GNOME settings above without a GNOME desktop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Determined by grepping the NetworkManager source code for &amp;quot;org.gnome&amp;quot;, there are no results. However, maybe there is some other GNOME integration? The GNOME wiki vaguely suggests that it might use it? https://wiki.gnome.org/Projects/NetworkManager/Proxies --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Microsoft NTLM proxy ==&lt;br /&gt;
&lt;br /&gt;
In a Windows network, NT LAN Manager (NTLM) is a suite of Microsoft security protocols which provides authentication, integrity, and confidentiality to users.&lt;br /&gt;
&lt;br /&gt;
A local proxy stands between your applications and the NTLM proxy, adding NTLM authentication on-the-fly.&lt;br /&gt;
 &lt;br /&gt;
 (NTLM PROXY IP:PORT + CREDENTIALS + OTHER INFO) -----&amp;gt; &#039;&#039;&#039;(127.0.0.1:PORT)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Two options are available from [[AUR]]:&lt;br /&gt;
* {{AUR|alpaca-proxy}}&lt;br /&gt;
* {{AUR|cntlm}}&lt;br /&gt;
&lt;br /&gt;
=== Alpaca ===&lt;br /&gt;
&lt;br /&gt;
{{AUR|alpaca-proxy}} from [[AUR]] is a local HTTP proxy for command-line tools. It supports proxy auto-configuration (PAC) files and NTLM authentication.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Alpaca can be launched interactively, which requires entering a password:&lt;br /&gt;
&lt;br /&gt;
 $ alpaca -d MYDOMAIN -u me&lt;br /&gt;
 Password (for MYDOMAIN\me):&lt;br /&gt;
&lt;br /&gt;
To launch alpaca non-interactively, a NTLM hash needs to be generated and exported as a variable:&lt;br /&gt;
&lt;br /&gt;
 $ ./alpaca -d MYDOMAIN -u me -H&lt;br /&gt;
 Password (for MYDOMAIN\me):&lt;br /&gt;
 NTLM_CREDENTIALS=&amp;quot;me@DOMAIN:00000000000000000000000000000000&amp;quot;; export NTLM_CREDENTIALS&lt;br /&gt;
&lt;br /&gt;
Alpaca will by default listen on {{ic|localhost:&#039;&#039;3128&#039;&#039;}}, this can be overridden using the {{ic|-l}} and {{ic|-p}} options.&lt;br /&gt;
&lt;br /&gt;
Furthermore a proxy PAC url should be provided as a parameter of the {{ic|-C}} option.&lt;br /&gt;
&lt;br /&gt;
==== Running as a service ====&lt;br /&gt;
&lt;br /&gt;
{{AUR|alpaca-proxy}} includes the {{ic|alpaca.service}} [[systemd/User|systemd user service]], which can be used to start alpaca automatically in a non-interactive way.&lt;br /&gt;
&lt;br /&gt;
It requires the following environment variables to be set in {{ic|~/.config/alpaca.environment}}:&lt;br /&gt;
&lt;br /&gt;
 LISTEN_ADDRESS=localhost&lt;br /&gt;
 LISTEN_PORT=3128&lt;br /&gt;
 NTLM_CREDENTIALS=&amp;quot;me@DOMAIN:00000000000000000000000000000000&amp;quot;&lt;br /&gt;
 PAC_URL=&amp;quot;&amp;lt;nowiki&amp;gt;http://some.url/to/some-file.pac&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Cntlm ===&lt;br /&gt;
&lt;br /&gt;
{{AUR|cntlm}} from the [[AUR]] can be configured with several &amp;quot;parent&amp;quot; proxies and Cntlm will try one after another until one works. All authenticated connections are cached and reused to achieve high efficiency.&lt;br /&gt;
&lt;br /&gt;
==== Configuration ====&lt;br /&gt;
&lt;br /&gt;
Change settings in {{ic|/etc/cntlm.conf}} as needed, except for the password. Then run:&lt;br /&gt;
&lt;br /&gt;
 $ cntlm -H&lt;br /&gt;
&lt;br /&gt;
This will generate encrypted password hashes according to your proxy hostname, username and password.&lt;br /&gt;
&lt;br /&gt;
{{Warning|{{Pkg|ettercap}} can easily sniff your password over LAN when using plain-text passwords instead of encrypted hashes.}}&lt;br /&gt;
&lt;br /&gt;
Edit {{ic|/etc/cntlm.conf}} again and include all three generated hashes, then [[enable]] {{ic|cntlm.service}}.&lt;br /&gt;
&lt;br /&gt;
To test settings, run:&lt;br /&gt;
&lt;br /&gt;
 $ cntlm -v&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Use {{ic|127.0.0.1:&#039;&#039;port&#039;&#039;}} or {{ic|localhost:&#039;&#039;port&#039;&#039;}} as a proxy adress. {{ic|&#039;&#039;port&#039;&#039;}} matches the {{ic|Listen}} parameter in {{ic|/etc/cntlm.conf}}, which by default is {{ic|3128}}.&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Proxy_server&amp;diff=873825</id>
		<title>Proxy server</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Proxy_server&amp;diff=873825"/>
		<updated>2026-05-13T13:14:43Z</updated>

		<summary type="html">&lt;p&gt;Indigo: move /* HTTPS MITM proxies */ as subsection into /* Web proxy options */  (unchanged); the tools extend the regular http proxies for special test purposes, MITM is too specific as first section for this general article&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Proxy servers]]&lt;br /&gt;
[[Category:Network configuration]]&lt;br /&gt;
[[ja:プロキシ設定]]&lt;br /&gt;
[[zh-hans:Proxy server]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|HTTP tunneling}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
&lt;br /&gt;
According to [[Wikipedia:Proxy server|Wikipedia]]:&lt;br /&gt;
:In computer networks, a proxy server is a server (a computer system or an application) that acts as an intermediary for requests from clients seeking resources from other servers.&lt;br /&gt;
&lt;br /&gt;
Proxying can be applied in common Internet protocols such as HTTP or [[Wikipedia:SOCKS|SOCKS]].&lt;br /&gt;
&lt;br /&gt;
== Environment variables ==&lt;br /&gt;
&lt;br /&gt;
{{Expansion|To export the environment everywhere (more or less), they could be set in {{ic|/etc/environment}}, {{ic|/etc/environment.d/*.conf}} and {{ic|~/.config/environment.d/*.conf}}.}}&lt;br /&gt;
&lt;br /&gt;
Some programs, such as [[wget]] and (used by [[pacman]]) [[CURL]], use environment variables of the form {{ic|&#039;&#039;protocol&#039;&#039;_proxy}} to determine the proxy for a given protocol (e.g. HTTP, FTP, ...).&lt;br /&gt;
&lt;br /&gt;
Below is an example on how to set these variables in a shell:&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
export http_proxy=http://10.203.0.1:5187/&lt;br /&gt;
export https_proxy=$http_proxy&lt;br /&gt;
export ftp_proxy=$http_proxy&lt;br /&gt;
export rsync_proxy=$http_proxy&lt;br /&gt;
export no_proxy=&amp;quot;localhost,127.0.0.1,localaddress,.localdomain.com&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Some programs look for the all caps version of the environment variables.&lt;br /&gt;
&lt;br /&gt;
If the proxy environment variables are to be made available to all users and all applications, the above mentioned export commands may be added to a script, say {{ic|proxy.sh}} inside {{ic|/etc/profile.d/}}. The script has to be then made [[executable]]. This method is helpful while using a desktop environment like [[Xfce]] which does not provide an option for proxy configuration. For example, [[Chromium]] browser will make use of the variables set using this method while running XFCE. &lt;br /&gt;
&lt;br /&gt;
Alternatively, there is a tool named {{AUR|proxyman-git}} which claims to configure system-wide proxy settings easily. It also handles proxy configurations of other software like [[git]], [[npm]], [[Dropbox]], etc.&lt;br /&gt;
 &lt;br /&gt;
Alternatively you can automate the toggling of the variables by adding a function to your {{ic|.bashrc}}:&lt;br /&gt;
&lt;br /&gt;
{{bc|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
function proxy_on() {&lt;br /&gt;
    export no_proxy=&amp;quot;localhost,127.0.0.1,localaddress,.localdomain.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    if (( $# &amp;gt; 0 )); then&lt;br /&gt;
        valid=$(echo $@ | sed -n &#039;s/\([0-9]\{1,3\}.\?\)\{4\}:\([0-9]\+\)/&amp;amp;/p&#039;)&lt;br /&gt;
        if [[ $valid != $@ ]]; then&lt;br /&gt;
            &amp;gt;&amp;amp;2 echo &amp;quot;Invalid address&amp;quot;&lt;br /&gt;
            return 1&lt;br /&gt;
        fi&lt;br /&gt;
        local proxy=$1&lt;br /&gt;
        export http_proxy=&amp;quot;$proxy&amp;quot; \&lt;br /&gt;
               https_proxy=$proxy \&lt;br /&gt;
               ftp_proxy=$proxy \&lt;br /&gt;
               rsync_proxy=$proxy&lt;br /&gt;
        echo &amp;quot;Proxy environment variable set.&amp;quot;&lt;br /&gt;
        return 0&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    echo -n &amp;quot;username: &amp;quot;; read username&lt;br /&gt;
    if [[ $username != &amp;quot;&amp;quot; ]]; then&lt;br /&gt;
        echo -n &amp;quot;password: &amp;quot;&lt;br /&gt;
        read -es password&lt;br /&gt;
        local pre=&amp;quot;$username:$password@&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    echo -n &amp;quot;server: &amp;quot;; read server&lt;br /&gt;
    echo -n &amp;quot;port: &amp;quot;; read port&lt;br /&gt;
    local proxy=$pre$server:$port&lt;br /&gt;
    export http_proxy=&amp;quot;$proxy&amp;quot; \&lt;br /&gt;
           https_proxy=$proxy \&lt;br /&gt;
           ftp_proxy=$proxy \&lt;br /&gt;
           rsync_proxy=$proxy \&lt;br /&gt;
           HTTP_PROXY=$proxy \&lt;br /&gt;
           HTTPS_PROXY=$proxy \&lt;br /&gt;
           FTP_PROXY=$proxy \&lt;br /&gt;
           RSYNC_PROXY=$proxy&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function proxy_off(){&lt;br /&gt;
    unset http_proxy https_proxy ftp_proxy rsync_proxy \&lt;br /&gt;
          HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY&lt;br /&gt;
    echo -e &amp;quot;Proxy environment variable removed.&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Omit username or password if they are not needed.&lt;br /&gt;
&lt;br /&gt;
As an alternative, you may want to use the following script.&lt;br /&gt;
Change the strings {{ic|YourUserName}}, {{ic|ProxyServerAddress:Port}}, {{ic|LocalAddress}} and {{ic|LocalDomain}} to match your own data, then edit your {{ic|~/.bashrc}} to include the edited functions. Any new bash window will have the new functions. In existing bash windows, type {{ic|source ~/.bashrc}}.&lt;br /&gt;
You may prefer to put function definitions in a separate file like {{ic|functions}} then add {{ic|source functions}} to {{ic|.bashrc}} instead of putting everything in {{ic|.bashrc}}. You may also want to change the name &amp;quot;myProxy&amp;quot; into something short and easy to write.&lt;br /&gt;
&lt;br /&gt;
{{bc|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
assignProxy(){&lt;br /&gt;
   PROXY_ENV=&amp;quot;http_proxy ftp_proxy https_proxy all_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY ALL_PROXY&amp;quot;&lt;br /&gt;
   for envar in $PROXY_ENV&lt;br /&gt;
   do&lt;br /&gt;
      export $envar=$1&lt;br /&gt;
   done&lt;br /&gt;
   for envar in &amp;quot;no_proxy NO_PROXY&amp;quot;&lt;br /&gt;
   do&lt;br /&gt;
      export $envar=$2&lt;br /&gt;
   done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
clrProxy(){&lt;br /&gt;
    PROXY_ENV=&amp;quot;http_proxy ftp_proxy https_proxy all_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY ALL_PROXY&amp;quot;&lt;br /&gt;
    for envar in $PROXY_ENV&lt;br /&gt;
    do&lt;br /&gt;
       unset $envar&lt;br /&gt;
    done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
myProxy(){&lt;br /&gt;
   user=YourUserName&lt;br /&gt;
   read -p &amp;quot;Password: &amp;quot; -s pass &amp;amp;&amp;amp;  echo -e &amp;quot; &amp;quot;&lt;br /&gt;
   proxy_value=&amp;quot;http://$user:$pass@ProxyServerAddress:Port&amp;quot;&lt;br /&gt;
   no_proxy_value=&amp;quot;localhost,127.0.0.1,LocalAddress,LocalDomain.com&amp;quot;&lt;br /&gt;
   assignProxy $proxy_value $no_proxy_value&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Keep proxy through sudo ===&lt;br /&gt;
&lt;br /&gt;
If the proxy [[environment variables]] are set for the user only they will get lost when running commands with [[sudo]] (or when programs use sudo internally).&lt;br /&gt;
&lt;br /&gt;
A way to prevent that is to add the following line to a [[sudo]] configuration file:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/sudoers.d/05_proxy|2=&lt;br /&gt;
Defaults env_keep += &amp;quot;*_proxy *_PROXY&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Automation with network managers ===&lt;br /&gt;
&lt;br /&gt;
* [[NetworkManager]] cannot change the environment variables.&lt;br /&gt;
* [[netctl]] could set-up these environment variables but they would not be seen by other applications as they are not child of netctl.&lt;br /&gt;
&lt;br /&gt;
== About libproxy ==&lt;br /&gt;
&lt;br /&gt;
{{Pkg|libproxy}} is an abstraction library which should be used by all applications that want to access a network resource. It still is in development but could lead to a unified and automated handling of proxies in GNU/Linux if widely adopted.&lt;br /&gt;
&lt;br /&gt;
The role of libproxy is to read the proxy settings from different sources and make them available to applications which use the library. The interesting part with libproxy is that it offers an implementation of the [[Wikipedia:Web_Proxy_Autodiscovery_Protocol|Web Proxy Autodiscovery Protocol]] and an implementation of [[Wikipedia:Proxy_auto-config|Proxy Auto-Config]] that goes with it.&lt;br /&gt;
&lt;br /&gt;
The {{ic|/usr/bin/proxy}} binary takes URL(s) as argument(s) and returns the proxy/proxies that could be used to fetch this/these network resource(s).&lt;br /&gt;
&lt;br /&gt;
{{Note|1=the version 0.4.11 does not support {{ic|1=http_proxy=&#039;wpad:&#039;}} because {{ic|1={ pkg-config &#039;mozjs185 &amp;gt;= 1.8.5&#039;; } }} fails .}}&lt;br /&gt;
&lt;br /&gt;
== Web proxy options ==&lt;br /&gt;
&lt;br /&gt;
* [[Squid]] is a very popular caching/optimizing proxy.&lt;br /&gt;
* [[Privoxy]] is an anonymizing and ad-blocking proxy.&lt;br /&gt;
* {{Pkg|tinyproxy}} is a small, efficient HTTP/SSL proxy daemon.&lt;br /&gt;
* For a simple proxy, [[ssh]] with port forwarding can be used.&lt;br /&gt;
&lt;br /&gt;
=== Simple Proxy with SSH ===&lt;br /&gt;
&lt;br /&gt;
Connect to a server (HOST) on which you have an account (USER) as follows&lt;br /&gt;
&lt;br /&gt;
 $ ssh -D &#039;&#039;PORT&#039;&#039; &#039;&#039;USER&#039;&#039;@&#039;&#039;HOST&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For PORT, choose some number which is not an IANA registered port. This specifies that traffic on the local &#039;&#039;PORT&#039;&#039; will be forwarded to the remote &#039;&#039;HOST&#039;&#039;. ssh will act as a [[Wikipedia:SOCKS|SOCKS]] server. Software supporting SOCKS proxy servers can simply be configured to connect to &#039;&#039;PORT&#039;&#039; on localhost. See  [[OpenSSH#Forwarding other ports]].&lt;br /&gt;
&lt;br /&gt;
== HTTPS MITM proxies ==&lt;br /&gt;
&lt;br /&gt;
When debugging HTTPS connections it is sometimes useful to intercept them outside of the browser. In order for the TLS MITM to work you need to trust a [[certificate authority]] of the proxy either in your browser or system-wide.&lt;br /&gt;
&lt;br /&gt;
* {{App|Charles|Graphical trialware written in Java.|https://www.charlesproxy.com/|{{AUR|charles}}}}&lt;br /&gt;
* {{App|Fiddler|Proprietary and graphical, running on Mono.|https://www.telerik.com/fiddler|{{AUR|fiddler-appimage}}}}&lt;br /&gt;
* {{App|microsocks|Plain simple SOCKS5 proxy server, written in C.|https://github.com/rofl0r/microsocks|{{Pkg|microsocks}}}}&lt;br /&gt;
* {{App|mitmproxy|Command-line and web interface, written in Python, also has API.|https://mitmproxy.org/|{{Pkg|mitmproxy}}}}&lt;br /&gt;
* {{App|sslsplit|Works with any TLS connections but cannot act as a HTTP proxy in a browser, written in C.|https://www.roe.ch/SSLsplit|{{Pkg|sslsplit}}}}&lt;br /&gt;
&lt;br /&gt;
== Using a SOCKS proxy ==&lt;br /&gt;
&lt;br /&gt;
There are two cases:&lt;br /&gt;
&lt;br /&gt;
* the application you want to use handles [[Wikipedia:SOCKS#SOCKS5|SOCKS5]] proxies (for example [[Firefox]]), then you just have to configure it to use the proxy.&lt;br /&gt;
* the application you want to use does not handle SOCKS proxies, then you can try to use {{Pkg|proxychains-ng}}, {{AUR|proxy-ns}}, or [[tor#Torsocks|torsocks]].&lt;br /&gt;
&lt;br /&gt;
In Firefox, you can use the SOCKS proxy in the menu &#039;&#039;Preferences &amp;gt; Network &amp;gt; Settings&#039;&#039;. Choose &#039;&#039;Manual Proxy Configuration&#039;&#039;, and set the SOCKS Host (and only this one, make sure the other fields, such as HTTP Proxy or SSL Proxy are left empty). For example, if a SOCKS5 proxy is running on localhost port 8080, put {{ic|127.0.0.1}} in the SOCKS Host field, {{ic|8080}} in the Port field, and validate.&lt;br /&gt;
&lt;br /&gt;
If using &#039;&#039;proxychains-ng&#039;&#039;, the configuration takes place in {{ic|/etc/proxychains.conf}}. You may have to uncomment the last line (set by default to use [[Tor]]), and replace it with the parameters of the SOCKS proxy. For example, if you are using the same SOCKS5 proxy as above, you will have to replace the last line by:&lt;br /&gt;
&lt;br /&gt;
 socks5 127.0.0.1 8080&lt;br /&gt;
&lt;br /&gt;
Then, &#039;&#039;proxychains-ng&#039;&#039; can be launched with &lt;br /&gt;
&lt;br /&gt;
 $ proxychains &#039;&#039;program&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Where {{ic|&#039;&#039;program&#039;&#039;}} can be any program already installed on your system (e.g. xterm, gnome-terminal, etc).&lt;br /&gt;
&lt;br /&gt;
If using &#039;&#039;proxy-ns&#039;&#039;, the configuration takes place in {{ic|/etc/proxy-ns/config.json}}. You may have to change the &#039;&#039;socks5_address&#039;&#039;. An example configuration using SOCKS5 proxy as above looks like this:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/proxy-ns/config.json|2=&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;tun_name&amp;quot;: &amp;quot;tun0&amp;quot;,&lt;br /&gt;
  &amp;quot;tun_ip&amp;quot;: &amp;quot;10.0.0.1/24&amp;quot;,&lt;br /&gt;
  &amp;quot;socks5_address&amp;quot;: &amp;quot;127.0.0.1:8080&amp;quot;,&lt;br /&gt;
  &amp;quot;fake_dns&amp;quot;: true,&lt;br /&gt;
  &amp;quot;fake_network&amp;quot;: &amp;quot;240.0.0.0/4&amp;quot;,&lt;br /&gt;
  &amp;quot;dns_server&amp;quot;: &amp;quot;9.9.9.9&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Then, &#039;&#039;proxy-ns&#039;&#039; can be launched with:&lt;br /&gt;
&lt;br /&gt;
 $ proxy-ns &#039;&#039;program&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The usage is the same as &#039;&#039;proxychains&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If using &#039;&#039;tsocks&#039;&#039;, the configuration takes place in {{ic|/etc/tsocks.conf}}. See {{man|5|tsocks.conf}} for the options. An example minimum configuration looks like this:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/tsocks.conf|2=&lt;br /&gt;
server = 127.0.0.1&lt;br /&gt;
server_port = 8080&lt;br /&gt;
server_type = 5&lt;br /&gt;
default_user = &amp;quot;&amp;quot;&lt;br /&gt;
default_pass = &amp;quot;&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
=== curl and pacman ===&lt;br /&gt;
&lt;br /&gt;
You may set the {{ic|all_proxy}} environment variable to let curl and pacman (which uses curl) use your socks5 proxy:&lt;br /&gt;
&lt;br /&gt;
 $ export all_proxy=&amp;quot;socks5://your.proxy:1080&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Proxy settings on GNOME ==&lt;br /&gt;
&lt;br /&gt;
Some programs like [[Chromium]] and [[Firefox]] can use the settings stored by GNOME. These settings can be modified through the gnome-control-center front end and also through &#039;&#039;gsettings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
 gsettings set org.gnome.system.proxy mode &#039;manual&#039; &lt;br /&gt;
 gsettings set org.gnome.system.proxy.http host &#039;proxy.localdomain.com&#039;&lt;br /&gt;
 gsettings set org.gnome.system.proxy.http port 8080&lt;br /&gt;
 gsettings set org.gnome.system.proxy.ftp host &#039;proxy.localdomain.com&#039;&lt;br /&gt;
 gsettings set org.gnome.system.proxy.ftp port 8080&lt;br /&gt;
 gsettings set org.gnome.system.proxy.https host &#039;proxy.localdomain.com&#039;&lt;br /&gt;
 gsettings set org.gnome.system.proxy.https port 8080&lt;br /&gt;
 gsettings set org.gnome.system.proxy.socks host &#039;proxy.localdomain.com&#039;&lt;br /&gt;
 gsettings set org.gnome.system.proxy.socks port 8080&lt;br /&gt;
 gsettings set org.gnome.system.proxy ignore-hosts &amp;quot;[&#039;localhost&#039;, &#039;127.0.0.0/8&#039;, &#039;10.0.0.0/8&#039;, &#039;192.168.0.0/16&#039;, &#039;172.16.0.0/12&#039; , &#039;*.localdomain.com&#039; ]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
As GNOME is often used with NetworkManager, see also [[NetworkManager#Proxy settings]]. It does not appear that NetworkManager supports fetching the configuration from the GNOME settings above without a GNOME desktop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Determined by grepping the NetworkManager source code for &amp;quot;org.gnome&amp;quot;, there are no results. However, maybe there is some other GNOME integration? The GNOME wiki vaguely suggests that it might use it? https://wiki.gnome.org/Projects/NetworkManager/Proxies --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Microsoft NTLM proxy ==&lt;br /&gt;
&lt;br /&gt;
In a Windows network, NT LAN Manager (NTLM) is a suite of Microsoft security protocols which provides authentication, integrity, and confidentiality to users.&lt;br /&gt;
&lt;br /&gt;
A local proxy stands between your applications and the NTLM proxy, adding NTLM authentication on-the-fly.&lt;br /&gt;
 &lt;br /&gt;
 (NTLM PROXY IP:PORT + CREDENTIALS + OTHER INFO) -----&amp;gt; &#039;&#039;&#039;(127.0.0.1:PORT)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Two options are available from [[AUR]]:&lt;br /&gt;
* {{AUR|alpaca-proxy}}&lt;br /&gt;
* {{AUR|cntlm}}&lt;br /&gt;
&lt;br /&gt;
=== Alpaca ===&lt;br /&gt;
&lt;br /&gt;
{{AUR|alpaca-proxy}} from [[AUR]] is a local HTTP proxy for command-line tools. It supports proxy auto-configuration (PAC) files and NTLM authentication.&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Alpaca can be launched interactively, which requires entering a password:&lt;br /&gt;
&lt;br /&gt;
 $ alpaca -d MYDOMAIN -u me&lt;br /&gt;
 Password (for MYDOMAIN\me):&lt;br /&gt;
&lt;br /&gt;
To launch alpaca non-interactively, a NTLM hash needs to be generated and exported as a variable:&lt;br /&gt;
&lt;br /&gt;
 $ ./alpaca -d MYDOMAIN -u me -H&lt;br /&gt;
 Password (for MYDOMAIN\me):&lt;br /&gt;
 NTLM_CREDENTIALS=&amp;quot;me@DOMAIN:00000000000000000000000000000000&amp;quot;; export NTLM_CREDENTIALS&lt;br /&gt;
&lt;br /&gt;
Alpaca will by default listen on {{ic|localhost:&#039;&#039;3128&#039;&#039;}}, this can be overridden using the {{ic|-l}} and {{ic|-p}} options.&lt;br /&gt;
&lt;br /&gt;
Furthermore a proxy PAC url should be provided as a parameter of the {{ic|-C}} option.&lt;br /&gt;
&lt;br /&gt;
==== Running as a service ====&lt;br /&gt;
&lt;br /&gt;
{{AUR|alpaca-proxy}} includes the {{ic|alpaca.service}} [[systemd/User|systemd user service]], which can be used to start alpaca automatically in a non-interactive way.&lt;br /&gt;
&lt;br /&gt;
It requires the following environment variables to be set in {{ic|~/.config/alpaca.environment}}:&lt;br /&gt;
&lt;br /&gt;
 LISTEN_ADDRESS=localhost&lt;br /&gt;
 LISTEN_PORT=3128&lt;br /&gt;
 NTLM_CREDENTIALS=&amp;quot;me@DOMAIN:00000000000000000000000000000000&amp;quot;&lt;br /&gt;
 PAC_URL=&amp;quot;&amp;lt;nowiki&amp;gt;http://some.url/to/some-file.pac&amp;lt;/nowiki&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Cntlm ===&lt;br /&gt;
&lt;br /&gt;
{{AUR|cntlm}} from the [[AUR]] can be configured with several &amp;quot;parent&amp;quot; proxies and Cntlm will try one after another until one works. All authenticated connections are cached and reused to achieve high efficiency.&lt;br /&gt;
&lt;br /&gt;
==== Configuration ====&lt;br /&gt;
&lt;br /&gt;
Change settings in {{ic|/etc/cntlm.conf}} as needed, except for the password. Then run:&lt;br /&gt;
&lt;br /&gt;
 $ cntlm -H&lt;br /&gt;
&lt;br /&gt;
This will generate encrypted password hashes according to your proxy hostname, username and password.&lt;br /&gt;
&lt;br /&gt;
{{Warning|{{Pkg|ettercap}} can easily sniff your password over LAN when using plain-text passwords instead of encrypted hashes.}}&lt;br /&gt;
&lt;br /&gt;
Edit {{ic|/etc/cntlm.conf}} again and include all three generated hashes, then [[enable]] {{ic|cntlm.service}}.&lt;br /&gt;
&lt;br /&gt;
To test settings, run:&lt;br /&gt;
&lt;br /&gt;
 $ cntlm -v&lt;br /&gt;
&lt;br /&gt;
==== Usage ====&lt;br /&gt;
&lt;br /&gt;
Use {{ic|127.0.0.1:&#039;&#039;port&#039;&#039;}} or {{ic|localhost:&#039;&#039;port&#039;&#039;}} as a proxy adress. {{ic|&#039;&#039;port&#039;&#039;}} matches the {{ic|Listen}} parameter in {{ic|/etc/cntlm.conf}}, which by default is {{ic|3128}}.&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Talk:Data-at-rest_encryption&amp;diff=873818</id>
		<title>Talk:Data-at-rest encryption</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Talk:Data-at-rest_encryption&amp;diff=873818"/>
		<updated>2026-05-13T12:49:06Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* add File encryption tools / secure archiving ? */ re&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Add filesystem encryption ==&lt;br /&gt;
It is possible to use encryption offered by filesystems, instead of using something like [[dm-crypt]] and [[eCryptfs]].&lt;br /&gt;
In most cases they are even better because they offer more flexibility, performance and without the need of something like [[FUSE]] (but that&#039;s not part of this scope).&lt;br /&gt;
&lt;br /&gt;
Should we extend the table listing encryption solutions or simple link to the filesystem page instead?&lt;br /&gt;
&lt;br /&gt;
[[User:Francoism|Francoism]] ([[User talk:Francoism|talk]]) 11:53, 19 November 2018 (UTC)&lt;br /&gt;
&lt;br /&gt;
:Agree. The comparison table mentioned [[fscrypt]]; as far as I know, [[bcachefs]] also natively support encryption. I’m not sure about the advantages, though; there are [https://www.reddit.com/r/zfs/comments/wdrfxp/testing_and_comparing_io_performance_with_and/ some tests] claiming that LUKS is actually faster overall (a little slower write, much faster read). [[User:Franklin Yu|Franklin Yu]] ([[User talk:Franklin Yu|talk]]) 07:59, 4 May 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
::While bcachefs is an exciting candidate, I&#039;d still give it time before it&#039;s added. It&#039;s doc points to open todos and testing/fixing enc is still very active (and mainly focussed on chacha, not AES-GCM), to name two reasons. As of today my choice would be ext4 ([[#Add EXT4 transparent folder encryption]]) to add. A re-grouping of methods (block devices, then filesystems before FUSE) may be useful. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 18:48, 11 December 2024 (UTC)&lt;br /&gt;
::I&#039;ve re-grouped the table with [https://wiki.archlinux.org/index.php?title=Data-at-rest_encryption&amp;amp;diff=824310&amp;amp;oldid=822756]. My next move would be to follow-up [[#Remove deprecated encryptions]] sometime. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 19:48, 1 January 2025 (UTC)&lt;br /&gt;
&lt;br /&gt;
==Unicode graphs/patterns==&lt;br /&gt;
&#039;&#039;[Original title was Ascii graphs/patterns]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Hi,&lt;br /&gt;
A small issue unrelated topic : how are ascii graphs/patterns made?&lt;br /&gt;
:One method I know is: http://www.asciiflow.com/#Draw&lt;br /&gt;
:--[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 20:45, 3 September 2013 (UTC)&lt;br /&gt;
::Note that those graphs are not made with simple ASCII characters, but Unicode (I&#039;ve fixed the title of the discussion).&lt;br /&gt;
::Anyway, this is a very interesting question indeed, I too would like to know if there are any editors that can make it easy to draw such diagrams.&lt;br /&gt;
::This would also solve [[Talk:Installing Arch Linux with EVMS#Image replacement contest]].&lt;br /&gt;
::Finally, an editor like that should be mentioned in [[Help:Style#Non-pertinent content]].&lt;br /&gt;
::-- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 05:47, 4 September 2013 (UTC)&lt;br /&gt;
:I created these diagrams manually using [[Wikipedia:Kate_%28text_editor%29|Kate]], which is a normal text editor &#039;&#039;(but it has an advanced feature called &amp;quot;Block Selection Mode&amp;quot; that helps a lot with this kind of stuff)&#039;&#039;. I also kept a window of [[Wikipedia:gucharmap|gucharmap]] open on one side of the screen, which allowed me to easily find and pick suitable Unicode characters.&lt;br /&gt;
:--[[User:Sas|Sas]] ([[User talk:Sas|talk]]) 19:21, 19 November 2013 (UTC)&lt;br /&gt;
&lt;br /&gt;
==Move out of User page==&lt;br /&gt;
This page is quite good IMO. So it can be moved to a normal page. It can receive updates there and other pepole can contribute.  -- [[User:Fengchao|Fengchao]] ([[User talk:Fengchao|talk]]) 06:20, 11 June 2012 (UTC)&lt;br /&gt;
:+1 -- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 09:18, 12 June 2012 (UTC)&lt;br /&gt;
: No respons from author. This will block [System_Encryption_with_LUKS] restructure so I do the job to move on.-- [[User:Fengchao|Fengchao]] ([[User talk:Fengchao|talk]]) 02:22, 15 June 2012 (UTC)&lt;br /&gt;
:: Hi, and sorry for abandoning this article half-way through and then forgetting about it.&lt;br /&gt;
:: As for writing the general introduction/explanation text (part of which consists of merging the corresponding sections from the [[System_Encryption_with_LUKS]] article into this one), I had already started working on that locally back when I created this article, but I have that file on a different computer than I am on now. If you give me until tomorrow (Monday) evening (European time), I&#039;ll bring what I have into a readable state and upload it to this page, and then everybody can help modifying/extending it.&lt;br /&gt;
:: The reason why I created the article as a user page and didn&#039;t move it into the main namespace right away, is that I originally planned to first discuss some feature requests with the wiki maintainers which would make the page more maintainable (without sacrificing user-friendliness). Namely, support for automatically numbered footnotes, and moving the comparison table formatting into a wiki-wide &amp;quot;comparison-table&amp;quot; CSS class (or maybe, separate &amp;quot;comparison-table-vertical&amp;quot; and &amp;quot;comparison-table-horizontal&amp;quot; classes). Right now, the comparison table&#039;s wiki markup is so messy and difficult to work with that I would feel guilty asking other people to help add info to it. --[[User:Sas|Sas]] ([[User talk:Sas|talk]]) 17:35, 17 June 2012 (UTC)&lt;br /&gt;
::: I added the main text sections now. It would be great if a native speaker with good language skills could do some copyediting for the individual subsections to formulate them more concisely and make them nicer to read. --[[User:Sas|Sas]] ([[User talk:Sas|talk]]) 20:42, 18 June 2012 (UTC)&lt;br /&gt;
::::Hi Sas, thank you for getting back working on this article!!&lt;br /&gt;
::::About the numbered footnotes, that would require the installation of an extension (involving web developers) and if we can keep it simpler instead it&#039;d be better, since this would be the only article using that feature.&lt;br /&gt;
::::About the comparison-table class, can you report an existing example (in another wiki I guess) of what you mean exactly?&lt;br /&gt;
::::-- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 20:57, 19 June 2012 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Was Serpent judged most secure? ==&lt;br /&gt;
&lt;br /&gt;
According to the fact sheet available from the relevant link (https://web.archive.org/web/20020211162045/http://csrc.nist.gov:80/encryption/aes/round2/aesfact.html), Serpent was not the finalist selected for the relevant standard. According to that fact sheet, the judgement was not that the other finalists (including Serpent) were insecure, but claiming it was judged the most secure seems unmotivated. Have I missed something? What&#039;s the source for this? The linked papers are by the researchers who proposed Serpent, aren&#039;t they? That&#039;s not the judgement of impartial evaluators. --[[User:Margali|cfr]] ([[User talk:Margali|talk]]) 05:03, 4 November 2017 (UTC)&lt;br /&gt;
&lt;br /&gt;
== About hardware-based full disk encryption  ==&lt;br /&gt;
&lt;br /&gt;
There&#039;s a line stating&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The best remedy might be hardware-based full disk encryption and Trusted Computing.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
As it became known over the last few years, disk-based encryption is often either weak, broken or vulnerable to other attaks, like altering the firmware.&lt;br /&gt;
&lt;br /&gt;
So the Arch Wiki recommends a propritary solution, which (from the vendors point of view) must be as cheap and fast as possible.&lt;br /&gt;
 &lt;br /&gt;
Should the statement be altered or a warning added?&lt;br /&gt;
&lt;br /&gt;
[[User:Baerbeisser|Baerbeisser]] ([[User talk:Baerbeisser|talk]]) 15:23, 27 July 2019 (UTC)&lt;br /&gt;
&lt;br /&gt;
:About hardware-based FDE, there&#039;s already [[Self-Encrypting Drives#Disadvantages]], I think we can expand that if needed.&lt;br /&gt;
:About [[Wikipedia:Trusted Computing]], I think the Wikipedia article is a bit biased actually, &amp;quot;trusted computing&amp;quot; may be a term originally suggested by the [[Wikipedia:Trusted Computing Group|Trusted Computing Group]], but to me it has a more generic meaning, and the TCG technology is only an &#039;&#039;implementation&#039;&#039; of the idea (although basically the only one in practice), see e.g. [https://searchsecurity.techtarget.com/definition/trusted-computing], [https://www.eff.org/wp/trusted-computing-promise-and-risk] or even [https://lwn.net/Articles/747564/]. Since we don&#039;t link to a specific TC vendor site, and we already say &amp;quot;The best remedy &#039;&#039;&#039;might be&#039;&#039;&#039; ...&amp;quot; (not &#039;&#039;&#039;is&#039;&#039;&#039;), I think the Wikipedia article already does a decent job at following up by introducing the possible flaws of the technology, but perhaps we could link to a more neutral external page, or [[Wikipedia:trusted system]]s?&lt;br /&gt;
:-- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 07:14, 28 July 2019 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Remove deprecated encryptions ==&lt;br /&gt;
&lt;br /&gt;
Like TrueCrypt and encfs which are deprecated and halted.&lt;br /&gt;
The TrueCrypt page is archived...&lt;br /&gt;
--[[User:Tiziodcaio|Tiziodcaio]] ([[User talk:Tiziodcaio|talk]]) 23:54, 17 July 2022 (UTC)&lt;br /&gt;
&lt;br /&gt;
:Yes, others have thankfully replaced Truecrypt with [[VeraCrypt]] already, as well as added filesystem alternatives for [[Encfs]] to the tables.&lt;br /&gt;
:Perhaps, the table columns for enfcs can be removed in one edit. This would make it easier to re-add, in case it&#039;s version 2[https://github.com/vgough/encfs?tab=readme-ov-file#status] does land. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 20:44, 1 March 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
:encfs moved to unmaintained status meanwhile. So, it&#039;s a candidate to remove in my opinion. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 18:38, 11 December 2024 (UTC)&lt;br /&gt;
:Meanwhile encfs started porting to rust (incl a migration tool[https://github.com/vgough/encfs?tab{{=}}readme-ov-file#status---feb-2026]) and ecryptfs gets no [https://bugs.launchpad.net/ecryptfs/+bugs?orderby=importance&amp;amp;start=0 recent bug report] attention and [[Special:diff/860145| deprecation notice]]. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 17:14, 29 April 2026 (UTC)&lt;br /&gt;
&lt;br /&gt;
== rclone ==&lt;br /&gt;
&lt;br /&gt;
rclone may also be a good option (with rclone crypt + rclone mount).&lt;br /&gt;
[[User:Coolwanglu|Coolwanglu]] ([[User talk:Coolwanglu|talk]]) 22:12, 3 October 2022 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Move the page to &amp;quot;Encryption&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
I think the page should be more generally oriented, maybe naming it with a more general name and moving all the thing truly related with Data-at-rest encryption to a subpage near to File system encryption on other page&lt;br /&gt;
&lt;br /&gt;
--[[User:Tiziodcaio|Tiziodcaio]] ([[User talk:Tiziodcaio|talk]]) 16:49, 21 February 2023 (UTC)&lt;br /&gt;
&lt;br /&gt;
:The [[:Category:Encryption]] contains different topics and this article heads its subcat [[:Category:Data-at-rest encryption]]. It is a generally used term, see [[wikipedia:Data at rest]]. &amp;quot;File system encryption&amp;quot; is more ambigious in my view (see zfs encryption as an example). --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 21:56, 22 February 2023 (UTC)&lt;br /&gt;
&lt;br /&gt;
== add File encryption tools / secure archiving ? ==&lt;br /&gt;
&lt;br /&gt;
Regarding &#039;&#039;Undo revision&#039;&#039; https://wiki.archlinux.org/index.php?diff=872878&lt;br /&gt;
&lt;br /&gt;
Do we have another place for listing some tools, that can encrypt one or few files ? A new wiki page would be oversized. [[User:Ua4000|Ua4000]] ([[User talk:Ua4000|talk]]) 16:52, 12 May 2026 (UTC)&lt;br /&gt;
&lt;br /&gt;
:The gist of your contribution is already crosslinked in [[Security#Data-at-rest encryption]]. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 12:49, 13 May 2026 (UTC)&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Help_talk:Style/Formatting_and_punctuation&amp;diff=873709</id>
		<title>Help talk:Style/Formatting and punctuation</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Help_talk:Style/Formatting_and_punctuation&amp;diff=873709"/>
		<updated>2026-05-12T17:24:53Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /*  systemd-* daemons */ add new item&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Reference links before or after punctuation marks? ==&lt;br /&gt;
&lt;br /&gt;
I was about to revert [https://wiki.archlinux.org/index.php?title=PKGBUILD&amp;amp;diff=next&amp;amp;oldid=354351], but I have not found any rule about it in our guidelines, so I&#039;m proposing to add one.&lt;br /&gt;
&lt;br /&gt;
Basically, reference links are not part of the sentence, so they should be put &#039;&#039;after&#039;&#039; punctuation marks like period or comma. There should be no space between the punctuation mark and the reference link. This style is widely used on [[wikipedia:Wikipedia:Manual_of_Style#Punctuation_and_footnotes|Wikipedia]] and apparently also [http://graphicdesign.stackexchange.com/a/15343 Chicago Manual Of Style].&lt;br /&gt;
&lt;br /&gt;
-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 08:39, 30 December 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
:Fine with me, although I just recall using reference links in a sentence the other day, which I (obviously) found appropriate usage as well.[https://wiki.archlinux.org/index.php?title=Network_configuration&amp;amp;diff=352654&amp;amp;oldid=352629] Further, if we are going to introduce &amp;quot;reference link&amp;quot; as a term, it should be noted as a case in [[Help:Style#Hypertext_metaphor]] as well (close to the indirect links bullet). --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 19:35, 30 December 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
::Well quoting the linked manual of style:&lt;br /&gt;
:::&#039;&#039;The superior numerals used for note reference numbers in the text should follow any punctuation marks except the dash, which they precede. The numbers should also be placed outside closing parentheses.&#039;&#039;&lt;br /&gt;
::So as I understand it, it can be &amp;quot;part of the sentence&amp;quot;, just after the respective punctuation (though you wouldn&#039;t put a {{ic|1=,}} between the references.) -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 19:56, 30 December 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
:::Good point, sometimes links are part of the sentence, for example in &amp;quot;...as can be found in [42].&amp;quot; or &amp;quot;...for example [43], [44] and [45].&amp;quot; it does not make sense to place the link after the period. On Wikipedia though, where the reference links are formatted as superscript, you would not find it being part of a sentence anywhere. If we keep formatting reference links as normal-size text, I believe the editors should be free to choose if the reference link will be part of a sentence or not.&lt;br /&gt;
:::I would define a reference link as a link without an anchor text (which implies that reference link must be of the syntax {{ic|[&#039;&#039;full_url&#039;&#039;]}}) and the rule would apply only to reference links that are not part of the sentence. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 20:08, 30 December 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
::::In [https://wiki.archlinux.org/index.php?title=PKGBUILD&amp;amp;diff=next&amp;amp;oldid=354351]&#039;s case, I&#039;d prefer the link to be after the period too, and I agree with the observations that have been brought here.&lt;br /&gt;
::::Just a quickly-thought idea, we could specify that the rule &amp;quot;would apply only to reference links that are not&amp;quot; &#039;&#039;grammatically&#039;&#039; &amp;quot;part of the sentence&amp;quot;.&lt;br /&gt;
::::-- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 10:10, 31 December 2014 (UTC)&lt;br /&gt;
&lt;br /&gt;
:::::I like that idea a lot. In my view it would, however, rule out the frequently used &amp;quot;...for example [43], [44] and [45].&amp;quot; cases, because the link count substitution ([43],...) does not make any of them a grammatic part of the sentence. My personal rule of thumb is that the reader should not be required to hover over the link in order to see where it leads out to. Arguably the &amp;quot;for example&amp;quot; does hint enough in this example what the links will lead to. For the wiki here that should be enough; we&#039;re using external links in a different manner than wikipedia and the cases they are used in an academic (aka &amp;quot;Chicago&amp;quot;) style is very seldom. &lt;br /&gt;
:::::I now think we should skip this and leave it up to the editors how they want to present the references. Just make sure we don&#039;t end up with bogus sentences like &amp;quot;If [46] is [[Start|started]] with default configuration [47], the journal will show [48].&amp;quot; --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 11:10, 16 January 2015 (UTC)&lt;br /&gt;
&lt;br /&gt;
::::::Draft for [[Help:Style/Formatting and punctuation#Links]]:&lt;br /&gt;
::::::* A numbered external link that does not have a grammatical function should appear at the end of the sentence that it supports, immediately &#039;&#039;after&#039;&#039; a punctuation mark that terminates the sentence, unless such mark is a dash or a parenthesis, in which case the link shall be inserted immediately &#039;&#039;before&#039;&#039; it.&lt;br /&gt;
::::::— [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 10:23, 3 June 2017 (UTC)&lt;br /&gt;
&lt;br /&gt;
:::::::Well, after a couple of years, I&#039;ve actually got used to the option #3 below, which is about the most common style in academic papers. See also [https://tex.stackexchange.com/questions/34414/should-you-put-citations-before-or-after-interpunction this question] and the two answers, and [https://english.stackexchange.com/questions/1751/where-does-the-period-go-in-an-mla-in-text-citation this question] with the same result even for non-numeric references. I should also correct my original reference to the [http://graphicdesign.stackexchange.com/a/15343 Chicago Manual Of Style], which in that snippet talks only about superscripts, which is entirely different beast. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 11:28, 3 June 2017 (UTC)&lt;br /&gt;
&lt;br /&gt;
::::::::I think I&#039;ve almost always used option #2 here instead, but I don&#039;t really mind as long as we agree on a common style. Your proposal would also simplify the wording:&lt;br /&gt;
::::::::* A numbered external link that does not have a grammatical function should appear at the end of the sentence that it supports, separated from the last word by one space, and immediately &#039;&#039;before&#039;&#039; a punctuation mark that terminates the sentence. For example:&lt;br /&gt;
:::::::::* Lorem ipsum [https://www.archlinux.org], dolor sit (amet consectetur [https://www.archlinux.org]) adipiscing elit [https://www.archlinux.org].&lt;br /&gt;
:::::::::Multiple references, still without grammatical function, should be joined without spaces, for example:&lt;br /&gt;
:::::::::* Lorem ipsum [https://www.archlinux.org][https://www.archlinux.org], dolor sit (amet consectetur [https://www.archlinux.org][https://www.archlinux.org]) adipiscing elit [https://www.archlinux.org][https://www.archlinux.org].&lt;br /&gt;
:::::::::Note that numbered links are automatically enclosed in brackets, so there is no need to further enclose them in parentheses, for example ([https://www.archlinux.org]).&lt;br /&gt;
:::::::::Numbered links that have a grammatical function should be treated like regular words, following the same punctuation conventions, for example:&lt;br /&gt;
:::::::::* Lorem ipsum, as reported in [https://www.archlinux.org]&#039;s last paragraph, dolor sit amet consectetur adipiscing elit, see also [https://www.archlinux.org], [https://www.archlinux.org] and [https://www.archlinux.org].&lt;br /&gt;
::::::::— [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 06:21, 4 June 2017 (UTC)&lt;br /&gt;
&lt;br /&gt;
:::::::::I changed my mind and now support your previous proposal for option #2. I dislike option #3 because placing periods after bold text and a symbol makes them hard to spot. --[[User:Larivact|Larivact]] ([[User talk:Larivact|talk]]) 06:39, 7 October 2018 (UTC)&lt;br /&gt;
&lt;br /&gt;
=== Positioning of numbered external links ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;[Moved from [[Help talk:Style#Positioning of numbered external links]] — [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 10:02, 3 June 2017 (UTC)]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
# Lorem ipsum dolor sit amet, consectetur adipiscing elit. [http://example.com/]&lt;br /&gt;
# Lorem ipsum dolor sit amet, consectetur adipiscing elit.[http://example.com/]&lt;br /&gt;
# Lorem ipsum dolor sit amet, consectetur adipiscing elit [http://example.com/].&lt;br /&gt;
&lt;br /&gt;
I have seen all of these. I prefer #1. #2 looks clinched and #3 looks weird.&lt;br /&gt;
&lt;br /&gt;
–[[User:Larivact|Larivact]] ([[User talk:Larivact|talk]]) 05:18, 2 June 2017 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Orphan break line tag? ==&lt;br /&gt;
&lt;br /&gt;
Hi, all!&lt;br /&gt;
I&#039;m new to contributing in ArchWiki but I&#039;m not quite familiar with wikitext... I&#039;ll try not to make many or serious errors!&lt;br /&gt;
Is the &amp;quot;&amp;lt;nowiki&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;quot; tag inside the first item of the first list of the article orphan, or do I miss something...?&lt;br /&gt;
&lt;br /&gt;
P.S. I see now my message has a different formating from the rest of the messages in the page... Hows that...?&lt;br /&gt;
{{Unsigned|10:46, 1 December 2016 (UTC)|Fragos.george}}&lt;br /&gt;
&lt;br /&gt;
:The usage of {{ic|&amp;lt;nowiki&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;}} in [[Help:Style/Formatting and punctuation#General rules]] is explained in the last line in [[Help:Style#HTML tags]], basically it&#039;s used to add a line break without breaking the list.&lt;br /&gt;
:As for your &#039;&#039;different formatting&#039;&#039;, see [[Help:Editing#Code]]. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 11:09, 1 December 2016 (UTC)&lt;br /&gt;
&lt;br /&gt;
::Just in case by &amp;quot;orphan&amp;quot; OP meant that the tag is not closed, &amp;amp;lt;br&amp;gt; is an empty tag in HTML, and it takes no end tag. — [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 11:50, 1 December 2016 (UTC)&lt;br /&gt;
&lt;br /&gt;
:::Why not make it valid XHTML and use {{ic|&amp;lt;nowiki&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/nowiki&amp;gt;}}? -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 11:55, 1 December 2016 (UTC)&lt;br /&gt;
&lt;br /&gt;
::::Are you proposing to add a generic style rule (e.g. &amp;quot;always self-close void html tags&amp;quot;), or would you only change the tags in this article? In the former case [[Help:Style#HTML tags]] is the right place, I think I&#039;d be in favor, but then I wouldn&#039;t start a campaign to mass-edit the tags in the articles... In the latter case, without a style rule I think it would not make a real difference, since the two syntaxes are well supported by the vast majority of modern browsers anyway. — [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 10:36, 2 December 2016 (UTC)&lt;br /&gt;
&lt;br /&gt;
:::::I added the [https://wiki.archlinux.org/index.php?title=Help:Style&amp;amp;curid=11478&amp;amp;diff=458313&amp;amp;oldid=456514 new style rule] with an explicit {{ic|&amp;lt;nowiki&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/nowiki&amp;gt;}} example. While mass editing tags would not be the most productive thing to do, maybe [[ArchWiki:Bots|bots]] could update them when making other changes to articles? -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 10:08, 3 December 2016 (UTC)&lt;br /&gt;
&lt;br /&gt;
::::::Well yes, bots could do it indeed. — [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 16:03, 3 December 2016 (UTC)&lt;br /&gt;
&lt;br /&gt;
::::{{ic|&amp;lt;nowiki&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;}} is valid HTML5. We serve HTML5 at Arch Wiki, so the XHTML argument is invalid. {{ic|&amp;lt;nowiki&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/nowiki&amp;gt;}} is accepted as well in HTML5, but is not better in any way than {{ic|&amp;lt;nowiki&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;}}, so it makes no sense to let a bot change all of these. See http://stackoverflow.com/questions/1946426/html-5-is-it-br-br-or-br for more information. (edit: to clarify: I think the rule should not be there and we should remove it) [[User:Lonaowna|Lonaowna]] ([[User talk:Lonaowna|talk]]) 14:01, 3 December 2016 (UTC)&lt;br /&gt;
&lt;br /&gt;
:::::Just like with any other style rule, the purpose of this one would not be to improve the functionality or compatibility with browsers or standards, but more simply to resolve possible editing disputes by stating what is the preferred way to write html tags, and also to have a more consistent source text in general. Usually I do tend to prefer self-closed tags (when I pay attention to that detail, which wasn&#039;t clearly the case when I wrote this article :P ), however if more users think that this rule is too strict, when compared to the other ones, we can always just fall back on [[Help:Style#Coding style]]. — [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 16:03, 3 December 2016 (UTC)&lt;br /&gt;
&lt;br /&gt;
::::::I too think the self-closed style looks better, but I think it is too unimportant to make a rule about. It makes no difference in how the reader experiences the page, both options are technically valid, and the rule only creates extra work for the editors. It also makes the [[Help:Style]] page needlessly longer. The longer it is, the less people will read, honour and memorise it. I really don&#039;t see why we should enforce one or the other.  [[User:Lonaowna|Lonaowna]] ([[User talk:Lonaowna|talk]]) 16:33, 3 December 2016 (UTC)&lt;br /&gt;
&lt;br /&gt;
:::::::I agree this is too specific to make an explicit rule over. After all, we&#039;re not trying to compete with [[w:Wikipedia:Manual of style]]. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 17:52, 3 December 2016 (UTC)&lt;br /&gt;
&lt;br /&gt;
::::::::How about replacing the usage of {{ic|&amp;lt;nowiki&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/nowiki&amp;gt;}} with a template ([[Template:\n]]) which would insert it instead. We could get rid of the special rule for br (and also the one I added) and the page would be shorter than before I edited it. [[Help:Editing#Line breaks]] and maybe others would need adjusting, but it should not make them longer. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 09:44, 4 December 2016 (UTC)&lt;br /&gt;
&lt;br /&gt;
::::::::I rolled back the changes to [[Help:Style]]. Any thoughts about the [[Template:\n]] idea? -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 15:12, 5 December 2016 (UTC)&lt;br /&gt;
&lt;br /&gt;
:::::::::I see, however we&#039;re still 2 for and 2 against the new style rule :)&lt;br /&gt;
:::::::::Regarding [[Template:\n]], I&#039;m against instead because it feels too complicated, and it would look a bit incoherent to me if a style rule about void tags syntax was rejected because unimportant, but then we passed one to enforce replacing &amp;amp;lt;br&amp;gt; tags altogether. — [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 10:16, 6 December 2016 (UTC)&lt;br /&gt;
&lt;br /&gt;
::::::::::I&#039;m still for the new style rule, it just seemed &#039;&#039;wrong&#039;&#039; to have it sitting there while someone so strongly objects to it. If the &#039;&#039;&#039;for&#039;&#039;&#039; side wins we can undo the rollback.&lt;br /&gt;
::::::::::About [[Template:\n]], I thought that having a template would be preferable to using plain HTML. -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 10:31, 6 December 2016 (UTC)&lt;br /&gt;
&lt;br /&gt;
:::::::::::Wikipedia has [[w:Template:break|Template:break]] for this purpose, but it&#039;s not just a stupid wrapper around &amp;amp;lt;br&amp;gt; since their Lua module allowed the implementation of the &amp;quot;count&amp;quot; parameter. They also have many similar [[w:Category:Wikipedia_XHTML_tag-replacing_templates|templates to replace XHTML tags]], but most of them are not simple wrappers. Some are convenient shortcuts, some involve Lua programming, and some are there just for consistency. If we want to go the same way (except for Lua obviously), I&#039;d say the &amp;quot;consistency templates&amp;quot; like a &amp;amp;lt;br&amp;gt; wrapper should be created last and not induce the creation of the more complex templates. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 15:00, 6 December 2016 (UTC)&lt;br /&gt;
&lt;br /&gt;
::::::::::::So, which of the other templates do we &#039;&#039;need&#039;&#039;? -- [[User:nl6720|nl6720]] ([[User talk:nl6720|talk]]) 15:44, 10 December 2016 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Formatting for pseudo-URLs ==&lt;br /&gt;
&lt;br /&gt;
There are many cases which use wording like &amp;quot;Navigate to &#039;&#039;some URL&#039;&#039;&amp;quot;, where &amp;quot;&#039;&#039;some URL&#039;&#039;&amp;quot; is usually something like http://yoursite.com/foo/bar, http://yourdomain/foo/bar, http://example.com/foo/bar, http://domain.tld/foo/bar, http://domain:8080/foo/bar or http://localhost/foo/bar. Note that the &amp;quot;/foo/bar&amp;quot; part does not necessarily have to be intended as a pseudo-variable, it is usually a fixed string like &amp;quot;/mediawiki/&amp;quot; or &amp;quot;/phpMyAdmin&amp;quot; which represent the web-application&#039;s default location.&lt;br /&gt;
&lt;br /&gt;
How should these links be formatted? I wouldn&#039;t like them to be clickable, but links to localhost might be an exception. Then, should they be plain text or something else, and should the pseudo-variable formatting apply to the whole URL or just the variable parts of the URL?&lt;br /&gt;
&lt;br /&gt;
-- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 21:32, 28 February 2020 (UTC)&lt;br /&gt;
&lt;br /&gt;
:They could also be seen as [[Help:Style/Formatting and punctuation#File names and paths]] (maybe we can rename it to &amp;quot;Resource names and paths&amp;quot;), so monospace, which would at the same time solve the problem of allowing to highlight their variable parts with italics.&lt;br /&gt;
:I&#039;d also be ok with excepting localhost links, but then [[Help:Style/Formatting and punctuation#Links]] should apply.&lt;br /&gt;
:-- [[User:Kynikos|Kynikos]] ([[User talk:Kynikos|talk]]) 15:25, 16 March 2020 (UTC)&lt;br /&gt;
&lt;br /&gt;
:I encountered [https://wiki.archlinux.org/index.php?title=MantisBT&amp;amp;curid=23530&amp;amp;diff=652506&amp;amp;oldid=603264 this one] yesterday. I turned it into a path for now because it was detected as a dead link.&lt;br /&gt;
:Perhaps something like the following will work?&lt;br /&gt;
::Open [[List of applications/Internet#Web browsers|https://domain.tld/some/path in a web browser]]&lt;br /&gt;
:I do not like this too much because this is potentially misleading, but you get the idea. Maybe a new section in [[Help:Reading]] is appropriate for this? Also it requires typing out the full URL which is tedious but acceptable.&lt;br /&gt;
:Another idea would be to use https://example.com but I also do not like this because it depends on external resources and this is unnecessary.&lt;br /&gt;
:A new template for this might be a good idea, but this potentially requires maintenance and a lot of effort.&lt;br /&gt;
:-- [[User:NetSysFire|NetSysFire]] ([[User talk:NetSysFire|talk]]) 05:20, 16 February 2021 (UTC)&lt;br /&gt;
&lt;br /&gt;
::I&#039;d avoid formatting the pseudo-URLs as clickable links to something else, because it makes it harder to select the pseudo-URL text (or its part) without actually clicking the link. So I think using monospace with italics, e.g. &amp;quot;Open {{ic|https://&#039;&#039;domain.tld&#039;&#039;/some/path}} in a [[web browser]].&amp;quot;, would be best. — [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 13:49, 8 May 2021 (UTC)&lt;br /&gt;
&lt;br /&gt;
:::I agree. But one thing that still needs to be clarified is what example (pseudo) domain/host to use. There are some possible solutions:&lt;br /&gt;
:::* &#039;&#039;domain.tld&#039;&#039; - my favorite so far&lt;br /&gt;
:::* &#039;&#039;host&#039;&#039;&lt;br /&gt;
:::* &#039;&#039;address&#039;&#039; - sometimes there is no DNS involved&lt;br /&gt;
:::Alternatively one could also use a template perhaps? This is effort and potentially unnecessarily complex. Like this:&lt;br /&gt;
::::Open {{ic|https://[[Help:Reading|domain.tld]]:8000/some/path}} and do something.&lt;br /&gt;
:::-- [[User:NetSysFire|NetSysFire]] ([[User talk:NetSysFire|talk]]) 09:19, 14 May 2021 (UTC)&lt;br /&gt;
&lt;br /&gt;
::::I like &#039;&#039;domain.tld&#039;&#039; too because of the included dot. It can be easily extended to e.g. &#039;&#039;sub.domain.tld&#039;&#039; if some page talks about subdomains. — [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 14:56, 1 August 2021 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Merge Help:Style#Formatting here? ==&lt;br /&gt;
&lt;br /&gt;
This page is all about formatting, so why don&#039;t we merge [[Help:Style#Formatting]] here to keep all formatting rules in one place? — [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 19:08, 9 September 2023 (UTC)&lt;br /&gt;
&lt;br /&gt;
:+1 for that. I always confuse with them. -- [[User:Andrei Korshikov|Andrei Korshikov]] ([[User talk:Andrei Korshikov|talk]]) 16:45, 17 December 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
== systemd-* daemons ==&lt;br /&gt;
&lt;br /&gt;
I was looking over [[systemd-resolved]] and found italicising &#039;&#039;systemd-resolved&#039;&#039; confusing, particularly when used in close vicinity of an actual command-line utility like &#039;&#039;resolveconf&#039;&#039;, like in [[Systemd-resolved#Automatically]]. Then scoured over style examples and did not find any. I do remember it being discussed long ago, but did not look into history. It gets no better by systemd providing some utilities like &#039;&#039;systemd-run&#039;&#039;, &#039;&#039;systemd-resolve / resolvectl &#039;&#039;, etc.&lt;br /&gt;
&lt;br /&gt;
Is this exception of italicising the &#039;&#039;systemd-*&#039;&#039; daemons/libraries/tools covered somewhere? I now think it would be better not to italicise them, unless useable on the command-line, except perhaps for highlighting as a first-mention.&lt;br /&gt;
--[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 17:24, 12 May 2026 (UTC)&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Talk:PAM&amp;diff=873704</id>
		<title>Talk:PAM</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Talk:PAM&amp;diff=873704"/>
		<updated>2026-05-12T16:26:33Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Accuracy of PAM#Examples */ re&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Accuracy of PAM#Examples ==&lt;br /&gt;
The accuracy of [[PAM#Examples]] was discussed at [https://bbs.archlinux.org/viewtopic.php?id=245892 the forums]. I suggest to &lt;br /&gt;
# Mention that nullok inverts pam_unix.so default behavoiur of not allowing blank passwords.&lt;br /&gt;
# Remove the claim that&lt;br /&gt;
::: - the latter being what pam_permit.so is used for.&lt;br /&gt;
::And state that as is, the pam_permit.so line has no effect with this configuration due to the way pam treats an optional module. &lt;br /&gt;
02:05, 23 April 2019 (UTC)&lt;br /&gt;
&lt;br /&gt;
Edit: I tried to review this thread at 13 April 2024. My first difficulty was to see the content of the article back then. Was it as in [[Special:Diff/571854/cur]]? 13 April 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[User:Regid|Regid]] ([[User talk:Regid|talk]])&lt;br /&gt;
:Technically it&#039;s used as a fallback in case no other modules has contributed to the return code. According to manual {{ic|pam_unix(8)}}, {{ic|pam_unix}} can return {{ic|PAM_IGNORE}} which leaves {{ic|pam_permit}} the only one in this stack, hence {{ic|pam_permit}}&#039;s return code is used as the final result. This is a common practice to avoid being locked from the system accidentally.&lt;br /&gt;
:[[User:FrederickZh|FrederickZh]] ([[User talk:FrederickZh|talk]]) 20:07, 5 January 2021 (UTC)&lt;br /&gt;
&lt;br /&gt;
::Good point to discuss. The purpose of [[PAM#Examples]] was, as it says with reference to the warning, to illustrate how an single erroneous change (of switching required and optional) can havoc the stack. For that it referenced it default pambase, which was later updated in 08/2021.[https://github.com/archlinux/svntogit-packages/commit/2d5af94ae55a5c98837ce9631f331ad2aad32bb3] Explaining how and when nullok takes effect and when pam_permit applies, was not necessary to show the point (and both would have required deeper dive, yes). Since, the stack and login.defs have changed more; the example does not work anymore. A simple example following current system-auth (to follow the section) would be best, because we don&#039;t want users locking themselves out when they try it. Ideas how to update it?&lt;br /&gt;
::--[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 18:15, 26 May 2022 (UTC)&lt;br /&gt;
&lt;br /&gt;
::Revisiting, I added [https://wiki.archlinux.org/index.php?title=PAM&amp;amp;diff=803367&amp;amp;oldid=790245 the reference]. Perhaps another example would be to fiddle with pam_faillock.so to intentionally break that, but it would need a little more verbose.? --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 20:30, 15 March 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
::@Regid: Regarding your review of 13 April, the diff you link is complicated to overview, but the first example at [[PAM#Examples]] has the status you reviewed in your original comment + my above link addendum. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 22:50, 28 October 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
::No new ideas from my side for a suitable example. I&#039;ve now come to the conclusion, it&#039;s sufficient to remove the first example of [[PAM#Examples]] and use the existing second as one example, maybe plus another crosslink to [[Security]] for relevant PAM configuration. That is unless someone else has an idea prior. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 19:22, 11 May 2026 (UTC)&lt;br /&gt;
::I forgot to mention, I added [https://wiki.archlinux.org/index.php?title=Security&amp;amp;diff=873616&amp;amp;oldid=873614] yesterday to cover {{ic|nullok}} handling. The points mentioned at the beginning of this item may well go in there, if any of you want to cover it. I consider it a better destination, because it&#039;s where adjusting PAM pw processing is covered. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 16:26, 12 May 2026 (UTC)&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Chromium&amp;diff=873702</id>
		<title>Chromium</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Chromium&amp;diff=873702"/>
		<updated>2026-05-12T16:02:47Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Re-enable Manifest V2 (MV2) extension compatibility */ shorten version (it&amp;#039;s the first v148 shipped, hence no ambiguity) in line with other version quoting in the article&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Web browser]]&lt;br /&gt;
[[Category:Google]]&lt;br /&gt;
[[de:Chromium]]&lt;br /&gt;
[[ja:Chromium]]&lt;br /&gt;
[[zh-hans:Chromium]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|Browser extensions}}&lt;br /&gt;
{{Related|Firefox}}&lt;br /&gt;
{{Related|Vivaldi}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:Chromium (web browser)|Chromium]] is an open-source graphical web browser based on the [[Wikipedia:Blink (web engine)|Blink]] rendering engine. It is the basis for the proprietary Google Chrome browser.&lt;br /&gt;
&lt;br /&gt;
See [https://chromium.googlesource.com/chromium/src/+/master/docs/chromium_browser_vs_google_chrome.md this page] for an explanation of the differences between Chromium and Google Chrome.&lt;br /&gt;
&lt;br /&gt;
{{Tip|&lt;br /&gt;
On {{Pkg|chromium}}, Chrome Sync can be temporarily restored by [https://gist.github.com/foutrelis/14e339596b89813aa9c37fd1b4e5d9d5 using Chrome&#039;s OAuth2 credentials] or [https://www.chromium.org/developers/how-tos/api-keys getting your own], but pay attention to the disclaimers and do not consider this to be a long-term solution.&lt;br /&gt;
&lt;br /&gt;
Consider switching to [https://www.xbrowsersync.org/ xBrowserSync] for bookmark synchronization as a long-term solution.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
See [[List of applications/Internet#Blink-based]] for other browsers based on Chromium.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
[[Install]] the {{Pkg|chromium}} package, which tracks the {{AUR|google-chrome}} releases.&lt;br /&gt;
&lt;br /&gt;
{{Note|From the [https://www.chromium.org/Home/chromium-privacy Chromium privacy page]: &amp;quot;Features that communicate with Google made available through the compilation of code in Chromium are subject to the [https://www.google.com/policies/privacy/ Google Privacy Policy].&amp;quot; For those who want to avoid all integration with Google services, there are some [[List of applications/Internet#Privacy-focused Chromium spin-offs|privacy-focused spin-offs]].}}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
{{Merge|#Tips and tricks|Most of the content in this section should be split between [[#Tips and tricks]] and maybe [[#Troubleshooting]] for the applicable sections.}}&lt;br /&gt;
&lt;br /&gt;
=== Default applications ===&lt;br /&gt;
&lt;br /&gt;
To set Chromium as the default browser and to change which applications Chromium launches when opening downloaded files, see [[default applications]].&lt;br /&gt;
&lt;br /&gt;
=== Certificates ===&lt;br /&gt;
&lt;br /&gt;
Chromium uses [[Network Security Services]] for certificate management. Certificates can be managed in {{ic|chrome://certificate-manager}}.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Local certificates&amp;quot; tab manages server certificates. Certificates added in the &amp;quot;Custom&amp;quot; section are per-profile, and stored in the {{ic|ServerCertificate}} SQLite database in the profile directory. Certificates in the &amp;quot;Linux&amp;quot; section are read from the NSS Shared DB at {{ic|~/.pki/nssdb}}, and cannot be modified in this UI. To add to NSS Shared DB, use another tool such as &#039;&#039;certutil&#039;&#039;. See [[#SSL certificates]] for usage examples.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Your certificates&amp;quot; tab manages client certificates. Certificates added here are stored in the NSS Shared DB.&lt;br /&gt;
&lt;br /&gt;
=== Making flags persistent ===&lt;br /&gt;
&lt;br /&gt;
{{Note|The {{ic|chromium-flags.conf}} file and the accompanying custom launcher script are specific to the various Chromium packages. For Google Chrome, use {{ic|chrome-flags.conf}} (or {{ic|chrome-&#039;&#039;channel&#039;&#039;-flags.conf}} for the Dev and Beta channels) instead.}}&lt;br /&gt;
&lt;br /&gt;
You can put your flags in a {{ic|chromium-flags.conf}} file under {{ic|$HOME/.config/}} (or under {{ic|$XDG_CONFIG_HOME}} if you have configured that environment variable) or {{ic|/etc/}} for global.&lt;br /&gt;
&lt;br /&gt;
No special syntax is used; flags are defined as if they were written in a terminal.&lt;br /&gt;
&lt;br /&gt;
* The arguments are split on whitespace and shell quoting rules apply, but no further parsing is performed.&lt;br /&gt;
* In case of improper quoting anywhere in the file, a fatal error is raised.&lt;br /&gt;
* Flags can be placed in separate lines for readability, but this is not required.&lt;br /&gt;
* Lines starting with a hash symbol (#) are skipped. (This is only supported by the Chromium launcher script and will not work when using Google Chrome.)&lt;br /&gt;
&lt;br /&gt;
Below is an example {{ic|chromium-flags.conf}} file that defines the flags {{ic|--start-maximized --incognito}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/chromium-flags.conf|&lt;br /&gt;
# This line will be ignored.&lt;br /&gt;
--start-maximized&lt;br /&gt;
--incognito&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Force GPU acceleration ===&lt;br /&gt;
&lt;br /&gt;
Since at least Chromium 110, GPU acceleration is enabled by default for most systems. You may have to [[append]] the following flags to [[/Tips and tricks#Making flags persistent|persistent configuration]] if your system configuration is matched by the [https://chromium.googlesource.com/chromium/src/gpu/+/master/config/software_rendering_list.json block list]:&lt;br /&gt;
&lt;br /&gt;
{{Warning|Disabling the rendering blocklist may cause unstable behavior, including crashes of the host. See the bug reports in {{ic|chrome://gpu}} for details.}}&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/chromium-flags.conf|&lt;br /&gt;
--ignore-gpu-blocklist&lt;br /&gt;
--enable-zero-copy&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Hardware video acceleration ===&lt;br /&gt;
&lt;br /&gt;
{{Note|1=&amp;lt;nowiki/&amp;gt;&lt;br /&gt;
* There is no official support from Chromium or Arch Linux for this feature [https://chromium.googlesource.com/chromium/src/+/master/docs/gpu/vaapi.md#vaapi-on-linux]. However, {{Pkg|chromium}} from official repositories is compiled with VA-API support and you may ask for help in [https://bbs.archlinux.org/viewtopic.php?id=244031 the dedicated forum thread].&lt;br /&gt;
* Since Chromium version 122, an extra [[VA-API]] package is no longer needed. VA-API works when using the native Wayland backend with the {{Pkg|chromium}} package from official repositories.&lt;br /&gt;
* Chromium 116 dropped support for Intel iGPUs using {{Pkg|libva-intel-driver}}. To have working h264 acceleration, {{AUR|libva-intel-driver-irql}} is required.&lt;br /&gt;
* When trying to find the correct combination of flags in {{ic|chromium-flags.conf}}, note that this file should contain at most one line starting with {{ic|--enable-features}} and {{ic|--disable-features}}. Multiple features must be concatenated with commas.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
If you have confirmed working VA-API support by checking the output of {{ic|1=vainfo}} (see [[Hardware video acceleration#Verifying VA-API]]), since Chromium 143 hardware acceleration via VA-API should work out of box. On older Chromium versions you might first try the following flag alone:&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/chromium-flags.conf|&lt;br /&gt;
--enable-features{{=}}AcceleratedVideoDecodeLinuxGL&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* When using EGL/Wayland and Chromium versions prior to 143, using {{ic|--enable-features{{=}}AcceleratedVideoDecodeLinuxGL,AcceleratedVideoDecodeLinuxZeroCopyGL}} instead of the above flag may improve performance.&lt;br /&gt;
* Chromium versions prior to 131 should use {{ic|--enable-features{{=}}VaapiVideoDecodeLinuxGL}} instead.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Otherwise, continue reading.&lt;br /&gt;
&lt;br /&gt;
To enable accelerated &#039;&#039;&#039;en&#039;&#039;&#039;coding in Chromium:&lt;br /&gt;
* Append the {{ic|AcceleratedVideoEncoder}} feature, e.g. {{ic|1=--enable-features{{=}}AcceleratedVideoDecodeLinuxGL,AcceleratedVideoEncoder}}. See [https://github.com/chromium/chromium/blob/main/docs/gpu/vaapi.md#vaapi-on-linux] and [https://issues.chromium.org/issues/40225939#comment54] for details.&lt;br /&gt;
&lt;br /&gt;
To enable VA-API support:&lt;br /&gt;
&lt;br /&gt;
* Install the correct VA-API driver for your video card and verify VA-API has been enabled and working correctly, see [[Hardware video acceleration]]. For proprietary NVIDIA support, you must install {{Pkg|libva-nvidia-driver}} and append the {{ic|VaapiOnNvidiaGPUs}} feature in addition to the features above.&lt;br /&gt;
* Set the option {{ic|1=--enable-features=VaapiVideoDecoder}}. This is enough when using ANGLE GL renderer and {{Pkg|libva-intel-driver}}.&lt;br /&gt;
* When using ANGLE, Chromium forces the older i965 driver and fails when {{Pkg|intel-media-driver}} is used. As a workaround, [[Hardware video acceleration#Configuring VA-API|configure VA-API manually]]. See [https://github.com/intel/media-driver/issues/818] for details.&lt;br /&gt;
* To use the system GL renderer on Xorg or Wayland, use {{ic|1=--use-gl=egl}}. Setting this option might no longer be needed when using Chrome 112 and may break GPU acceleration when using AMD GPUs.&lt;br /&gt;
* If VA-API still does not work, try the {{ic|1=--enable-features=VaapiIgnoreDriverChecks}} or{{ic|1=--disable-features=UseChromeOSDirectVideoDecoder}} flag&lt;br /&gt;
* If VA-API still does not work on X11 and old GPUs, set the {{ic|1=LIBVA_DRI3_DISABLE=1}} [[environment variable]] [https://www.phoronix.com/news/VA-API-libva-2.18].&lt;br /&gt;
&lt;br /&gt;
==== Vulkan ====&lt;br /&gt;
&lt;br /&gt;
When using Vulkan, the following flags are required and might also be sufficient on Chromium 126 and Mesa 24.1:&lt;br /&gt;
{{hc|~/.config/chromium-flags.conf|&lt;br /&gt;
--enable-features{{=}}VaapiVideoDecoder,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE&lt;br /&gt;
}}&lt;br /&gt;
without any of the additional flags mentioned above.&lt;br /&gt;
&lt;br /&gt;
==== Tips and tricks ====&lt;br /&gt;
&lt;br /&gt;
{{Out of date|&lt;br /&gt;
* Chromium uses VaapiVideoDecoder for AV1 on Wayland + RADV&lt;br /&gt;
* Chromium uses VaapiVideoDecoder for videos of any size on Wayland + RADV&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To check if it is working play a video which is using a codec supported by your VA-API driver (&#039;&#039;vainfo&#039;&#039; tells you which codecs are supported, but Chromium will only support VP9 and h264):&lt;br /&gt;
&lt;br /&gt;
* Open the DevTools by pressing {{ic|Ctrl+Shift+I}} or on the &#039;&#039;Inspect&#039;&#039; button of the context (right-click) menu&lt;br /&gt;
* Add the Media inspection tab: &#039;&#039;Hamburger menu &amp;gt; More tools &amp;gt; Media&#039;&#039;&lt;br /&gt;
* In the newly opened Media tab, look at the hardware decoder state of the video decoder&lt;br /&gt;
&lt;br /&gt;
Test on a large enough video. Starting with version 86, Chromium on desktop [https://issues.chromium.org/issues/40503293 will only accelerate videos larger than 720p].&lt;br /&gt;
&lt;br /&gt;
To reduce CPU usage while watching YouTube where VP8/VP9 hardware decoding is not available use the [https://chrome.google.com/webstore/detail/h264ify/aleakchihdccplidncghkekgioiakgal h264ify], [https://chrome.google.com/webstore/detail/enhanced-h264ify/omkfmpieigblcllmkgbflkikinpkodlk enhanced-h264ify] or [https://chrome.google.com/webstore/detail/not-yet-av1/dcmllfkiihingappljlkffafnlhdpbai Not yet, AV1][https://bbs.archlinux.org/viewtopic.php?pid=2039884#p2039884] extension.&lt;br /&gt;
&lt;br /&gt;
On some systems (especially on Xwayland) you might need to [[#Force GPU acceleration]]. Only {{ic|--ignore-gpu-blocklist}} is enough for our purposes.&lt;br /&gt;
&lt;br /&gt;
{{Expansion|Provide a link to some bug report.}}&lt;br /&gt;
&lt;br /&gt;
You might need to disable the Skia renderer, as it is currently not compatible with video decode acceleration: {{ic|1=--disable-features=UseSkiaRenderer}}&lt;br /&gt;
&lt;br /&gt;
=== KDE integration ===&lt;br /&gt;
&lt;br /&gt;
For integration into [[Plasma]], you can:&lt;br /&gt;
&lt;br /&gt;
* install {{Pkg|plasma-browser-integration}} on your system, and [https://chromewebstore.google.com/detail/plasma-integration/cimiefiiaegbelhefglklhhakcgmhkai Plasma Integration] in your browser (see [https://community.kde.org/Plasma/Browser_Integration KDE Plasma Browser Integration] for more details)&lt;br /&gt;
* install {{Pkg|kdialog}} to allow Chromium to use native KDE open/save dialogs&lt;br /&gt;
* [[KDE_Wallet#KDE_Wallet_for_Chromium_and_VSCode|configure Chromium to use KWallet]]&lt;br /&gt;
&lt;br /&gt;
=== PDF viewer plugin ===&lt;br /&gt;
&lt;br /&gt;
Chromium and Google Chrome are bundled with the &#039;&#039;Chromium PDF Viewer&#039;&#039; plugin. If you do not want to use this plugin, check &#039;&#039;Download PDFs&#039;&#039; in {{ic|chrome://settings/content/pdfDocuments}}.&lt;br /&gt;
&lt;br /&gt;
=== Running on Xwayland ===&lt;br /&gt;
&lt;br /&gt;
If you are using NVIDIA&#039;s proprietary driver, running Chromium on Xwayland may cause the GPU process to occasionally crash. To prevent the GPU process from crashing, add the following flags:&lt;br /&gt;
&lt;br /&gt;
 --use-angle=vulkan --use-cmd-decoder=passthrough&lt;br /&gt;
&lt;br /&gt;
{{Note|This does not prevent all Xwayland-related crashes.}}&lt;br /&gt;
&lt;br /&gt;
=== Native Wayland support ===&lt;br /&gt;
&lt;br /&gt;
Chromium 140 supports [[Wayland]] by default.&lt;br /&gt;
For old versions, you can use&lt;br /&gt;
&lt;br /&gt;
 --ozone-platform-hint=auto&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 --ozone-platform=wayland&lt;br /&gt;
&lt;br /&gt;
See [[#Making flags persistent]] for a permanent configuration. The flag is also available via [[#chrome:// URLs|browser flags menu]].&lt;br /&gt;
&lt;br /&gt;
This will select wayland Ozone backend when in wayland session, so you can use a single desktop entry if you switch between X11 and Wayland often.&lt;br /&gt;
&lt;br /&gt;
{{Note|When changing the &amp;quot;ozone-platform-hint&amp;quot; in browser flags menu, the browser will provide you a relaunch button. Do not use it, because the browser will still be relaunched in a platform it was before changing the flag. You need to close the browser, then open it.}}&lt;br /&gt;
&lt;br /&gt;
Additionally, if you are having [https://issues.chromium.org/issues/40259478 trouble with input methods] you may also want to force newer GTK:&lt;br /&gt;
&lt;br /&gt;
 --gtk-version=4&lt;br /&gt;
&lt;br /&gt;
If a {{ic|AltGr}}/{{ic|Compose}} key stops working, adding this workaround might fix it:&lt;br /&gt;
&lt;br /&gt;
 --disable-gtk-ime&lt;br /&gt;
&lt;br /&gt;
If you are using Fcitx5 and not work properly when using the above flags, try using the {{ic|--enable-wayland-ime}} flag instead of {{ic|--gtk-version{{=}}4}}. [https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland#Chromium_.2F_Electron]&lt;br /&gt;
&lt;br /&gt;
 --enable-wayland-ime --wayland-text-input-version=3&lt;br /&gt;
&lt;br /&gt;
{{Note|Enabling the {{ic|--enable-wayland-ime}} flag works if the {{ic|text_input_v1}} protocol is implemented by default. Known compositors that implement this protocol are: Weston, KWin, Hyprland.}}&lt;br /&gt;
&lt;br /&gt;
==== Touchpad gestures for navigation ====&lt;br /&gt;
&lt;br /&gt;
To enable two finger swipe to go back and forward through your history, use the following flags:&lt;br /&gt;
&lt;br /&gt;
 --ozone-platform-hint=auto --enable-features=TouchpadOverscrollHistoryNavigation&lt;br /&gt;
&lt;br /&gt;
==== Force device scale factor ====&lt;br /&gt;
&lt;br /&gt;
{{Merge|HiDPI#Chromium / Google Chrome|Same topic.}}&lt;br /&gt;
&lt;br /&gt;
To force a scale factor on native Wayland, use the following flags [https://chromium.googlesource.com/chromium/src/+/756e64489c84c22998470beddb1facab5e78e1fa]:&lt;br /&gt;
&lt;br /&gt;
 --force-device-scale-factor=1.33 --gtk-version=4 --enable-features=WaylandPerSurfaceScale,WaylandUiScale&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
The following tips and tricks should work for both Chromium and Chrome unless explicitly stated.&lt;br /&gt;
&lt;br /&gt;
=== Browsing experience ===&lt;br /&gt;
&lt;br /&gt;
==== chrome:// URLs ====&lt;br /&gt;
&lt;br /&gt;
A number of tweaks can be accessed via Chrome URLs. See &#039;&#039;&#039;chrome://chrome-urls&#039;&#039;&#039; for a complete list.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;chrome://flags&#039;&#039;&#039; - access experimental features such as WebGL and rendering webpages with GPU, etc.&lt;br /&gt;
* &#039;&#039;&#039;chrome://extensions&#039;&#039;&#039; - view, enable and disable the currently used Chromium extensions.&lt;br /&gt;
* &#039;&#039;&#039;chrome://gpu&#039;&#039;&#039; - status of different GPU options.&lt;br /&gt;
* &#039;&#039;&#039;chrome://sandbox&#039;&#039;&#039; - indicate sandbox status.&lt;br /&gt;
* &#039;&#039;&#039;chrome://version&#039;&#039;&#039; - display version and switches used to invoke the active {{ic|/usr/bin/chromium}}.&lt;br /&gt;
&lt;br /&gt;
An automatically updated, complete listing of Chromium switches (command line parameters) is available at https://peter.sh/experiments/chromium-command-line-switches/.&lt;br /&gt;
&lt;br /&gt;
==== Chromium task manager ====&lt;br /&gt;
&lt;br /&gt;
Shift+ESC can be used to bring up the browser task manager wherein memory, CPU, and network usage can be viewed.&lt;br /&gt;
&lt;br /&gt;
==== Chromium overrides/overwrites Preferences file ====&lt;br /&gt;
&lt;br /&gt;
If you enabled syncing with a Google Account, then Chromium will override any direct edits to the Preferences file found under {{ic|~/.config/chromium/Default/Preferences}}. To work around this, start Chromium with the {{ic|--disable-sync-preferences}} switch:&lt;br /&gt;
 $ chromium --disable-sync-preferences&lt;br /&gt;
&lt;br /&gt;
If Chromium is started in the background when you login in to your desktop environment, make sure the command your desktop environment uses is:&lt;br /&gt;
 $ chromium --disable-sync-preferences --no-startup-window&lt;br /&gt;
&lt;br /&gt;
==== Search engines ====&lt;br /&gt;
&lt;br /&gt;
Make sites like [https://wiki.archlinux.org wiki.archlinux.org] and [https://en.wikipedia.org wikipedia.org] easily searchable by first executing a search on those pages, then going to &#039;&#039;Settings &amp;gt; Search&#039;&#039; and click the &#039;&#039;Manage search engines..&#039;&#039; button. From there, &amp;quot;Edit&amp;quot; the Wikipedia entry and change its keyword to &#039;&#039;&#039;w&#039;&#039;&#039; (or some other shortcut you prefer). Now searching Wikipedia for &amp;quot;Arch Linux&amp;quot; from the address bar is done simply by entering &amp;quot;&#039;&#039;&#039;w arch linux&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{{Note| Google search is used automatically when typing something into the URL bar. A hard-coded keyword trigger is also available using the &#039;&#039;&#039;?&#039;&#039;&#039; prefix.}}&lt;br /&gt;
&lt;br /&gt;
==== Tmpfs ====&lt;br /&gt;
&lt;br /&gt;
===== Cache in tmpfs =====&lt;br /&gt;
&lt;br /&gt;
{{Note|Chromium stores its cache separate from its browser profile directory.}}&lt;br /&gt;
&lt;br /&gt;
To limit Chromium from writing its cache to a physical disk, one can define an alternative location via the {{ic|--disk-cache-dir}} flag:&lt;br /&gt;
&lt;br /&gt;
 $ chromium --disk-cache-dir=&amp;quot;$XDG_RUNTIME_DIR/chromium-cache&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Cache should be considered temporary and will &#039;&#039;&#039;not&#039;&#039;&#039; be saved after a reboot or hard lock. Another option is to setup the space in {{ic|/etc/fstab}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/fstab|2=&lt;br /&gt;
tmpfs	/home/&#039;&#039;username&#039;&#039;/.cache/chromium	tmpfs	noatime,nodev,nosuid,size=&#039;&#039;400M&#039;&#039;	0	0&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Alternatively create a symbolic link to {{ic|/tmp}}. Make sure to delete Chromium&#039;s cache folder before you run the command: &lt;br /&gt;
&lt;br /&gt;
 $ ln -s /tmp /home/&#039;&#039;username&#039;&#039;/.cache/chromium&lt;br /&gt;
&lt;br /&gt;
===== Profile in tmpfs =====&lt;br /&gt;
&lt;br /&gt;
Relocate the browser profile to a [[tmpfs]] filesystem, including {{ic|/tmp}}, or {{ic|/dev/shm}} for improvements in application response as the entire profile is now stored in RAM.&lt;br /&gt;
&lt;br /&gt;
Use an active profile management tool such as {{Pkg|profile-sync-daemon}} for maximal reliability and ease of use. It symlinks or bind mounts and syncs the browser profile directories to RAM. For more, see [[Profile-sync-daemon]].&lt;br /&gt;
&lt;br /&gt;
==== Launch a new browser instance ====&lt;br /&gt;
&lt;br /&gt;
When you launch the browser, it first checks if another instance using the same data directory is already running. If there is one, the new window is associated with the old instance. If you want to launch an independent instance of the browser, you must specify separate directory using the {{ic|--user-data-dir}} parameter:&lt;br /&gt;
&lt;br /&gt;
 $ chromium --user-data-dir=&#039;&#039;/path/to/some/directory&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{Note|The default location of the user data is {{ic|~/.config/chromium/}}.}}&lt;br /&gt;
&lt;br /&gt;
==== Directly open *.torrent files and magnet links with a torrent client ====&lt;br /&gt;
&lt;br /&gt;
By default, Chromium downloads {{ic|*.torrent}} files directly and you need to click the notification from the bottom-left corner of the screen in order for the file to be opened with your default torrent client. This can be avoided with the following method:&lt;br /&gt;
&lt;br /&gt;
* Download a {{ic|*.torrent}} file.&lt;br /&gt;
* Right-click the notification displayed at the bottom-left corner of the screen.&lt;br /&gt;
* Check the &amp;quot;&#039;&#039;Always Open Files of This Type&#039;&#039;&amp;quot; checkbox.&lt;br /&gt;
&lt;br /&gt;
See [[xdg-open]] to change the default assocation.&lt;br /&gt;
&lt;br /&gt;
==== Touch Scrolling on touchscreen devices ====&lt;br /&gt;
&lt;br /&gt;
You may need to specify which touch device to use. Find your touchscreen device with {{ic| xinput list}} then launch Chromium with the {{ic|1=--touch-devices=&#039;&#039;&#039;x&#039;&#039;&#039;}} parameter, where &amp;quot;&#039;&#039;&#039;x&#039;&#039;&#039;&amp;quot; is the id of your device. {{Note|If the device is designated as a slave pointer, using this may not work, use the master pointer&#039;s ID instead.}}&lt;br /&gt;
&lt;br /&gt;
==== Reduce memory usage ====&lt;br /&gt;
&lt;br /&gt;
By default, Chromium uses a separate OS process for each &#039;&#039;instance&#039;&#039; of a visited web site. [https://www.chromium.org/developers/design-documents/process-models#Supported_Models] However, you can specify command-line switches when starting Chromium to modify this behaviour.&lt;br /&gt;
&lt;br /&gt;
For example, to share one process for all instances of a website:&lt;br /&gt;
&lt;br /&gt;
 $ chromium --process-per-site&lt;br /&gt;
&lt;br /&gt;
To use a single process model:&lt;br /&gt;
&lt;br /&gt;
 $ chromium --single-process&lt;br /&gt;
&lt;br /&gt;
{{Warning|The single-process model is discouraged because it is unsafe and may contain bugs not present in other models.[https://www.chromium.org/developers/design-documents/process-models#TOC-Single-process]}}&lt;br /&gt;
&lt;br /&gt;
In addition, you can suspend or store inactive Tabs with extensions such as [https://chrome.google.com/webstore/detail/tab-suspender/fiabciakcmgepblmdkmemdbbkilneeeh?hl=en Tab Suspender] and [https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall?hl=en OneTab].&lt;br /&gt;
&lt;br /&gt;
==== User Agent ====&lt;br /&gt;
&lt;br /&gt;
The User Agent can be arbitrarily modified at the start of Chromium&#039;s base instance via its {{Ic|&amp;lt;nowiki&amp;gt;--user-agent=&amp;quot;[string]&amp;quot;&amp;lt;/nowiki&amp;gt;}} parameter.&lt;br /&gt;
&lt;br /&gt;
==== Forcing specific GPU ====&lt;br /&gt;
&lt;br /&gt;
In multi-GPU systems, Chromium automatically detects which GPU should be used for rendering (discrete or integrated). This works 99% of the time, except when it does not - if an unavailable GPU is picked (for example, discrete graphics on VFIO GPU passthrough-enabled systems), {{ic|chrome://gpu}} will complain about not being able to initialize the GPU process.&lt;br /&gt;
&lt;br /&gt;
On this page below &#039;&#039;&#039;Driver Information&#039;&#039;&#039; there will be multiple GPUs shown (GPU0, GPU1, ...). There is no user-friendly way to switch between them.  However we can read their PCI addresses then compel Chromium to select the GPU at a specific PCI address via command-line argument:&lt;br /&gt;
&lt;br /&gt;
{{hc|$ ls -l /dev/dri/by-path/|&lt;br /&gt;
pci-0000:&#039;&#039;&#039;01:00.0&#039;&#039;&#039;-render -&amp;gt; ../../renderD128&lt;br /&gt;
pci-0000:&#039;&#039;&#039;03:00.0&#039;&#039;&#039;-render -&amp;gt; ../../renderD129&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Then we can identify which is which:&lt;br /&gt;
&lt;br /&gt;
{{hc|lspci -k {{!}} grep &amp;quot;&#039;&#039;&#039;01:00.0&#039;&#039;&#039;\{{!}}&#039;&#039;&#039;03:00.0&#039;&#039;&#039;&amp;quot;|&lt;br /&gt;
&#039;&#039;&#039;01:00.0&#039;&#039;&#039; VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]&lt;br /&gt;
&#039;&#039;&#039;03:00.0&#039;&#039;&#039; VGA compatible controller: NVIDIA Corporation GA106 [GeForce RTX 3060 Lite Hash Rate] (rev a1)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Then to launch Chromium:&lt;br /&gt;
 $ chromium --render-node-override=/dev/dri/by-path/pci-0000:&#039;&#039;&#039;01:00.0&#039;&#039;&#039;-render&lt;br /&gt;
or&lt;br /&gt;
 $ chromium --render-node-override=/dev/dri/by-path/pci-0000:&#039;&#039;&#039;03:00.0&#039;&#039;&#039;-render&lt;br /&gt;
&lt;br /&gt;
Unfortunately the simpler {{ic|/dev/dri/renderD128}} or {{ic|/dev/dri/renderD129}} specifiers are unstable and subject to change based on driver/kernel module load order.&lt;br /&gt;
&lt;br /&gt;
==== Import bookmarks from Firefox ====&lt;br /&gt;
&lt;br /&gt;
To ease the transition, you can import bookmarks from [[Firefox]] into Chromium.&lt;br /&gt;
&lt;br /&gt;
Navigate Chromium to {{ic|chrome://settings/importData}}&lt;br /&gt;
&lt;br /&gt;
If Firefox is already installed on your computer, you can directly import bookmarks as well as many other things from Firefox.&lt;br /&gt;
&lt;br /&gt;
Make sure &#039;&#039;&#039;Mozilla Firefox&#039;&#039;&#039; is selected. Optionally, you can uncheck some unwanted items here. Click the &#039;&#039;&#039;Import&#039;&#039;&#039; and then &#039;&#039;&#039;Done&#039;&#039;&#039;. You are done with it.&lt;br /&gt;
&lt;br /&gt;
{{note|If you have not created any bookmarks in Chromium yet, the bookmarks will show up in your bookmarks bar. If you already have bookmarks, the bookmarks will be in a new folder labeled &amp;quot;Imported From Firefox&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
If you import bookmarks from another PC, you have to export bookmarks from Firefox first.&lt;br /&gt;
&lt;br /&gt;
{{ic|Ctrl+Shift+o}} &#039;&#039;Import and Backup &amp;gt; Export Bookmarks To HTML&#039;&#039; in Firefox.&lt;br /&gt;
&lt;br /&gt;
The procedure is pretty much the same. You need to go to {{ic|chrome://settings/importData}}. However, this time, in the &#039;&#039;&#039;From&#039;&#039;&#039; drop-down menu, select &#039;&#039;&#039;Bookmarks HTML File&#039;&#039;&#039; and click the &#039;&#039;&#039;Choose File&#039;&#039;&#039; button and upload the desired bookmark file.&lt;br /&gt;
&lt;br /&gt;
==== Enabling autoscroll with middle mouse button ====&lt;br /&gt;
&lt;br /&gt;
The autoscroll is still an experimental feature [https://niek.github.io/chrome-features/]. It is intended to be disabled by default if Chromium or Chromium-based browsers are not a development build and is running on a Linux environment. [https://issues.chromium.org/issues/40811836]&lt;br /&gt;
&lt;br /&gt;
To enable this feature, launch your browser with the {{ic|1=--enable-features=MiddleClickAutoscroll}} flag. In case you want to make the option persistent, see [[#Making flags persistent]].&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* While setting {{ic|--enable-blink-features}} works in the same way as only typing {{ic|--enable-features}}, the browser instead may display a warning to state this is an unsupported flag, which &amp;quot;stability and security will suffer&amp;quot;.&lt;br /&gt;
* As an alternative you can add an extension like [https://chromewebstore.google.com/detail/wheely-wheel-scroll-for-l/kkmfljfnlmppiaoijkfaejgkhccokpdn WHEELY] with similar behavior from Chrome Web Store.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|Another option is to [[install]] {{AUR|chromium-extension-autoscroll}}, but this is not recommended since it is an outdated package and not official. Use it with caution.}}&lt;br /&gt;
&lt;br /&gt;
==== U2F authentication ====&lt;br /&gt;
&lt;br /&gt;
Install {{Pkg|libfido2}} library. This provides the udev rules required to enable access to the [[U2F]] key as a user.&lt;br /&gt;
U2F keys are by default only accessible by root, and without these rules Chromium will give an error.&lt;br /&gt;
&lt;br /&gt;
==== Theming ====&lt;br /&gt;
&lt;br /&gt;
You can make Chromium use your current GTK theme for browser menus and controls. Simply press &#039;&#039;Use GTK&#039;&#039; in {{ic|chrome://settings/appearance}}.&lt;br /&gt;
&lt;br /&gt;
==== Dark mode ====&lt;br /&gt;
&lt;br /&gt;
Since Chromium 114, [[XDG Desktop Portal]] is used to automatically determine the user&#039;s preferred appearance ([https://issues.chromium.org/issues/40642550 issue]), thereby dissociating dark mode enablement from the user&#039;s GTK theme. This preference will be applied to &#039;&#039;prefers-color-scheme&#039;&#039; in CSS, JavaScript, Settings and Dev-Tools.&lt;br /&gt;
&lt;br /&gt;
The way to change the preferred appearance depends on your XDG Desktop Portal backend. For instance, many desktop environments have a switch in their appearance settings. Or when using e.g. {{Pkg|xdg-desktop-portal-gtk}}, set the preferred mode to {{ic|prefer-light}}, {{ic|prefer-dark}} or {{ic|default}} with:&lt;br /&gt;
&lt;br /&gt;
 $ dconf write /org/gnome/desktop/interface/color-scheme \&#039;prefer-dark\&#039;&lt;br /&gt;
&lt;br /&gt;
You can query the current preferred appearance using {{ic|dbus-send}} in {{Pkg|dbus}} ([https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings documentation]):&lt;br /&gt;
&lt;br /&gt;
 $ dbus-send --session --print-reply=literal --dest=org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read string:org.freedesktop.appearance string:color-scheme | tr -s &#039; &#039; | cut -d &#039; &#039; -f 5&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;0&#039;&#039;&#039;: No preference&lt;br /&gt;
* &#039;&#039;&#039;1&#039;&#039;&#039;: Prefer dark appearance&lt;br /&gt;
* &#039;&#039;&#039;2&#039;&#039;&#039;: Prefer light appearance&lt;br /&gt;
&lt;br /&gt;
===== Pre Chromium 114 =====&lt;br /&gt;
&lt;br /&gt;
To enable dark mode and enable the dark theme (normally used for incognito mode) [[append]] the following flag to [[#Making flags persistent|persistent configuration]]:&lt;br /&gt;
&lt;br /&gt;
{{hc|1=~/.config/chromium-flags.conf|2=&lt;br /&gt;
--force-dark-mode&lt;br /&gt;
--enable-features=WebUIDarkMode&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Enable Side Panel ====&lt;br /&gt;
&lt;br /&gt;
The Side Panel can be enabled through {{ic|chrome://flags}}. You can enable or disable &#039;&#039;&#039;Side panel&#039;&#039;&#039;, and change options such as &#039;&#039;&#039;Side panel border&#039;&#039;&#039; and &#039;&#039;&#039;Side panel drag and drop&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Profile maintenance ===&lt;br /&gt;
&lt;br /&gt;
Chromium uses [[SQLite]] databases to manage history and the like.  Sqlite databases become fragmented over time and empty spaces appear all around. But, since there are no managing processes checking and optimizing the database, these factors eventually result in a performance hit. A good way to improve startup and some other bookmarks- and history-related tasks is to defragment and trim unused space from these databases.&lt;br /&gt;
&lt;br /&gt;
{{Pkg|profile-cleaner}} and {{AUR|browser-vacuum}} do just this.&lt;br /&gt;
&lt;br /&gt;
=== Security ===&lt;br /&gt;
&lt;br /&gt;
==== Disable JIT ====&lt;br /&gt;
&lt;br /&gt;
At the cost of reduced performance, you can disable just-in-time compilation of JavaScript to native code, which is responsible for [https://microsoftedge.github.io/edgevr/posts/Super-Duper-Secure-Mode/ roughly half of the security vulnerabilities in the JS engine], using the flag {{ic|1=--js-flags=--jitless}}.&lt;br /&gt;
&lt;br /&gt;
==== WebRTC ====&lt;br /&gt;
&lt;br /&gt;
WebRTC is a communication protocol that relies on JavaScript that can leak one&#039;s actual IP address and hardware hash from behind a VPN. While some software may prevent the leaking scripts from running, it is probably a good idea to block this protocol directly as well, just to be safe. As of October 2016, there is no way to disable WebRTC on Chromium on desktop, there are extensions available to disable local IP address leak, one is this [https://chrome.google.com/webstore/detail/webrtc-network-limiter/npeicpdbkakmehahjeeohfdhnlpdklia extension].&lt;br /&gt;
&lt;br /&gt;
One can test WebRTC via https://browserleaks.com/webrtc.&lt;br /&gt;
&lt;br /&gt;
{{Warning|Even though IP leak can be prevented, Chromium still sends your unique hash, and there is no way to prevent this. More information is available at https://browserleaks.com/webrtc#howto-disable-webrtc.}}&lt;br /&gt;
&lt;br /&gt;
==== SSL certificates ====&lt;br /&gt;
&lt;br /&gt;
See [[#Certificates]] for general information.&lt;br /&gt;
&lt;br /&gt;
===== Adding CAcert certificates for self-signed certificates =====&lt;br /&gt;
&lt;br /&gt;
Grab the CAcerts and create an {{ic|nssdb}}, if one does not already exist.  To do this, first install the {{Pkg|nss}} package, then complete these steps:&lt;br /&gt;
&lt;br /&gt;
 $ mkdir -p $HOME/.pki/nssdb&lt;br /&gt;
 $ cd $HOME/.pki/nssdb&lt;br /&gt;
 $ certutil -N -d sql:.&lt;br /&gt;
&lt;br /&gt;
 $ curl -k -o &amp;quot;cacert-root.crt&amp;quot; &amp;quot;http://www.cacert.org/certs/root.crt&amp;quot;&lt;br /&gt;
 $ curl -k -o &amp;quot;cacert-class3.crt&amp;quot; &amp;quot;http://www.cacert.org/certs/class3.crt&amp;quot;&lt;br /&gt;
 $ certutil -d sql:$HOME/.pki/nssdb -A -t TC -n &amp;quot;CAcert.org&amp;quot; -i cacert-root.crt &lt;br /&gt;
 $ certutil -d sql:$HOME/.pki/nssdb -A -t TC -n &amp;quot;CAcert.org Class 3&amp;quot; -i cacert-class3.crt&lt;br /&gt;
&lt;br /&gt;
{{Note|Users will need to create a password for the database, if it does not exist.}}&lt;br /&gt;
&lt;br /&gt;
Now users may manually import a self-signed certificate.&lt;br /&gt;
&lt;br /&gt;
===== Example 1: Using a shell script to isolate the certificate from TomatoUSB =====&lt;br /&gt;
&lt;br /&gt;
Below is a simple script that will extract and add a certificate to the user&#039;s {{ic|nssdb}}:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # usage:  import-cert.sh remote.host.name [port]&lt;br /&gt;
 #&lt;br /&gt;
 REMHOST=$1&lt;br /&gt;
 REMPORT=${2:-443}&lt;br /&gt;
 exec 6&amp;gt;&amp;amp;1&lt;br /&gt;
 exec &amp;gt; $REMHOST&lt;br /&gt;
 echo | openssl s_client -connect ${REMHOST}:${REMPORT} 2&amp;gt;&amp;amp;1 |sed -ne &#039;/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p&#039;&lt;br /&gt;
 certutil -d sql:$HOME/.pki/nssdb -A -t &amp;quot;P,,&amp;quot; -n &amp;quot;$REMHOST&amp;quot; -i $REMHOST &lt;br /&gt;
 exec 1&amp;gt;&amp;amp;6 6&amp;gt;&amp;amp;-&lt;br /&gt;
&lt;br /&gt;
Syntax is advertised in the commented lines.&lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
*https://web.archive.org/web/20180718193807/https://blog.avirtualhome.com/adding-ssl-certificates-to-google-chrome-linux-ubuntu&lt;br /&gt;
*https://chromium.googlesource.com/chromium/src/+/master/docs/linux/cert_management.md&lt;br /&gt;
&lt;br /&gt;
===== Example 2: Using Firefox to isolate the certificate from TomatoUSB =====&lt;br /&gt;
&lt;br /&gt;
The {{Pkg|firefox}} browser can be used to save the certificate to a file for manual import into the database.&lt;br /&gt;
&lt;br /&gt;
Using firefox:&lt;br /&gt;
#Browse to the target URL.&lt;br /&gt;
#Upon seeing the &amp;quot;This Connection is Untrusted&amp;quot; warning screen, click: &#039;&#039;I understand the Risks &amp;gt; Add Exception...&#039;&#039;&lt;br /&gt;
#Click: &#039;&#039;View &amp;gt; Details &amp;gt; Export&#039;&#039; and save the certificate to a temporary location ({{ic|/tmp/easy.pem}} in this example).&lt;br /&gt;
&lt;br /&gt;
Now import the certificate for use in Chromium:&lt;br /&gt;
 $ certutil -d sql:$HOME/.pki/nssdb -A -t TC -n &amp;quot;easy&amp;quot; -i /tmp/easy.pem&lt;br /&gt;
&lt;br /&gt;
{{Note|Adjust the name to match that of the certificate. In the example above, &amp;quot;easy&amp;quot; is the name of the certificate.}}&lt;br /&gt;
&lt;br /&gt;
Reference:&lt;br /&gt;
*https://sahissam.blogspot.com/2012/06/new-ssl-certificates-for-tomatousb-and.html&lt;br /&gt;
&lt;br /&gt;
==== Canvas Fingerprinting ====&lt;br /&gt;
&lt;br /&gt;
Canvas fingerprinting is a technique that allows websites to identify users by detecting differences when rendering to an HTML5 canvas. This information can be made inaccessible by using the {{ic|--disable-reading-from-canvas}} flag.&lt;br /&gt;
&lt;br /&gt;
To confirm this is working run [https://panopticlick.eff.org this test] and make sure &amp;quot;hash of canvas fingerprint&amp;quot; is reported as undetermined in the full results.&lt;br /&gt;
&lt;br /&gt;
{{Note|1=&amp;lt;nowiki/&amp;gt;&lt;br /&gt;
* Some extensions require reading from canvas and may be broken by setting {{ic|--disable-reading-from-canvas}}.&lt;br /&gt;
* The YouTube player or Google Maps do not work properly without canvas reading (see [https://github.com/qutebrowser/qutebrowser/issues/5345 Qutebrowser issue 5345], [https://bbs.archlinux.org/viewtopic.php?id=255958 BBS#255958], [https://bbs.archlinux.org/viewtopic.php?id=276425 BBS#276425]).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Privacy extensions ====&lt;br /&gt;
&lt;br /&gt;
See [[Browser extensions#Privacy]].&lt;br /&gt;
&lt;br /&gt;
{{Tip|Installing too many extensions might take up much space in the toolbar. Those extensions which you would not interact with anyway can be hidden by right-clicking on the extension and choosing &#039;&#039;Hide in Chromium menu&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
==== Do Not Track ====&lt;br /&gt;
&lt;br /&gt;
To enable [[wikipedia:Do Not Track|Do Not Track]], visit {{ic|chrome://settings}}, scroll down to &#039;&#039;Advanced&#039;&#039; and under &#039;&#039;Privacy and security&#039;&#039;, check &#039;&#039;Send a &amp;quot;Do Not Track&amp;quot; request with your browsing traffic&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Force a password store ====&lt;br /&gt;
&lt;br /&gt;
Chromium uses a password store to store your passwords and the &#039;&#039;Chromium Safe Storage&#039;&#039; key, which is used to encrypt cookie values. [https://codereview.chromium.org/24734007]&lt;br /&gt;
&lt;br /&gt;
By default Chromium auto-detects which password store to use, which can lead to you apparently losing your passwords and cookies when switching to another desktop environment or window manager.&lt;br /&gt;
&lt;br /&gt;
You can force Chromium to use a specific password store by launching it with the {{ic|--password-store}} flag with one of following the values [https://chromium.googlesource.com/chromium/src/+/master/docs/linux/password_storage.md]:&lt;br /&gt;
&lt;br /&gt;
* {{ic|gnome-libsecret}}, uses [[Gnome Keyring]] via [https://gitlab.gnome.org/GNOME/libsecret libsecret].&lt;br /&gt;
* {{ic|kwallet5}}, uses [[KDE Wallet]] 5&lt;br /&gt;
* {{ic|kwallet6}}, uses [[KDE Wallet]] 6&lt;br /&gt;
* {{ic|basic}}, saves the passwords and the cookies&#039; encryption key as plain text in the file {{ic|Login Data}}&lt;br /&gt;
* {{ic|detect}}, the default auto-detect behavior&lt;br /&gt;
&lt;br /&gt;
For example, to force Chromium to use Gnome Keyring in another desktop or WM use {{ic|1=--password-store=gnome-libsecret}}, see [[#Making flags persistent]] for making it permanent.&lt;br /&gt;
&lt;br /&gt;
When using a password store of another desktop environment you probably also want to unlock it automatically. See [[GNOME/Keyring#Using the keyring]] and [[KDE Wallet#Unlock KDE Wallet automatically on login]].&lt;br /&gt;
&lt;br /&gt;
==== Enable hybrid post-quantum key exchange ====&lt;br /&gt;
&lt;br /&gt;
Chromium supports the hybrid post-quantum key exchange [https://www.ietf.org/archive/id/draft-tls-westerbaan-xyber768d00-02.html X25519Kyber768] for TLS 1.3 since version 155 [https://blog.chromium.org/2023/08/protecting-chrome-traffic-with-hybrid.html]. This feature is disabled by default, but can be enabled using the {{Ic|chrome://flags/#enable-tls13-kyber}} flag.&lt;br /&gt;
&lt;br /&gt;
=== Open any website as a native application ===&lt;br /&gt;
&lt;br /&gt;
You can open any website in a tabless window intended for [https://developer.chrome.com/blog/getting-started-pwa/ Progressive Web Apps]:&lt;br /&gt;
&lt;br /&gt;
 $ chromium --app=&#039;&#039;https://archlinux.org/&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You need to use a correct full URL. This could be combined with {{ic|--user-data-dir}} to split configs. Local html file is also used at native application with {{ic|1=--allow-file-access-from-files --app=file://*}}.&lt;br /&gt;
&lt;br /&gt;
=== Force offline ===&lt;br /&gt;
&lt;br /&gt;
You can force offline state by {{ic|1=--proxy-server=dummy}} for security when you use local html file from Chromium.&lt;br /&gt;
&lt;br /&gt;
=== Faster downloading ===&lt;br /&gt;
&lt;br /&gt;
Chromium has {{ic|--enable-parallel-downloading}} flag for parallel downloading without extensions.&lt;br /&gt;
&lt;br /&gt;
=== Re-enable Manifest V2 (MV2) extension compatibility ===&lt;br /&gt;
&lt;br /&gt;
{{Warning|&lt;br /&gt;
Manifest V2 extensions are deprecated for &#039;&#039;&#039;security reasons&#039;&#039;&#039; and Google recommends against using them.&lt;br /&gt;
&lt;br /&gt;
See [https://developer.chrome.com/docs/extensions/develop/migrate/what-is-mv3 What is Manifest V3] and [https://developer.chrome.com/docs/extensions/develop/migrate/mv2-deprecation-timeline Manifest V2 support timeline] for more information.}}&lt;br /&gt;
&lt;br /&gt;
As of {{Pkg|chromium}} version 148, manifest V2 support can be re-enabled to use popular extensions such as the original (non-Lite) [https://chromewebstore.google.com/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm uBlock Origin] extension.&lt;br /&gt;
&lt;br /&gt;
To do so, launch Chromium with the following flags:&lt;br /&gt;
&lt;br /&gt;
 $ chromium --enable-features=AllowLegacyMV2Extensions --disable-features=ExtensionsManifestV3Only,ExtensionManifestV2Unsupported,ExtensionManifestV2Disabled&lt;br /&gt;
&lt;br /&gt;
See also [[#Making flags persistent]].&lt;br /&gt;
&lt;br /&gt;
{{Note|The enterprise policy [https://chromeenterprise.google/intl/en_us/policies/#ExtensionManifestV2Availability ExtensionManifestV2Availability] was deprecated in Chromium version 139 and is no longer available.}}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Fonts ===&lt;br /&gt;
&lt;br /&gt;
{{Note|Chromium does not fully integrate with fontconfig/GTK/Pango/X/etc. due to its sandbox. For more information, see the [https://dev.chromium.org/developers/linux-technical-faq Linux Technical FAQ].}}&lt;br /&gt;
&lt;br /&gt;
==== Tab font size is too large ====&lt;br /&gt;
&lt;br /&gt;
Chromium will use the GTK settings as described in [[GTK#Configuration]]. When configured, Chromium will use the {{ic|gtk-font-name}} setting for tabs (which may mismatch window font size). To override these settings, use {{ic|1=--force-device-scale-factor=1.0}}.&lt;br /&gt;
&lt;br /&gt;
Since Chrome Refresh 2023 became default, GNOME users with Cantarell font may notice some characters (like lowercase g) cut off in the tab title. See the [https://issues.chromium.org/issues/40934082 issue on chromium.org].&lt;br /&gt;
&lt;br /&gt;
Until the issue resolved, a workaround is to replace Cantarell with another font using a configuration based on [[Font configuration#Set default or fallback fonts]], e.g.&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/fontconfig/conf.d/10-chromium-font.conf|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
&amp;lt;match target=&amp;quot;pattern&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;test name=&amp;quot;prgname&amp;quot; compare=&amp;quot;eq&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;chromium&amp;lt;/string&amp;gt;&lt;br /&gt;
    &amp;lt;/test&amp;gt;&lt;br /&gt;
    &amp;lt;test qual=&amp;quot;any&amp;quot; name=&amp;quot;family&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;string&amp;gt;Cantarell&amp;lt;/string&amp;gt;&lt;br /&gt;
    &amp;lt;/test&amp;gt;&lt;br /&gt;
    &amp;lt;edit name=&amp;quot;family&amp;quot; mode=&amp;quot;assign&amp;quot; binding=&amp;quot;strong&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;Ubuntu&amp;lt;/string&amp;gt;&lt;br /&gt;
    &amp;lt;/edit&amp;gt;&lt;br /&gt;
&amp;lt;/match&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
This configuration will apply only if process name {{ic|chromium}} matches. You can use {{ic|chrome}} for Google Chrome.&lt;br /&gt;
&lt;br /&gt;
=== WebGL ===&lt;br /&gt;
&lt;br /&gt;
There is the possibility that your graphics card has been blacklisted by Chromium. See [[#Force GPU acceleration]].&lt;br /&gt;
&lt;br /&gt;
If you are using Chromium with [[Bumblebee]], WebGL might crash due to GPU sandboxing. In this case, you can disable GPU sandboxing with {{ic|optirun chromium --disable-gpu-sandbox}}.&lt;br /&gt;
&lt;br /&gt;
Visit {{ic|chrome://gpu/}} for debugging information about WebGL support.&lt;br /&gt;
&lt;br /&gt;
Chromium can save incorrect data about your GPU in your user profile (e.g. if you use switch between an Nvidia card using Optimus and Intel, it will show the Nvidia card in {{ic|chrome://gpu}} even when you are not using it or primusrun/optirun). Running using a different user directory, e.g, {{ic|1=chromium --user-data-dir=$(mktemp -d)}} may solve this issue. For a persistent solution you can reset the GPU information by deleting {{ic|~/.config/chromium/Local\ State}}.&lt;br /&gt;
&lt;br /&gt;
=== Incorrect HiDPI rendering ===&lt;br /&gt;
&lt;br /&gt;
Chromium will automatically scale for a [[HiDPI]] display, however, this may cause an incorrectly rendered GUI.&lt;br /&gt;
&lt;br /&gt;
The flag {{ic|1=--force-device-scale-factor=1}} may be used to overrule the automatic scaling factor.&lt;br /&gt;
&lt;br /&gt;
=== Incorrect window size and mouse position on Wayland fractional scaling ===&lt;br /&gt;
&lt;br /&gt;
When [[#Native Wayland support|native Wayland support]] is enabled, Chromium will automatically scale based on the configured scale of each monitor.&lt;br /&gt;
&lt;br /&gt;
There is a longstanding bug in chromium, which affects electron apps as well, with scaling under wayland when the desktop scale is less than 100% on some compositors (e.g. KDE). Windows will shrink themselves on every interaction and mouse positioning is scaled by the desktop scale percentage. The flag {{ic|1=--disable-features=WaylandPerSurfaceScale}} can be used to disable this behavior.&lt;br /&gt;
&lt;br /&gt;
The flag {{ic|1=--disable-features=WaylandPerSurfaceScale}} was removed in Chromium v146, but the flag {{ic|1=--disable-features=WaylandFractionalScaleV1}} disables the broken behavior.&lt;br /&gt;
&lt;br /&gt;
=== Password prompt on every start with GNOME Keyring ===&lt;br /&gt;
&lt;br /&gt;
See [[GNOME/Keyring#Passwords are not remembered]].&lt;br /&gt;
&lt;br /&gt;
=== Everything is syncing except for password ===&lt;br /&gt;
&lt;br /&gt;
If synchronization is not working for password only (you can check it on {{ic|chrome://sync-internals/}}) delete profile login data:&lt;br /&gt;
&lt;br /&gt;
 $ rm ~/.config/chromium/Default/Login\ Data*&lt;br /&gt;
&lt;br /&gt;
See [https://support.google.com/chrome/thread/9947763?hl=en&amp;amp;msgid=23687608 Google Chrome Help forum] for details.&lt;br /&gt;
&lt;br /&gt;
=== Losing cookies and passwords when switching between desktop environments ===&lt;br /&gt;
&lt;br /&gt;
If you see the message {{ic|Failed to decrypt token for service AccountId-*}} in the terminal when you start Chromium, it might try to use the wrong password storage backend. This might happen when you switch between Desktop Environments.&lt;br /&gt;
&lt;br /&gt;
See [[#Force a password store]].&lt;br /&gt;
&lt;br /&gt;
=== Hang on startup when Google Sync enabled ===&lt;br /&gt;
&lt;br /&gt;
Try launching Chrome with {{ic|1=--password-store=basic}} or another appropriate password store.&lt;br /&gt;
&lt;br /&gt;
See [[#Force a password store]].&lt;br /&gt;
&lt;br /&gt;
=== Chromium asks to be set as the default browser every time it starts ===&lt;br /&gt;
&lt;br /&gt;
If you are using KDE and have once set Firefox as the default browser (by clicking the button inside Firefox), you might find Chromium asks to be set as the default browser every time it starts, even if you click the &amp;quot;set as default&amp;quot; button.&lt;br /&gt;
&lt;br /&gt;
Chromium checks for this status by running {{ic|xdg-settings check default-web-browser chromium.desktop}}. If the output is &amp;quot;no&amp;quot;, it is not considering itself to be the default browser. The script {{ic|xdg-settings}} checks for the following MIME associations and expect all of them to be {{ic|chromium.desktop}}:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
x-scheme-handler/http&lt;br /&gt;
x-scheme-handler/https&lt;br /&gt;
text/html}}&lt;br /&gt;
&lt;br /&gt;
To fix it, go to &#039;&#039;System settings &amp;gt; Applications &amp;gt; Default applications &amp;gt; Web browser&#039;&#039; and choose Chromium. Then, set the MIME association for {{ic|text/html}}:&lt;br /&gt;
&lt;br /&gt;
 $ xdg-mime default chromium.desktop text/html&lt;br /&gt;
&lt;br /&gt;
Finally, [[XDG MIME Applications#New MIME types|update the MIME database]]:&lt;br /&gt;
&lt;br /&gt;
 $ update-mime-database ~/.local/share/mime&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;This browser or app may not be secure&amp;quot; error logging in to Google ===&lt;br /&gt;
&lt;br /&gt;
As of 2020.04.20 if you run chromium with {{ic|1=--remote-debugging-port=9222}} flag for web development, you cannot log in to your Google account. Temporarily disable this flag to login and then you can enable it back.&lt;br /&gt;
&lt;br /&gt;
=== Chromium rendering at 60 FPS despite using a display with a higher refresh rate ===&lt;br /&gt;
&lt;br /&gt;
See [https://issues.chromium.org/issues/40761642 the general issue] which may contain some additional workarounds and [https://issues.chromium.org/issues/40725152 a sister issue about mixed refresh rates].&lt;br /&gt;
&lt;br /&gt;
==== Mixed refresh rates ====&lt;br /&gt;
&lt;br /&gt;
{{Tip|This issue is possibly not present on the Wayland backend, needs testing.}}&lt;br /&gt;
&lt;br /&gt;
When using displays with mixed refresh rates(for example 60Hz and 144Hz), Chromium might render for the lower Hz display.&lt;br /&gt;
&lt;br /&gt;
There is a suitable workaround for this issue, [[append]] the following flags to [[#Making flags persistent|persistent configuration]]:&lt;br /&gt;
&lt;br /&gt;
{{hc|1=~/.config/chromium-flags.conf|2=&lt;br /&gt;
--use-gl=egl&lt;br /&gt;
--ignore-gpu-blocklist&lt;br /&gt;
--enable-gpu-rasterization&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This should make Chromium run at 144 FPS when used on a 144Hz display, assuming your compositor is also refreshing at 144 FPS.  &lt;br /&gt;
Keep in mind it might be a little choppy due to {{Bug|67035}}, but it is way better than being stuck at 60 FPS.&lt;br /&gt;
&lt;br /&gt;
==== Running on the Wayland backend ====&lt;br /&gt;
&lt;br /&gt;
There seem to be Wayland compositor-specific problems that trigger this issue.  &lt;br /&gt;
Notably, Plasma 5 seems to only ever render on 60Hz no matter the setup, but Plasma 6(rc1, at the time of writing) makes Chromium work flawlessly on high refresh rates.&lt;br /&gt;
&lt;br /&gt;
A workaround may be to switch to the XWayland backend if all else fails.&lt;br /&gt;
&lt;br /&gt;
=== Chromium slow scroll speed ===&lt;br /&gt;
&lt;br /&gt;
Mouse whell scrolling in chromium and electron based applications may be too slow for daily usage. Here are some solutions.&lt;br /&gt;
&lt;br /&gt;
[[Libinput#Mouse wheel scrolling speed scaling]] injects {{ic|libinput_event_pointer_get_axis_value}} function in libinput and provides an interface to change scale factor. This is not an application level injection, so an addition script for application specific scale factor tuning is needed. Note that scroll on chromium&#039;s small height developer tools may be too fast when scale factor is big enough.&lt;br /&gt;
&lt;br /&gt;
[[IMWheel]] increases scroll distance by replaying X wheel button event for multiple times. However, chromium assumes the real scroll and the replayed ones as two events. There is a small but noticeable delay between them, so one mouse wheel scroll leads to twice page jumps. Also, touchpad scroll needs additional care.&lt;br /&gt;
&lt;br /&gt;
[https://chrome.google.com/webstore/detail/linux-scroll-speed-fix/mlboohjioameadaedfjcpemcaangkkbp Linux Scroll Speed Fix] and [https://chrome.google.com/webstore/detail/smoothscroll/nbokbjkabcmbfdlbddjidfmibcpneigj SmoothScroll] are two chromium extensions with support for scroll distance modification. Upon wheel scroll in a web page, the closest scrollable ancestor of current focused node will be found, then a scroll method with given pixel distance will be called on it, even if it has been scrolled to bottom. So once you scroll into a text editor or any scrollable element, you can never scroll out of it, except moving mouse. Also, extension based methods can not be used outside chromium.&lt;br /&gt;
&lt;br /&gt;
=== Videos load but do not play ===&lt;br /&gt;
&lt;br /&gt;
{{Out of date|The linked section states that Chromium is not affected.}}&lt;br /&gt;
&lt;br /&gt;
This may be a PulseAudio issue. See the suggested fix in [[PulseAudio/Troubleshooting#Browsers (firefox) load videos but do no play]].&lt;br /&gt;
&lt;br /&gt;
=== Passwords are not saved due to a corrupted database ===&lt;br /&gt;
&lt;br /&gt;
The stored password database can become corrupted and in need of getting rebuilt. Doing so will destroy all data therein/lose stored passwords.&lt;br /&gt;
&lt;br /&gt;
Launch chromium from a terminal and look for output like:&lt;br /&gt;
 [472531:472565:1207/055404.688559:ERROR:login_database.cc(1048)] Password decryption failed, encryption_result is 2&lt;br /&gt;
&lt;br /&gt;
Exit chromium and then delete these three database files: {{ic|~/.config/chromium/Default/Login Data*}}&lt;br /&gt;
&lt;br /&gt;
Launching chromium again should re-create them.&lt;br /&gt;
&lt;br /&gt;
=== Cursor is not correct on KDE Wayland ===&lt;br /&gt;
&lt;br /&gt;
See [[KDE#Plasma cursor sometimes shown incorrectly]].&lt;br /&gt;
&lt;br /&gt;
=== Chromium window is transparent under Wayland ===&lt;br /&gt;
&lt;br /&gt;
Due to a [https://issues.chromium.org/issues/329678163 bug], chromium 124 must be started with the explicit command line flag {{ic|1=--ozone-platform=wayland}}.&lt;br /&gt;
&lt;br /&gt;
=== Wayland hardware acceleration buffer handle is null errors ===&lt;br /&gt;
&lt;br /&gt;
Due to a [https://issues.chromium.org/issues/331796411 bug], you may see the below in your log when launching from terminal, especially with hardware acceleration enabled on Wayland:&lt;br /&gt;
&lt;br /&gt;
{{bc|[333310:333425:0919/121130.103852:ERROR:gpu_channel.cc(502)] Buffer Handle is null.&lt;br /&gt;
[333341:18:0919/121130.104000:ERROR:shared_image_interface_proxy.cc(134)] Buffer handle is null. Not creating a mailbox from it.&lt;br /&gt;
[333310:333425:0919/121130.137149:ERROR:gbm_pixmap_wayland.cc(82)] Cannot create bo with format{{=}} YUV_420_BIPLANAR and usage{{=}}SCANOUT_CPU_READ_WRITE&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Workaround for now is adding this flag:&lt;br /&gt;
{{hc|1=~/.config/chromium-flags.conf|2=&lt;br /&gt;
--disable-gpu-memory-buffer-video-frames&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== No audio available without sound server ===&lt;br /&gt;
&lt;br /&gt;
Chromium does not support [[Advanced Linux Sound Architecture#Addressing hardware directly]].&lt;br /&gt;
Set output devices {{ic|pcm.dmixer}} and {{ic|pcm.dsnooper}} as seen in the page and use {{ic|1=-alsa-output-device=pcm.dmixer -alsa-input-device=pcm.dsnooper}} flags.&lt;br /&gt;
&lt;br /&gt;
=== Gnome &amp;quot;Global Shortcuts&amp;quot; menu appears on startup ===&lt;br /&gt;
&lt;br /&gt;
Due to extensions which define global shortcuts (such as obsidian web clipper), the gnome &amp;quot;Global Shortcuts&amp;quot; appears at startup. This is described in https://github.com/brave/brave-browser/issues/44886 and can be fixed by adding this flag:&lt;br /&gt;
&lt;br /&gt;
{{hc|1=~/.config/chromium-flags.conf|2=&lt;br /&gt;
--disable-features=GlobalShortcutsPortal&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Compose key does not work: Typing special characters with keyboard not possible ===&lt;br /&gt;
&lt;br /&gt;
Due to a bug the &amp;quot;Compose&amp;quot; key does not work in recent versions of chromium. This becomes apparent when user tries to type in special characters such as `@` or umlauts anywhere in the browser. The special key combinations utilizing the compose key (for example `ALT GR`) work in all applications except chromium. This issue is most likely related to gtk and cannot be resolved by switching between Wayland and X11. It is described at https://issues.chromium.org/issues/327158031 and can be fixed by adding this flag:&lt;br /&gt;
&lt;br /&gt;
{{hc|1=~/.config/chromium-flags.conf|2=&lt;br /&gt;
--disable-gtk-ime &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Chromium does not fully maximize on Wayland===&lt;br /&gt;
You have to enable &#039;&#039;Use system title bar and borders&#039;&#039; via the &#039;&#039;chrome://settings/appearance&#039;&#039; menu.&lt;br /&gt;
&lt;br /&gt;
=== Chromium has no sound but sound output device is present ===&lt;br /&gt;
&lt;br /&gt;
For WirePlumber users, [[WirePlumber#Delete corrupt settings|resetting WirePlumber state]] may help.&lt;br /&gt;
&lt;br /&gt;
=== File picker does not open when trying to save or download ===&lt;br /&gt;
This is a problem with [[XDG Desktop Portal]], restarting the user unit may help.&lt;br /&gt;
&lt;br /&gt;
=== Forcing a specific GPU has no effect on Wayland ===&lt;br /&gt;
Sometimes, [[#Forcing specific GPU]] may not work on [[Wayland]], with an error message like so:&lt;br /&gt;
{{hc|head=$ chromium --render-node-override=&amp;quot;/dev/dri/by-path/pci-0000:01:00.0-render&amp;quot;|output=[46318:46318:0310/131714.847139:ERROR:ui/events/platform/wayland/wayland_event_watcher.cc:47] libwayland: [destroyed object]: error 7: importing the supplied dmabufs failed&lt;br /&gt;
&lt;br /&gt;
# The output below may or may not appear&lt;br /&gt;
[0310/133129.221806:ERROR:third_party/crashpad/crashpad/snapshot/elf/elf_dynamic_array_reader.h:64] tag not found&lt;br /&gt;
[0310/133129.222571:ERROR:third_party/crashpad/crashpad/util/process/process_memory_range.cc:75] read out of range}}&lt;br /&gt;
&lt;br /&gt;
As of March 10th 2026, the only workaround that works is disabling the unwanted GPU in the firmware (which is not ideal, and even impossible on some systems). It might be possible to achieve the same result by [[Kernel_module#Blacklisting|blacklisting the appropriate kernel modules]], but users might still find this approach undesirable.&lt;br /&gt;
&lt;br /&gt;
Another possibility would be to go back to [[Xorg]] or use [[Xwayland]] [https://issues.chromium.org/issues/40766635#comment19].&lt;br /&gt;
&lt;br /&gt;
More information can be read in [https://forum.vivaldi.net/topic/99688/vivaldi-crashes-at-startup-when-using-wayland], [https://bbs.archlinux.org/viewtopic.php?pid=2269237#p2269237] and [https://issues.chromium.org/issues/40766635].&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.chromium.org/Home/ Chromium homepage]&lt;br /&gt;
* [https://chromereleases.googleblog.com/ Google Chrome release notes]&lt;br /&gt;
* [https://chrome.google.com/webstore/ Chrome web store]&lt;br /&gt;
* [[Tmpfs]] - Tmpfs Filesystem in {{ic|/etc/fstab}}&lt;br /&gt;
* [https://docs.kernel.org/filesystems/tmpfs.html Official tmpfs kernel Documentation]&lt;br /&gt;
* [https://github.com/RKNF404/chromium-hardening-guide RKNF404&#039;s chromium-hardening-guide on GitHub]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Atrium&amp;diff=873697</id>
		<title>Atrium</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Atrium&amp;diff=873697"/>
		<updated>2026-05-12T15:47:55Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Starting */ reword to distinguish systemd unit and the display manager at hand&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Lowercase title}}&lt;br /&gt;
[[Category:Display managers]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|Display manager}}&lt;br /&gt;
{{Related|Wayland}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;atrium&#039;&#039;&#039; is a Wayland [[display manager]] with first-class [[Wikipedia:Multiseat configuration|multiseat]] support. In a multiseat setup, multiple users share a single machine, each with their own monitor, keyboard, and mouse and an independent login session. atrium handles each seat automatically: it discovers seats, presents a login screen, authenticates users via [[PAM]], and launches their Wayland compositor.&lt;br /&gt;
&lt;br /&gt;
{{Note|atrium supports Wayland sessions only. X11 sessions are not supported.}}&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
[[Install]] {{AUR|atrium}}.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
{{Note|The default configuration works for most single-seat and standard multiseat setups. This step can be skipped unless something does not work or you need to customise compositor selection.}}&lt;br /&gt;
&lt;br /&gt;
atrium reads two configuration files at startup:&lt;br /&gt;
&lt;br /&gt;
* {{ic|/etc/atrium.conf}} — daemon settings (compositor command, session policy, timeouts)&lt;br /&gt;
* {{ic|/etc/atrium-greeter.conf}} — greeter settings (font size, screen blanking timeout, passwordless users)&lt;br /&gt;
&lt;br /&gt;
Both files are installed with commented-out defaults. Refer to the inline comments for available options.&lt;br /&gt;
&lt;br /&gt;
atrium discovers available sessions from {{ic|/usr/share/wayland-sessions/}}. Any installed Wayland compositor that provides a {{ic|.desktop}} file there will appear on the login screen automatically.&lt;br /&gt;
&lt;br /&gt;
== Starting ==&lt;br /&gt;
&lt;br /&gt;
To start atrium, [[enable]] {{ic|atrium.service}} and restart.&lt;br /&gt;
&lt;br /&gt;
{{Note| &lt;br /&gt;
* Before enabling the [[systemd]] service, [[disable]] any other display manager.&lt;br /&gt;
* [[Starting]] it immediately will terminate any active graphical session.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Multiseat ==&lt;br /&gt;
&lt;br /&gt;
atrium has built-in multiseat support. Each seat requires its own GPU; atrium discovers seats via logind and launches an independent greeter on each one. Devices must be assigned to seats with {{ic|loginctl attach}}, but no additional configuration is needed.&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/kavau/atrium/blob/main/doc/multiseat-setup.md Multiseat Setup Guide] for a step-by-step device assignment guide.&lt;br /&gt;
&lt;br /&gt;
== Known limitations ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Limited hotplug&#039;&#039;&#039; — GPU or seat removal/addition at runtime is not yet fully handled. Restart atrium to recover (this ends active sessions).&lt;br /&gt;
* &#039;&#039;&#039;No SIGKILL escalation&#039;&#039;&#039; — compositors that ignore SIGTERM are waited on indefinitely.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/kavau/atrium GitHub repository]&lt;br /&gt;
* [https://github.com/kavau/atrium/releases Releases and release notes]&lt;br /&gt;
* [https://www.reddit.com/r/linux_multiseat/ r/linux_multiseat] — general Linux multiseat discussion&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Talk:PAM&amp;diff=873617</id>
		<title>Talk:PAM</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Talk:PAM&amp;diff=873617"/>
		<updated>2026-05-11T19:23:01Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Accuracy of PAM#Examples */ re&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Accuracy of PAM#Examples ==&lt;br /&gt;
The accuracy of [[PAM#Examples]] was discussed at [https://bbs.archlinux.org/viewtopic.php?id=245892 the forums]. I suggest to &lt;br /&gt;
# Mention that nullok inverts pam_unix.so default behavoiur of not allowing blank passwords.&lt;br /&gt;
# Remove the claim that&lt;br /&gt;
::: - the latter being what pam_permit.so is used for.&lt;br /&gt;
::And state that as is, the pam_permit.so line has no effect with this configuration due to the way pam treats an optional module. &lt;br /&gt;
02:05, 23 April 2019 (UTC)&lt;br /&gt;
&lt;br /&gt;
Edit: I tried to review this thread at 13 April 2024. My first difficulty was to see the content of the article back then. Was it as in [[Special:Diff/571854/cur]]? 13 April 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[User:Regid|Regid]] ([[User talk:Regid|talk]])&lt;br /&gt;
:Technically it&#039;s used as a fallback in case no other modules has contributed to the return code. According to manual {{ic|pam_unix(8)}}, {{ic|pam_unix}} can return {{ic|PAM_IGNORE}} which leaves {{ic|pam_permit}} the only one in this stack, hence {{ic|pam_permit}}&#039;s return code is used as the final result. This is a common practice to avoid being locked from the system accidentally.&lt;br /&gt;
:[[User:FrederickZh|FrederickZh]] ([[User talk:FrederickZh|talk]]) 20:07, 5 January 2021 (UTC)&lt;br /&gt;
&lt;br /&gt;
::Good point to discuss. The purpose of [[PAM#Examples]] was, as it says with reference to the warning, to illustrate how an single erroneous change (of switching required and optional) can havoc the stack. For that it referenced it default pambase, which was later updated in 08/2021.[https://github.com/archlinux/svntogit-packages/commit/2d5af94ae55a5c98837ce9631f331ad2aad32bb3] Explaining how and when nullok takes effect and when pam_permit applies, was not necessary to show the point (and both would have required deeper dive, yes). Since, the stack and login.defs have changed more; the example does not work anymore. A simple example following current system-auth (to follow the section) would be best, because we don&#039;t want users locking themselves out when they try it. Ideas how to update it?&lt;br /&gt;
::--[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 18:15, 26 May 2022 (UTC)&lt;br /&gt;
&lt;br /&gt;
::Revisiting, I added [https://wiki.archlinux.org/index.php?title=PAM&amp;amp;diff=803367&amp;amp;oldid=790245 the reference]. Perhaps another example would be to fiddle with pam_faillock.so to intentionally break that, but it would need a little more verbose.? --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 20:30, 15 March 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
::@Regid: Regarding your review of 13 April, the diff you link is complicated to overview, but the first example at [[PAM#Examples]] has the status you reviewed in your original comment + my above link addendum. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 22:50, 28 October 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
::No new ideas from my side for a suitable example. I&#039;ve now come to the conclusion, it&#039;s sufficient to remove the first example of [[PAM#Examples]] and use the existing second as one example, maybe plus another crosslink to [[Security]] for relevant PAM configuration. That is unless someone else has an idea prior. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 19:22, 11 May 2026 (UTC)&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Security&amp;diff=873616</id>
		<title>Security</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Security&amp;diff=873616"/>
		<updated>2026-05-11T19:16:16Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Disallow empty password */ typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Security]]&lt;br /&gt;
[[Category:File systems]]&lt;br /&gt;
[[Category:Networking]]&lt;br /&gt;
[[de:Sicherheit]]&lt;br /&gt;
[[es:Security]]&lt;br /&gt;
[[hu:Security]]&lt;br /&gt;
[[ja:セキュリティ]]&lt;br /&gt;
[[pt:Security]]&lt;br /&gt;
[[ru:Security]]&lt;br /&gt;
[[zh-hans:Security]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|Arch Security Team}}&lt;br /&gt;
{{Related|General recommendations}}&lt;br /&gt;
{{Related|Identity management}}&lt;br /&gt;
{{Related|Capabilities}}&lt;br /&gt;
{{Related|List of Applications/Security}}&lt;br /&gt;
{{Related|Arch package guidelines/Security}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
This article contains recommendations and best practices for [[Wikipedia:Hardening (computing)|hardening]] an Arch Linux system.&lt;br /&gt;
&lt;br /&gt;
== Concepts ==&lt;br /&gt;
&lt;br /&gt;
* It &#039;&#039;is&#039;&#039; possible to tighten security to the point where the system is unusable. Security and convenience must be balanced. The trick is to create a secure &#039;&#039;and&#039;&#039; useful system.&lt;br /&gt;
* The biggest threat is, and will always be, the user.&lt;br /&gt;
* The [[Wikipedia:Principle of least privilege|principle of least privilege]]: Each part of a system should only be able to access what is strictly required, and nothing more.&lt;br /&gt;
* Defense in depth: Security works better in independent layers. When one layer is breached, another should stop the attack.&lt;br /&gt;
* Be a little paranoid. And be suspicious. If anything sounds too good to be true, it probably is!&lt;br /&gt;
* You can never make a system 100% secure unless you unplug the machine from all networks, turn it off, lock it in a safe, smother it in concrete and never use it.&lt;br /&gt;
* Prepare for failure. Create a plan ahead of time to follow when your security is broken.&lt;br /&gt;
&lt;br /&gt;
== Passwords ==&lt;br /&gt;
&lt;br /&gt;
Passwords are key to a secure system. They secure your [[Users and groups|user accounts]], [[Data-at-rest encryption|encrypted filesystems]], and [[SSH keys|SSH]]/[[GPG]] keys. They are the main way a computer chooses to trust the person using it, so a big part of security is just about picking secure passwords and protecting them.&lt;br /&gt;
&lt;br /&gt;
=== Choosing secure passwords ===&lt;br /&gt;
&lt;br /&gt;
Passwords must be complex enough to not be easily guessed from e.g. personal information, or [[Wikipedia:Password cracking|cracked]] using methods like brute-force attacks. The tenets of strong passwords are based on &#039;&#039;length&#039;&#039; and &#039;&#039;randomness&#039;&#039;. In cryptography the quality of a password is often referred to as its [[Wikipedia:Password strength#Entropy as a measure of password strength|entropy]].&lt;br /&gt;
&lt;br /&gt;
Insecure passwords include those containing or those using as a base before substitution/variation:&lt;br /&gt;
&lt;br /&gt;
* Personally identifiable information (e.g., your dog&#039;s name, date of birth, area code, favorite video game)&lt;br /&gt;
* Simple character substitutions on words (e.g., {{ic|k1araj0hns0n}}), as modern dictionary attacks can easily work with these&lt;br /&gt;
* Root &amp;quot;words&amp;quot; or common strings followed or preceded by added numbers, symbols, or characters (e.g., {{ic|DG091101%}})&lt;br /&gt;
* Common phrases or short strings of common dictionary words (e.g. {{ic|photocopyhauntbranchexpose}}) including with character substitution (e.g. {{ic|Ph0toc0pyh4uN7br@nch3xp*se}}) (See Diceware below for when a combination of dictionary words can be secure)&lt;br /&gt;
* Any of the [[Wikipedia:List of the most common passwords|most common passwords]]&lt;br /&gt;
&lt;br /&gt;
The best choice for a password is something long (the longer, the better) and generated from a random source. It is important to use a long password. [https://www.theregister.com/2019/02/14/password_length Weak hash algorithms allow an 8-character password hash to be compromised in just a few hours.]&lt;br /&gt;
&lt;br /&gt;
Tools like {{Pkg|pwgen}} or {{AUR|apg}} can generate random passwords. However, these passwords can be difficult to memorize. One memorization technique (for ones often typed) is to generate a long password and memorize a minimally secure number of characters, temporarily writing down the full generated string. Over time, increase the number of characters typed - until the password is ingrained in muscle memory and need not be remembered. This technique is more difficult, but can provide confidence that a password will not turn up in wordlists or &amp;quot;intelligent&amp;quot; brute force attacks that combine words and substitute characters.&lt;br /&gt;
&lt;br /&gt;
Apart from password management, {{Pkg|keepassxc}} offers password/passphrase generation. It is possible to customize the generation in a GUI. Dictionary based passphrases are also supported.&lt;br /&gt;
&lt;br /&gt;
One technique for memorizing a password is to use a mnemonic phrase, where each word in the phrase reminds you of the next character in the password.&lt;br /&gt;
Take for instance “the girl is walking down the rainy street” could be translated to {{ic|t6!WdtR5}} or, less simply, {{ic|t&amp;amp;6!RrlW@dtR,57}}.&lt;br /&gt;
This approach could make it easier to remember a password, but note that the various letters have very different probabilities of being found at the start of words ([[Wikipedia:Letter frequency#Relative frequencies of the first letters of a word in the English language|Wikipedia:Letter frequency]]).&lt;br /&gt;
&lt;br /&gt;
Another effective technique can be to write randomly generated passwords down and store them in a &#039;&#039;safe&#039;&#039; place, such as in a wallet, purse, or document safe. Most people do a generally good job of protecting their physical valuables from attack, and it is easier for most people to understand physical security best practices compared to digital security practices.&lt;br /&gt;
&lt;br /&gt;
It is also very effective to combine the mnemonic and random technique by saving long randomly generated passwords with a [[password manager]], which will be in turn accessed with a memorable &amp;quot;master password&amp;quot;/primary password that must be used only for that purpose. The master password must be memorized and never saved. This requires the password manager to be installed on a system to easily access the password (which could be seen as an inconvenience or a security feature, depending on the situation). Some password managers also have smartphone apps which can be used to display passwords for manual entry on systems without that password manager installed (if that is a common use case, you could still use easily typeable but secure passwords for each service instead of completely random ones, see below). Note that a password manager introduces a single point of failure if you ever forget the master password.&lt;br /&gt;
Some password managers compute the contained passwords based on the master password and the service name where you want to log in instead of encrypting them, making it possible to use it on a new system without syncing any data.&lt;br /&gt;
&lt;br /&gt;
It can be effective to use a memorable long series of unrelated words as a password. The theory is that if a sufficiently long phrase is used, the gained entropy from the password&#039;s length can counter the lost entropy from the use of dictionary words. This [https://xkcd.com/936/ xkcd comic] demonstrates the entropy tradeoff of this method, taking into account the limited set of possible words for each word in the passphrase. If the set of words you choose from is large (multiple thousand words) and you choose 5-7 or even more random words from it, this method provides great entropy, even assuming the attacker knows the set of possible words chosen from and the number of words chosen. The number of possible passphrases after settling on a set of words and number of words is: (number of words in the set of words to select from) to the power of (the number of words chosen for the passphrase). See e.g. [https://www.rempe.us/diceware/ Diceware] for more.&lt;br /&gt;
&lt;br /&gt;
See [https://www.iusmentis.com/security/passphrasefaq/ The passphrase FAQ] or [[Wikipedia:Password strength]] for some additional background.&lt;br /&gt;
&lt;br /&gt;
=== Maintaining passwords ===&lt;br /&gt;
&lt;br /&gt;
Once you pick a strong password, be sure to keep it safe. Watch out for [[Wikipedia:Keylogger|keyloggers]] (software and hardware), screen loggers, [[Wikipedia:Social engineering (security)|social engineering]], [[Wikipedia:Shoulder surfing (computer security)|shoulder surfing]], and avoid reusing passwords so insecure servers cannot leak more information than necessary. [[List of applications/Security#Password managers|Password managers]] can help manage large numbers of complex passwords: if you are copy-pasting the stored passwords from the manager to the applications that need them, make sure to clear the copy buffer every time, and ensure they are not saved in any kind of log (e.g. do not paste them in plain terminal commands, which would store them in files like {{ic|.bash_history}}). Note that password managers that are implemented as browser extensions may be vulnerable to [https://www.spookjs.com side channel attacks]. These can be mitigated by using password managers that run as separate applications.&lt;br /&gt;
&lt;br /&gt;
As a rule, do not pick insecure passwords just because secure ones are harder to remember. Passwords are a balancing act. It is better to have an encrypted database of secure passwords, guarded behind a key and one strong master password, than it is to have many similar weak passwords. Writing passwords down is perhaps equally effective [https://www.schneier.com/blog/archives/2005/06/write_down_your.html], avoiding potential vulnerabilities in software solutions while requiring physical security.&lt;br /&gt;
&lt;br /&gt;
Another aspect of the strength of the passphrase is that it must not be easily recoverable from other places.&lt;br /&gt;
&lt;br /&gt;
If you use the same passphrase for disk encryption as you use for your login password (useful e.g. to auto-mount the encrypted partition or folder on login), make sure that {{ic|/etc/shadow}} ends up on an encrypted partition or/and uses a strong key derivation function (i.e. yescrypt/argon2 or sha512 with PBKDF2, but not md5 or low iterations in PBKDF2) for the stored password hash (see [[SHA password hashes]] for more information).&lt;br /&gt;
&lt;br /&gt;
{{Tip|In 2023 Arch Linux switched the [https://archlinux.org/news/changes-to-default-password-hashing-algorithm-and-umask-settings/ default hashing] algorithm to yescrypt. If you have not customized the default, executing a password change with {{ic|passwd}} is necessary (and sufficient) to apply the new default.}}&lt;br /&gt;
&lt;br /&gt;
If you are backing up your password database, make sure that each copy is not stored behind any other passphrase which in turn is stored in it, e.g. an encrypted drive or an authenticated remote storage service, or you will not be able to access it in case of need; a useful trick is to protect the drives or accounts where the database is backed up using a simple cryptographic hash of the master password. Maintain a list of all the backup locations: if one day you fear that the master passphrase has been compromised you will have to change it immediately on all the database backups and the locations protected with keys derived from the master password.&lt;br /&gt;
&lt;br /&gt;
Version-controlling the database in a secure way can be very complicated: if you choose to do it, you must have a way to update the master password of all the database versions. It may not always be immediately clear when the master password is leaked: to reduce the risk of somebody else discovering your password before you realize that it leaked, you may choose to change it on a periodical basis. If you fear that you have lost control over a copy of the database, you will need to change all the passwords contained in it within the time that it may take to brute-force the master password, according to its entropy.&lt;br /&gt;
&lt;br /&gt;
=== Password hashes ===&lt;br /&gt;
&lt;br /&gt;
A hash is a one-way function, i.e. it is designed to make it impossible to deduct the input without computing the hash function with it (example: MD5, SHA).&lt;br /&gt;
&lt;br /&gt;
A password-hash function is designed to make deducting a user-input (password) impossible without computing the hash function with it (example: bcrypt). A [[Wikipedia:Key derivation function|key derivation function]] (KDF; examples: yescrypt, scrypt, PBKDF2) is a cryptographic algorithm designed to derive secret keys (e.g. an AES key, a password hash) from an input (a master key, a password). Hence, a KDF can serve multiple applications, including those of a password-hash function.&lt;br /&gt;
&lt;br /&gt;
By default, Arch stores the hashed user passwords in the root-only-readable {{ic|/etc/shadow}} file, separated from the other user parameters stored in the world-readable {{ic|/etc/passwd}} file, see [[Users and groups#User database]]. See also [[#Restricting root]].&lt;br /&gt;
&lt;br /&gt;
Passwords are set with the &#039;&#039;&#039;passwd&#039;&#039;&#039; command, which [[Wikipedia:Key stretching|stretches]] them with the system&#039;s crypt function and then saves them in {{ic|/etc/shadow}}. The passwords are also [[Wikipedia:Salt (cryptography)|salted]] in order to defend them against [[Wikipedia:Rainbow table|rainbow table]] attacks. See also [https://www.slashroot.in/how-are-passwords-stored-linux-understanding-hashing-shadow-utils How are passwords stored in Linux (Understanding hashing with shadow utils)].&lt;br /&gt;
&lt;br /&gt;
Since password hashes follow a defined format, the method and parameter can be configured for subsequent new invocations of the &#039;&#039;passwd&#039;&#039; command. Hence, the individual hashes stored in the {{ic|/etc/shadow}} file can be a heterogeneous mix of the hash functions supported by the system.&lt;br /&gt;
&lt;br /&gt;
See {{man|5|crypt}} for more information on the format, hashing methods and parameters.&lt;br /&gt;
&lt;br /&gt;
The {{ic|/etc/login.defs}} file configures the [https://archlinux.org/news/changes-to-default-password-hashing-algorithm-and-umask-settings/ default password hashing] method {{ic|ENCRYPT_METHOD YESCRYPT}} and its parameter {{ic|YESCRYPT_COST_FACTOR}}.&lt;br /&gt;
&lt;br /&gt;
For example, an increment of the default {{ic|YESCRYPT_COST_FACTOR}} parameter will lead to a logarithmic increase of the compute time required to deduce the hash from a password. This applies, likewise, to a third-party trying to obtain the password secret, and the system to authenticate a user log-in.&lt;br /&gt;
&lt;br /&gt;
In contrast, the compute time for the SHA-512 hash function is configured by a parameter with a linear influence. See [[SHA password hashes]] for information on the previous Arch default. Note the yescrypt algorithm internally uses SHA-256, HMAC and PBKDF2 to compute its password-hash. The main reason is to combine positive attributes of these widely used and tested functions for an enhanced resistance to attacks. For example, the usability of SHA for various purposes has resulted in hardware support for the function, i.e. the performance to compute a pure SHA hash has accelerated considerably, making its application as a password-hash function more and more derelict.&lt;br /&gt;
&lt;br /&gt;
=== Disallow empty passwords ===&lt;br /&gt;
&lt;br /&gt;
{{Expansion|The [https://github.com/V4bel/dirtyfrag dirtyfrag] kernel vulnerabilities mwnipulated {{ic|/etc/shadow}} and relied on the regularly used {{ic|pam_unis}} option {{ic|nullok}} in {{ic|/etc/pam.d/system-auth}}. Removing this default, thereby disallowing empty passwords, can be an option to increase security. Instructions should be accompanied by commands how to check for user accounts with unset passwords first.}}&lt;br /&gt;
&lt;br /&gt;
=== Enforcing strong passwords with pam_pwquality ===&lt;br /&gt;
&lt;br /&gt;
PAM stands for the Pluggable Authentication Modules. &#039;&#039;pam_pwquality&#039;&#039; provides protection against [[Wikipedia:Dictionary attack|Dictionary attacks]] and helps configure a password policy that can be enforced throughout the system. It is based on &#039;&#039;pam_cracklib&#039;&#039;, so it is backwards compatible with its options.&lt;br /&gt;
&lt;br /&gt;
[[Install]] the {{Pkg|libpwquality}} package.&lt;br /&gt;
&lt;br /&gt;
{{Warning|The &#039;&#039;root&#039;&#039; account is not affected by this policy by default.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* You can use the &#039;&#039;root&#039;&#039; account to set a password for a user that bypasses the desired/configured policy. This is useful when setting temporary passwords.&lt;br /&gt;
* Current security guidelines around passwords, e.g. from NIST, but also from others, do not recommend enforcing special characters, since they often only lead to predictable alterations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
If for example you want to enforce this policy:&lt;br /&gt;
&lt;br /&gt;
* prompt 2 times for password in case of an error (retry option)&lt;br /&gt;
* 10 characters minimum length (minlen option)&lt;br /&gt;
* at least 6 characters should be different from old password when entering a new one (difok option)&lt;br /&gt;
* at least 1 digit (dcredit option)&lt;br /&gt;
* at least 1 uppercase (ucredit option)&lt;br /&gt;
* at least 1 lowercase (lcredit option)&lt;br /&gt;
* at least 1 other character (ocredit option)&lt;br /&gt;
* cannot contain the words &amp;quot;myservice&amp;quot; and &amp;quot;mydomain&amp;quot;&lt;br /&gt;
* enforce the policy for root&lt;br /&gt;
&lt;br /&gt;
Edit the {{ic|/etc/pam.d/passwd}} file to read as:&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
#%PAM-1.0&lt;br /&gt;
password required pam_pwquality.so retry=2 minlen=10 difok=6 dcredit=-1 ucredit=-1 ocredit=-1 lcredit=-1 [badwords=myservice mydomain] enforce_for_root&lt;br /&gt;
password required pam_unix.so use_authtok yescrypt shadow&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The {{ic|password required pam_unix.so use_authtok}} instructs the &#039;&#039;pam_unix&#039;&#039; module to not prompt for a password but rather to use the one provided by &#039;&#039;pam_pwquality&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
You can refer to the {{man|8|pam_pwquality}} and {{man|8|pam_unix}} man pages for more information.&lt;br /&gt;
&lt;br /&gt;
== CPU ==&lt;br /&gt;
&lt;br /&gt;
=== Microcode ===&lt;br /&gt;
&lt;br /&gt;
See [[microcode]] for information on how to install important security updates for your CPU&#039;s microcode.&lt;br /&gt;
&lt;br /&gt;
=== Hardware vulnerabilities ===&lt;br /&gt;
&lt;br /&gt;
Some CPUs contain hardware vulnerabilities. See the [https://docs.kernel.org/admin-guide/hw-vuln/ kernel documentation on hardware vulnerabilities] for a list of these vulnerabilities, as well as mitigation selection guides to help customize the kernel to mitigate these vulnerabilities for specific usage scenarios.&lt;br /&gt;
&lt;br /&gt;
To check if you are affected by a known vulnerability, run the following:&lt;br /&gt;
&lt;br /&gt;
 $ grep -r . /sys/devices/system/cpu/vulnerabilities/&lt;br /&gt;
&lt;br /&gt;
In most cases, updating the kernel and microcode will mitigate vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
==== Simultaneous multithreading (hyper-threading) ====&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:Simultaneous multithreading|Simultaneous multithreading]] (SMT), also called hyper-threading on Intel CPUs, is a hardware feature that may be a source of [https://docs.kernel.org/admin-guide/hw-vuln/l1tf.html L1 Terminal Fault] and [https://docs.kernel.org/admin-guide/hw-vuln/mds.html Microarchitectural Data Sampling] vulnerabilities. The Linux kernel and microcode updates contain mitigations for known vulnerabilities, but [https://docs.kernel.org/admin-guide/hw-vuln/l1tf.html#virtualization-with-untrusted-guests disabling SMT may still be required on certain CPUs if untrusted virtualization guests are present].&lt;br /&gt;
&lt;br /&gt;
{{Note|Disabling SMT is something mostly hypervisors benefit from.[https://security.stackexchange.com/questions/219753/sacrificing-30-of-my-cpu-performance-by-disabling-hyper-threading-to-fully-mi/219759#219759] On an ordinary system it has very little to no security benefits.}}&lt;br /&gt;
&lt;br /&gt;
SMT can often be disabled in your system&#039;s firmware. Consult your motherboard or system documentation for more information. You can also disable SMT in the kernel by adding the following [[kernel parameter]]:&lt;br /&gt;
&lt;br /&gt;
 mitigations=auto,nosmt&lt;br /&gt;
&lt;br /&gt;
== Memory ==&lt;br /&gt;
&lt;br /&gt;
=== Hardened malloc ===&lt;br /&gt;
&lt;br /&gt;
{{AUR|hardened_malloc}} is a hardened replacement for [[Wikipedia:GNU C Library|glibc]]&#039;s malloc(). The project was originally developed for integration into Android&#039;s [[Wikipedia:Bionic (software)|Bionic]] and [[Wikipedia:musl|musl]] by Daniel Micay, of [[Wikipedia:GrapheneOS|GrapheneOS]], but he has also built in support for standard Linux distributions on the x86_64 architecture.&lt;br /&gt;
&lt;br /&gt;
== Storage ==&lt;br /&gt;
&lt;br /&gt;
=== Data-at-rest encryption ===&lt;br /&gt;
&lt;br /&gt;
[[Data-at-rest encryption]], preferably full-disk encryption with a [[#Passwords|strong passphrase]], is the only way to guard data against physical recovery. This provides data confidentiality when the computer is turned off or the disks in question are unmounted.&lt;br /&gt;
&lt;br /&gt;
Once the computer is powered on and the drive is mounted, however, its data becomes just as vulnerable as an unencrypted drive. It is therefore best practice to unmount data partitions as soon as they are no longer needed.&lt;br /&gt;
&lt;br /&gt;
You may also [[Trusted Platform Module#LUKS encryption|encrypt a drive with the key stored in a TPM]], although it has had [https://tpm.fail vulnerabilites in the past] and the key can be extracted by a [https://pulsesecurity.co.nz/articles/TPM-sniffing bus sniffing attack].&lt;br /&gt;
&lt;br /&gt;
Certain programs, like [[dm-crypt]], allow the user to encrypt a loop file as a virtual volume. This is a reasonable alternative to full-disk encryption when only certain parts of the system need to be secure.&lt;br /&gt;
&lt;br /&gt;
While the block-device or filesystem-based encryption types compared in the [[data-at-rest encryption]] article are useful at protecting data on physical media, most can not be used to protect data on a remote system that you can not control (such as [[Data-at-rest encryption#Cloud-storage optimized|cloud storage]]). In some cases, individual file encryption will be useful.&lt;br /&gt;
&lt;br /&gt;
These are some methods to encrypt files:&lt;br /&gt;
&lt;br /&gt;
* Some [[Archiving and compression|archiving and compressing]] tools also provide basic encryption. Some examples are [[7-Zip]] ({{ic|-p}} flag), {{Pkg|zip}} ({{ic|-e}} flag). The encryption should only be relied on particular care, because the tools may use custom algorithms for cross-platform compatibility.[https://math.ucr.edu/~mike/zipattacks.pdf]&lt;br /&gt;
* [[GnuPG]] can be used to [[GnuPG#Encrypt and decrypt|encrypt files]].&lt;br /&gt;
* {{Pkg|age}} is a simple and easy to use file encryption tool. It also supports multiple recipients and encryption using SSH keys, which is useful for secure file sharing.&lt;br /&gt;
&lt;br /&gt;
=== File systems ===&lt;br /&gt;
&lt;br /&gt;
The kernel now prevents security issues related to hardlinks and symlinks if the {{ic|fs.protected_hardlinks}} and {{ic|fs.protected_symlinks}} sysctl switches are enabled, so there is no longer a major security benefit from separating out world-writable directories.&lt;br /&gt;
&lt;br /&gt;
File systems containing world-writable directories can still be kept separate as a coarse way of limiting the damage from disk space exhaustion. However, filling {{ic|/var}} or {{ic|/tmp}} is enough to take down services. More flexible mechanisms for dealing with this concern exist (like [[Disk quota|quotas]]), and some [[file systems]] include related features themselves (Btrfs has quotas on subvolumes).&lt;br /&gt;
&lt;br /&gt;
==== Mount options ====&lt;br /&gt;
&lt;br /&gt;
Following the principle of least privilege, file systems should be mounted with the most restrictive mount options possible (without losing functionality).&lt;br /&gt;
&lt;br /&gt;
Relevant mount options are:&lt;br /&gt;
&lt;br /&gt;
* {{ic|nodev}}: Do not interpret character or block special devices on the file system.&lt;br /&gt;
* {{ic|nosuid}}: Do not allow set-user-identifier or set-group-identifier bits to take effect.&lt;br /&gt;
* {{ic|noexec}}: Do not allow direct execution of any binaries on the mounted file system.&lt;br /&gt;
** Setting {{ic|noexec}} on {{ic|/home}} disallows executable scripts and breaks [[Wine]], [[Steam]], PyCharm, [[.NET]], etc.&lt;br /&gt;
*** Wine does not need the {{ic|exec}} flag for opening Windows binaries. It is only needed when Wine itself is installed in {{ic|/home}}.&lt;br /&gt;
*** To keep [[Steam]] working you can mount {{ic|/home/user/.local/share/Steam}} as {{ic|exec}} in [[fstab]] by adding the following: {{bc|/home/user/.local/share/Steam  /home/user/.local/share/Steam  none defaults,bind,user,exec,nofail  0  0}}&lt;br /&gt;
** Some packages (building {{Pkg|nvidia-open-dkms}} for example) may require {{ic|exec}} on {{ic|/var}}.&lt;br /&gt;
&lt;br /&gt;
File systems used for data should always be mounted with {{ic|nodev}}, {{ic|nosuid}} and {{ic|noexec}}.&lt;br /&gt;
&lt;br /&gt;
Potential file system mounts to consider:&lt;br /&gt;
&lt;br /&gt;
* {{ic|/var}}&lt;br /&gt;
* {{ic|/home}}&lt;br /&gt;
* {{ic|/dev/shm}}&lt;br /&gt;
* {{ic|/tmp}}&lt;br /&gt;
* {{ic|/boot}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|When using [[systemd#GPT partition automounting|GPT partition automounting]], the ESP and XBOOTLDR partitions are [https://github.com/systemd/systemd-stable/commit/49804cfb71d3a79f433096e4cfb5616980171336 always hardened] with {{ic|noexec,nosuid,nodev}}.}}&lt;br /&gt;
&lt;br /&gt;
==== Snapshots ====&lt;br /&gt;
&lt;br /&gt;
When utilizing file system snapshots, e.g. with [[Btrfs]], [[LVM]], or [[ZFS]], it is essential to be aware that snapshots may retain sensitive information that users expect to be deleted. This is especially true when automatic snapshotting tools like [[Snapper]] are configured, as they can capture snapshots at regular intervals or in response to system events. Here are some examples of how sensitive information in {{ic|/home/}} can persist within snapshots:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Deleted files and directories&#039;&#039;: Even though files or directories are deleted from the file system, they may still exist within older snapshots. This is expected most of the time, but consider whether files and directories such as {{ic|.local/share/Trash/}}, {{ic|.history}}, etc. should be retained.&lt;br /&gt;
* &#039;&#039;Temporary files and cache&#039;&#039;: Temporary files and cached data generated by applications may be included in snapshots. For example, files kept in encrypted directories might generate thumbnails ({{ic|.cache/thumbnails}}) or work copies when opened, which might in turn be included in snapshots. The same applies e.g. to browsing history ({{ic|.mozilla/}}, {{ic|.config/chromium/}}, etc.), which could have been included in a snapshot before being purged.&lt;br /&gt;
&lt;br /&gt;
If this is supported, consider excluding such directories from snapshots altogether. For example, if using [[Btrfs]], you can create subvolumes for example {{ic|.cache/}}, {{ic|.config/}}, {{ic|.local/}}, {{ic|.var/}} or any other directory according to your use-case.&lt;br /&gt;
&lt;br /&gt;
{{Note|Moving {{ic|.local/share/Trash}} to a separate subvolume might break the trash feature in some cases, e.g. with [[GNOME/Files]].}}&lt;br /&gt;
&lt;br /&gt;
=== File access permissions ===&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|{{ic|chmod go-r}} does not &amp;quot;take away all permissions&amp;quot;, it only removes the read permission.}}&lt;br /&gt;
&lt;br /&gt;
The default [[file permissions]] allow read access to almost everything and changing the permissions can hide valuable information from an attacker who gains access to a non-root account such as the {{ic|http}} or {{ic|nobody}} users. You can use [[chmod]] to take away all permissions from the group and others:&lt;br /&gt;
&lt;br /&gt;
 # chmod go-r &#039;&#039;path_to_hide&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{Warning|Do not apply this broadly. Try this for one config at a time, ensuring that it is worth hiding, and that it will not break program functionality. You may need to remove the {{ic|g}} from the command (or re-add the permission with {{ic|chmod g+r &#039;&#039;path&#039;&#039;}} if already ran) if the group is relied on.}}&lt;br /&gt;
&lt;br /&gt;
Some paths to consider are:&lt;br /&gt;
&lt;br /&gt;
* {{ic|/boot}}: The [[Partitioning#/boot|boot directory]], which may include traditional [[vmlinuz]] and [[initramfs]] images, or a [[Unified kernel image]]. Note that safe permissions are used by default when using [[systemd#GPT partition automounting]].&lt;br /&gt;
* {{ic|/etc/nftables.conf}}: The [[nftables]] configuration, applicable to {{Pkg|nftables}} and {{Pkg|iptables}}.&lt;br /&gt;
* {{ic|/etc/iptables}}: The legacy [[iptables]] configuration, applicable to {{Pkg|iptables-legacy}}.&lt;br /&gt;
&lt;br /&gt;
The default [[umask]] {{ic|0022}} can be changed to improve security for newly created files. The [https://apps.nsa.gov/iaarchive/library/ia-guidance/security-configuration/operating-systems/guide-to-the-secure-configuration-of-red-hat-enterprise.cfm NSA RHEL5 Security Guide] suggests a umask of {{ic|0077}} for maximum security, which makes new files not readable by users other than the owner. To change this, see [[Umask#Set the mask value]]. If you use [[sudo]], consider configuring it to use the [[Sudo#Permissive umask|default root umask]].&lt;br /&gt;
&lt;br /&gt;
=== SUID and SGID files ===&lt;br /&gt;
&lt;br /&gt;
It is important to be aware of any files with the [[Wikipedia:Setuid|Setuid]] or Setgid bit. Examples of relevant files with the SUID bit set:&lt;br /&gt;
&lt;br /&gt;
* [[PAM|unix_chkpwd]]&lt;br /&gt;
* chage, expiry, gpasswd, groupmems, [[passwd]], sg ({{Pkg|shadow}})&lt;br /&gt;
* [[FUSE|fusermount3]], fusermount2&lt;br /&gt;
* [[polkit|pkexec]]&lt;br /&gt;
* [[OpenSSH|ssh-keysign]]&lt;br /&gt;
* chfn, chsh, mount, newgrp, umount, wall, write ({{Pkg|util-linux}})&lt;br /&gt;
* [[sudo]], {{Pkg|sudo-rs}}, [[doas]], [[su]], su-rs, [[Kerberos|ksu]]&lt;br /&gt;
* [[firejail]]&lt;br /&gt;
* [[Dbus|dbus-daemon-launch-helper]]&lt;br /&gt;
* [[Chromium|chromium-sandbox]]&lt;br /&gt;
* [[Xorg|Xorg.wrap]]&lt;br /&gt;
&lt;br /&gt;
The prominent risks of such executable files include privilege escalation vulnerabilities, see e.g [[Wikipedia:Setuid#Security impact]].[https://www.cvedetails.com/vulnerability-list/vendor_id-16224/product_id-36412/Calibre-ebook-Calibre.html][https://www.cvedetails.com/product/32625/Sudo-Project-Sudo.html?vendor_id=15714][https://www.cvedetails.com/vulnerability-list/vendor_id-16191/Firejail-Project.html]&lt;br /&gt;
&lt;br /&gt;
Files with the SUID bit set and not owned by root, or files with the SGID bit set &#039;&#039;typically&#039;&#039; have less potential impact but can theoretically still do decent damage if vulnerable. It is usually possible to avoid using SUID or SGID by assigning [[Capabilities]] instead.&lt;br /&gt;
&lt;br /&gt;
{{Tip|It is vital to be vigilant in keeping packages which provide SUID/SGID executables up to date in order to prevent having a vulnerable system.}}&lt;br /&gt;
&lt;br /&gt;
To search for files with either the SUID or SGID bit:&lt;br /&gt;
&lt;br /&gt;
 $ find / -perm &amp;quot;/u=s,g=s&amp;quot; -type f 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
=== Backups ===&lt;br /&gt;
&lt;br /&gt;
{{Merge|System backup|There is a dedicated page for system backups.}}&lt;br /&gt;
&lt;br /&gt;
Regularly create backups of important data. Regularly test the integrity of the backups. Regularly test that the backups can be restored.&lt;br /&gt;
&lt;br /&gt;
Make sure that at least one copy of the data is stored offline, i.e. not connected to the system under threat in any way. [[Wikipedia:Ransomware|Ransomware]] and other destructive attacks may also attack any connected backup systems.&lt;br /&gt;
&lt;br /&gt;
=== SATA SSD frozen mode ===&lt;br /&gt;
&lt;br /&gt;
See [[Solid state drive#Setting the SATA SSD state to frozen mode after waking up from sleep]].&lt;br /&gt;
&lt;br /&gt;
== User setup ==&lt;br /&gt;
&lt;br /&gt;
=== Do not use the root account for daily use ===&lt;br /&gt;
&lt;br /&gt;
Following the principle of least privilege, do not use the root user for daily use. Create a non-privileged user account for each person using the system. See [[List of applications/Security#Privilege elevation]] for ways of temporarily gaining privileged access.&lt;br /&gt;
&lt;br /&gt;
=== Enforce a delay after a failed login attempt ===&lt;br /&gt;
&lt;br /&gt;
Add the following line to {{ic|/etc/pam.d/system-login}} to add a delay of at least 4 seconds between failed login attempts:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/pam.d/system-login|2=&lt;br /&gt;
auth optional pam_faildelay.so delay=4000000&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|This line needs to be the first line in the file.}}&lt;br /&gt;
&lt;br /&gt;
{{ic|4000000}} is the time in microseconds to delay.&lt;br /&gt;
&lt;br /&gt;
Other PAM modules besides {{ic|pam_faildelay}} can also suggest such a delay; if multiple modules do so, PAM will use the longest one.&lt;br /&gt;
&lt;br /&gt;
In particular, both {{ic|pam_unix}} and {{ic|pam_faillock}} set a minimum delay of 2 seconds by default.&lt;br /&gt;
In order to completely remove this delay, you need to add the {{ic|nodelay}} parameter to any {{ic|auth}} lines of these modules, for example&lt;br /&gt;
{{hc|/etc/pam.d/system-auth|2=&lt;br /&gt;
auth       [success{{=}}1 default{{=}}bad]     pam_unix.so          try_first_pass nullok nodelay&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Lock out user after three failed login attempts ===&lt;br /&gt;
&lt;br /&gt;
Since {{Pkg|pambase}} 20200721.1-2, {{ic|pam_faillock.so}} is enabled by default to lock out users for 10 minutes after 3 failed login attempts in a 15 minute period (see {{Bug|67644}}). The lockout only applies to password authentication (e.g. login and &#039;&#039;sudo&#039;&#039;), public key authentication over SSH is still accepted. To prevent complete denial-of-service, this lockout is disabled for the root user by default.&lt;br /&gt;
&lt;br /&gt;
To unlock a user, do:&lt;br /&gt;
&lt;br /&gt;
 $ faillock --user &#039;&#039;username&#039;&#039; --reset&lt;br /&gt;
&lt;br /&gt;
By default, the lock mechanism is a file per-user located at {{ic|/run/faillock/}}. Deleting or emptying the file unlocks that user—the directory is owned by root, but the file is owned by the user, so the {{ic|faillock}} command only empties the file, therefore does not require root.&lt;br /&gt;
&lt;br /&gt;
The module {{ic|pam_faillock.so}} can be configured with the file {{ic|1=/etc/security/faillock.conf}}. The lockout parameters:&lt;br /&gt;
&lt;br /&gt;
* {{ic|unlock_time}} — the lockout time (in seconds, default 10 minutes).&lt;br /&gt;
* {{ic|fail_interval}} — the time in which failed logins can cause a lockout (in seconds, default 15 minutes).&lt;br /&gt;
* {{ic|deny}} — the number of failed logins before lockout (default 3).&lt;br /&gt;
&lt;br /&gt;
{{Tip|The primary purpose for the lockout is to slow down brute-force attacks so that they become infeasible. Hence, if lockouts due to mistyping of passwords become too frequent, relaxing the number of attempts may be preferred to reducing the lockout time.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|{{ic|1=deny = 0}} will disable the lockout mechanism entirely.}}&lt;br /&gt;
&lt;br /&gt;
By default, all user locks are lost after reboot. If your attacker can reboot the machine, it is more secure if locks persist. To make locks persist, change the {{ic|dir}} parameter in {{ic|1=/etc/security/faillock.conf}} to {{ic|/var/lib/faillock}}.&lt;br /&gt;
&lt;br /&gt;
No restart is required for changes to take effect. See {{man|5|faillock.conf}} for further configuration options, such as enabling lockout for the root account, disabling for centralized login (e.g. LDAP), etc.&lt;br /&gt;
&lt;br /&gt;
{{Note|If you make locks persistant, following the changes introduced in polkit 127: you may have to relax the sandbox of its helper agent in order to keep it functional. The best way is to create a drop-in for its systemd unit via {{ic|systemctl edit polkit-agent-helper\@.service}} and add:&lt;br /&gt;
&lt;br /&gt;
 [Service]&lt;br /&gt;
 ReadWritePaths{{=}}/var/lib/faillock&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Limit amount of processes ===&lt;br /&gt;
&lt;br /&gt;
On systems with many, or untrusted users, it is important to limit the number of processes each can run at once, therefore preventing [[Wikipedia:Fork bomb|fork bombs]] and other denial of service attacks. The {{ic|/etc/security/limits.conf}} configuration determines how many processes each user, or group can have open, and is empty (except for useful comments) by default. Adding the following lines to this file will limit all users to 100 active processes, unless they use the {{ic|prlimit}} command to explicitly raise their maximum to 200 for that session. These values can be changed according to the appropriate number of processes a user should have running, or the hardware of the box you are administrating.&lt;br /&gt;
&lt;br /&gt;
 * soft nproc 100&lt;br /&gt;
 * hard nproc 200&lt;br /&gt;
&lt;br /&gt;
The current number of threads for each user can be found with {{ic|ps --no-headers -Leo user {{!}} sort {{!}} uniq --count}}. This may help with determining appropriate values for the users&#039; limits; see also [[limits.conf]].&lt;br /&gt;
&lt;br /&gt;
=== Use Wayland ===&lt;br /&gt;
&lt;br /&gt;
Prefer using [[Wayland]] over [[Xorg]]. Xorg&#039;s design predates modern security practices and is [https://security.stackexchange.com/questions/4641/why-are-people-saying-that-the-x-window-system-is-not-secure/4646#4646 considered insecure] by many. For example, Xorg applications may record keystrokes while inactive.&lt;br /&gt;
&lt;br /&gt;
If you must run Xorg, it is recommended to [[Xorg#Rootless Xorg|avoid running it as root]]. Within Wayland, the Xwayland compatibility layer will automatically use rootless Xorg.&lt;br /&gt;
&lt;br /&gt;
== Restricting root ==&lt;br /&gt;
&lt;br /&gt;
The root user is, by definition, the most powerful user on a system. It is also difficult to [[audit]] the root user account. It is therefore important to restrict usage of the root user account as much as possible. There are a number of ways to keep the power of the root user while limiting its ability to cause harm.&lt;br /&gt;
&lt;br /&gt;
=== Use sudo instead of su ===&lt;br /&gt;
&lt;br /&gt;
Using [[sudo]] for privileged access is preferable to [[su]] for a number of reasons:&lt;br /&gt;
&lt;br /&gt;
* It keeps a log of which normal privilege user has run each privileged command.&lt;br /&gt;
* The root user password need not be given out to each user who requires root access.&lt;br /&gt;
* {{ic|sudo}} prevents users from accidentally running commands as &#039;&#039;root&#039;&#039; that do not need root access, because a full root terminal is not created. This aligns with the [[Wikipedia:Principle of least privilege|principle of least privilege]].&lt;br /&gt;
* Individual programs may be enabled per user, instead of offering complete root access just to run one command. &lt;br /&gt;
&lt;br /&gt;
See [[Sudo#Configuration]].&lt;br /&gt;
&lt;br /&gt;
==== Editing files using sudo ====&lt;br /&gt;
&lt;br /&gt;
See [[Sudo#Editing files]]. Alternatively, you can use editors like {{ic|rvim}} or {{ic|rnano}} which have restricted capabilities in order to be safe to run as root.&lt;br /&gt;
&lt;br /&gt;
=== Restricting root login ===&lt;br /&gt;
&lt;br /&gt;
Once [[sudo]] is properly configured, full root access can be heavily restricted or denied without losing much usability. To disable root, but still allowing to use [[sudo]], you can use {{man|1|passwd}} with {{ic|passwd --lock root}}.&lt;br /&gt;
&lt;br /&gt;
==== Allow only certain users ====&lt;br /&gt;
&lt;br /&gt;
The [[PAM]] {{ic|pam_wheel.so}} lets you allow only users in the group {{ic|wheel}} to login using [[su]]. See [[su#su and wheel]].&lt;br /&gt;
&lt;br /&gt;
==== Denying SSH login ====&lt;br /&gt;
&lt;br /&gt;
Even if you do not wish to deny root login for local users, it is always good practice to [[OpenSSH#Deny|deny root login via SSH]]. The purpose of this is to add an additional layer of security before a user can completely compromise your system remotely.&lt;br /&gt;
&lt;br /&gt;
==== Specify acceptable login combinations with access.conf ====&lt;br /&gt;
&lt;br /&gt;
{{Warning|If you are using GNOME 49 or later, you should make sure the group &#039;&#039;gdm&#039;&#039; can log in locally. This can be done with a {{ic|+:(gdm):LOCAL}} rule. [https://gitlab.gnome.org/GNOME/gdm/-/issues/1021]}}&lt;br /&gt;
&lt;br /&gt;
When someone attempts to log in with [[PAM]], {{ic|/etc/security/access.conf}} is checked for the first combination that matches their login properties. Their attempt then fails or succeeds based on the rule for that combination.&lt;br /&gt;
&lt;br /&gt;
 +:root:LOCAL&lt;br /&gt;
 -:root:ALL&lt;br /&gt;
&lt;br /&gt;
Rules can be set for specific groups and users. In this example, the user archie is allowed to login locally, as are all users in the wheel and adm groups. All other logins are rejected:&lt;br /&gt;
&lt;br /&gt;
 +:archie:LOCAL&lt;br /&gt;
 +:(wheel):LOCAL&lt;br /&gt;
 +:(adm):LOCAL&lt;br /&gt;
 -:ALL:ALL&lt;br /&gt;
&lt;br /&gt;
Read more at {{man|5|access.conf}}&lt;br /&gt;
&lt;br /&gt;
== Mandatory access control ==&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:Mandatory Access Control|Mandatory access control]] (MAC) is a type of security policy that differs significantly from the [[Wikipedia:Discretionary Access Control|discretionary access control]] (DAC) used by default in Arch and most Linux distributions. MAC essentially means that every action a program could perform that affects the system in any way is checked against a security ruleset. This ruleset, in contrast to DAC methods, cannot be modified by users. Using virtually any mandatory access control system will significantly improve the security of your computer, although there are differences in how it can be implemented.&lt;br /&gt;
&lt;br /&gt;
=== Pathname MAC ===&lt;br /&gt;
&lt;br /&gt;
Pathname-based access control is a simple form of access control that offers permissions based on the path of a given file. The downside to this style of access control is that permissions are not carried with files if they are moved around the system. On the positive side, pathname-based MAC can be implemented on a much wider range of filesystems, unlike labels-based alternatives.&lt;br /&gt;
&lt;br /&gt;
* [[AppArmor]] is a [[Wikipedia:Canonical (company)|Canonical]]-maintained MAC implementation seen as an &amp;quot;easier&amp;quot; alternative to SELinux.&lt;br /&gt;
* [[TOMOYO]] is another simple, easy-to-use system offering mandatory access control. It is designed to be both simple in usage and in implementation, requiring very few dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Labels MAC ===&lt;br /&gt;
&lt;br /&gt;
Labels-based access control means the extended attributes of a file are used to govern its security permissions. While this system is arguably more flexible in its security offerings than pathname-based MAC, it only works on filesystems that support these extended attributes.&lt;br /&gt;
&lt;br /&gt;
* [[SELinux]], based on an [[Wikipedia:NSA|NSA]] project to improve Linux security, implements MAC completely separate from system users and roles. It offers an extremely robust multi-level MAC policy implementation that can easily maintain control of a system that grows and changes past its original configuration.&lt;br /&gt;
&lt;br /&gt;
=== Access Control Lists ===&lt;br /&gt;
&lt;br /&gt;
[[Access Control Lists]] (ACLs) are an alternative to attaching rules directly to the filesystem in some way. ACLs implement access control by checking program actions against a list of permitted behavior.&lt;br /&gt;
&lt;br /&gt;
== Kernel hardening ==&lt;br /&gt;
&lt;br /&gt;
=== Kernel self-protection / exploit mitigation ===&lt;br /&gt;
&lt;br /&gt;
The {{pkg|linux-hardened}} package uses a [https://github.com/anthraxx/linux-hardened basic kernel hardening patch set] and more security-focused compile-time configuration options than the {{pkg|linux}} package. A custom build can be made to choose a different compromise between security and performance than the security-leaning defaults.&lt;br /&gt;
&lt;br /&gt;
However, it should be noted that several packages (such as {{pkg|throttled}}) will not work when using this kernel.&lt;br /&gt;
&lt;br /&gt;
If you use an out-of-tree driver such as [[NVIDIA]], you may need to switch to its [[DKMS]] package.&lt;br /&gt;
&lt;br /&gt;
==== Userspace ASLR comparison ====&lt;br /&gt;
&lt;br /&gt;
The {{pkg|linux-hardened}} package provides an improved implementation of Address Space Layout Randomization for userspace processes. The {{pkg|paxtest}} command can be used to obtain an estimate of the provided entropy:&lt;br /&gt;
&lt;br /&gt;
===== 64-bit processes =====&lt;br /&gt;
&lt;br /&gt;
{{hc|linux-hardened 5.4.21.a-1-hardened|&lt;br /&gt;
Anonymous mapping randomization test     : 32 quality bits (guessed)&lt;br /&gt;
Heap randomization test (ET_EXEC)        : 40 quality bits (guessed)&lt;br /&gt;
Heap randomization test (PIE)            : 40 quality bits (guessed)&lt;br /&gt;
Main executable randomization (ET_EXEC)  : 32 quality bits (guessed)&lt;br /&gt;
Main executable randomization (PIE)      : 32 quality bits (guessed)&lt;br /&gt;
Shared library randomization test        : 32 quality bits (guessed)&lt;br /&gt;
VDSO randomization test                  : 32 quality bits (guessed)&lt;br /&gt;
Stack randomization test (SEGMEXEC)      : 40 quality bits (guessed)&lt;br /&gt;
Stack randomization test (PAGEEXEC)      : 40 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (SEGMEXEC)    : 44 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (PAGEEXEC)    : 44 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_EXEC): 34 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_DYN) : 34 quality bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @~0: 32 bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @0 : 32 bits (guessed)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{hc|linux 5.5.5-arch1-1|&lt;br /&gt;
Anonymous mapping randomization test     : 28 quality bits (guessed)&lt;br /&gt;
Heap randomization test (ET_EXEC)        : 28 quality bits (guessed)&lt;br /&gt;
Heap randomization test (PIE)            : 28 quality bits (guessed)&lt;br /&gt;
Main executable randomization (ET_EXEC)  : 28 quality bits (guessed)&lt;br /&gt;
Main executable randomization (PIE)      : 28 quality bits (guessed)&lt;br /&gt;
Shared library randomization test        : 28 quality bits (guessed)&lt;br /&gt;
VDSO randomization test                  : 20 quality bits (guessed)&lt;br /&gt;
Stack randomization test (SEGMEXEC)      : 30 quality bits (guessed)&lt;br /&gt;
Stack randomization test (PAGEEXEC)      : 30 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (SEGMEXEC)    : 22 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (PAGEEXEC)    : 22 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_EXEC): 28 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_DYN) : 28 quality bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @~0: 29 bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @0 : 29 bits (guessed)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{hc|linux-lts 4.19.101-1-lts|&lt;br /&gt;
Anonymous mapping randomization test     : 28 quality bits (guessed)&lt;br /&gt;
Heap randomization test (ET_EXEC)        : 28 quality bits (guessed)&lt;br /&gt;
Heap randomization test (PIE)            : 28 quality bits (guessed)&lt;br /&gt;
Main executable randomization (ET_EXEC)  : 28 quality bits (guessed)&lt;br /&gt;
Main executable randomization (PIE)      : 28 quality bits (guessed)&lt;br /&gt;
Shared library randomization test        : 28 quality bits (guessed)&lt;br /&gt;
VDSO randomization test                  : 19 quality bits (guessed)&lt;br /&gt;
Stack randomization test (SEGMEXEC)      : 30 quality bits (guessed)&lt;br /&gt;
Stack randomization test (PAGEEXEC)      : 30 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (SEGMEXEC)    : 22 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (PAGEEXEC)    : 22 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_EXEC): 28 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_DYN) : 28 quality bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @~0: 28 bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @0 : 28 bits (guessed)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== 32-bit processes (on an x86_64 kernel) =====&lt;br /&gt;
&lt;br /&gt;
{{hc|linux-hardened|&lt;br /&gt;
Anonymous mapping randomization test     : 16 quality bits (guessed)&lt;br /&gt;
Heap randomization test (ET_EXEC)        : 22 quality bits (guessed)&lt;br /&gt;
Heap randomization test (PIE)            : 27 quality bits (guessed)&lt;br /&gt;
Main executable randomization (ET_EXEC)  : No randomization&lt;br /&gt;
Main executable randomization (PIE)      : 18 quality bits (guessed)&lt;br /&gt;
Shared library randomization test        : 16 quality bits (guessed)&lt;br /&gt;
VDSO randomization test                  : 16 quality bits (guessed)&lt;br /&gt;
Stack randomization test (SEGMEXEC)      : 24 quality bits (guessed)&lt;br /&gt;
Stack randomization test (PAGEEXEC)      : 24 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (SEGMEXEC)    : 28 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (PAGEEXEC)    : 28 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_EXEC): 18 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_DYN) : 16 quality bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @~0: 18 bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @0 : 18 bits (guessed)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{hc|linux|&lt;br /&gt;
Anonymous mapping randomization test     : 8 quality bits (guessed)&lt;br /&gt;
Heap randomization test (ET_EXEC)        : 13 quality bits (guessed)&lt;br /&gt;
Heap randomization test (PIE)            : 13 quality bits (guessed)&lt;br /&gt;
Main executable randomization (ET_EXEC)  : No randomization&lt;br /&gt;
Main executable randomization (PIE)      : 8 quality bits (guessed)&lt;br /&gt;
Shared library randomization test        : 8 quality bits (guessed)&lt;br /&gt;
VDSO randomization test                  : 8 quality bits (guessed)&lt;br /&gt;
Stack randomization test (SEGMEXEC)      : 19 quality bits (guessed)&lt;br /&gt;
Stack randomization test (PAGEEXEC)      : 19 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (SEGMEXEC)    : 11 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (PAGEEXEC)    : 11 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_EXEC): 8 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_DYN) : 13 quality bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @~0: No randomization&lt;br /&gt;
Randomization under memory exhaustion @0 : No randomization&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Restricting access to kernel pointers in the proc filesystem ===&lt;br /&gt;
&lt;br /&gt;
Setting {{ic|kernel.kptr_restrict}} to 1 will hide kernel symbol addresses in {{ic|/proc/kallsyms}} from regular users without {{ic|CAP_SYSLOG}}, making it more difficult for kernel exploits to resolve addresses/symbols dynamically. This will not help that much on a pre-compiled Arch Linux kernel, since a determined attacker could just download the kernel package and get the symbols manually from there, but if you are compiling your own kernel, this can help mitigating local root exploits. This will break some {{Pkg|perf}} commands when used by non-root users (but many {{Pkg|perf}} features require root access anyway). See {{Bug|34323}} for more information.&lt;br /&gt;
&lt;br /&gt;
Setting {{ic|kernel.kptr_restrict}} to 2 will hide kernel symbol addresses in {{ic|/proc/kallsyms}} regardless of privileges.&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/sysctl.d/51-kptr-restrict.conf|2=&lt;br /&gt;
kernel.kptr_restrict = 1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|{{pkg|linux-hardened}} sets {{ic|1=kptr_restrict=2}} by default rather than {{ic|0}}.}}&lt;br /&gt;
&lt;br /&gt;
=== BPF hardening ===&lt;br /&gt;
&lt;br /&gt;
BPF is a system used to load and execute bytecode within the kernel dynamically during runtime. It is used in a number of Linux kernel subsystems such as networking (e.g. XDP, tc), tracing (e.g. kprobes, uprobes, tracepoints) and security (e.g. seccomp). It is also useful for advanced network security, performance profiling and dynamic tracing.&lt;br /&gt;
&lt;br /&gt;
BPF was originally an acronym of [[Wikipedia:Berkeley Packet Filter|Berkeley Packet Filter]] since the original classic BPF was used for packet capture tools for BSD. This eventually evolved into Extended BPF (eBPF), which was shortly afterwards renamed to just BPF (not an acronym). BPF should not be confused with packet filtering tools like iptables or netfilter, although BPF can be used to implement packet filtering tools.&lt;br /&gt;
&lt;br /&gt;
BPF code may be either interpreted or compiled using a [[Wikipedia:Just-in-time compilation|Just-In-Time (JIT) compiler]]. The Arch kernel is built with {{ic|CONFIG_BPF_JIT_ALWAYS_ON}} which disables the BPF interpreter and forces all BPF to use JIT compilation. This makes it harder for an attacker to use BPF to escalate attacks that exploit SPECTRE-style vulnerabilities. See [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=290af86629b25ffd1ed6232c4e9107da031705cb the kernel patch which introduced CONFIG_BPF_JIT_ALWAYS_ON] for more details.&lt;br /&gt;
&lt;br /&gt;
The kernel includes a hardening feature for JIT-compiled BPF which can mitigate some types of JIT spraying attacks at the cost of performance and the ability to trace and debug many BPF programs. It may be enabled by setting {{ic|net.core.bpf_jit_harden}} to {{ic|1}} (to enable hardening of unprivileged code) or {{ic|2}} (to enable hardening of all code).&lt;br /&gt;
&lt;br /&gt;
See the {{ic|net.core.bpf_*}} settings in the [https://docs.kernel.org/admin-guide/sysctl/net.html kernel documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
{{Tip|&lt;br /&gt;
* {{Pkg|linux-hardened}} sets {{ic|1=net.core.bpf_jit_harden=2}} by default rather than {{ic|0}}.&lt;br /&gt;
* By default, BPF programs can be run even by unprivileged users. To change that behaviour set {{ic|1=kernel.unprivileged_bpf_disabled=1}}[https://access.redhat.com/security/cve/cve-2021-33624].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== ptrace scope ===&lt;br /&gt;
&lt;br /&gt;
The {{man|2|ptrace}} syscall provides a means by which one process (the &amp;quot;tracer&amp;quot;) may observe and control the execution of another process (the &amp;quot;tracee&amp;quot;), and examine and change the tracee&#039;s memory and registers. {{ic|ptrace}} is commonly used by debugging tools including &#039;&#039;gdb&#039;&#039;, &#039;&#039;strace&#039;&#039;, &#039;&#039;perf&#039;&#039;, &#039;&#039;reptyr&#039;&#039; and other debuggers. However, it also provides a means by which a malicious process can read data from and take control of other processes.&lt;br /&gt;
&lt;br /&gt;
Arch enables the [https://docs.kernel.org/admin-guide/LSM/Yama.html Yama LSM] by default, which provides a {{ic|kernel.yama.ptrace_scope}} [[kernel parameter]]. This parameter is set to {{ic|1}} (restricted) by default which prevents tracers from performing a {{ic|ptrace}} call on traces outside of a restricted scope unless the tracer is privileged or has the {{ic|CAP_SYS_PTRACE}} [[Capabilities|capability]]. This is a significant improvement in security compared to the classic permissions. Without this module, there is no separation between processes running as the same user (in the absence of additional security layers such as {{man|7|pid_namespaces}}).&lt;br /&gt;
&lt;br /&gt;
{{Note|By default, you can still use tools which require {{ic|ptrace}} by running them as privileged processes, e.g. using [[sudo]].}}&lt;br /&gt;
&lt;br /&gt;
If you do not need to use debugging tools, consider setting {{ic|kernel.yama.ptrace_scope}} to {{ic|2}} (admin-only) or {{ic|3}} (no {{ic|ptrace}} possible) to harden the system.&lt;br /&gt;
&lt;br /&gt;
{{Note|Some anti-cheat and DRM implementations rely on {{ic|ptrace}} to work, including Easy Anti-Cheat and Ubisoft Connect under Wine. Setting this parameter to {{ic|2}} or higher might prevent games using these solutions from launching.}}&lt;br /&gt;
&lt;br /&gt;
=== hidepid ===&lt;br /&gt;
&lt;br /&gt;
{{Expansion|1=[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0fb5ce62c5920b6e0a8a061f2fe80e0403281e10 Linux 5.8 implemented private instances] and new values for {{ic|1=hidepid=}}.}}&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|Enabling {{ic|hidepid}} globally is not a supported way of operation by [[systemd]], nor does it have any practical improvements security-wise when systemd is running as service manager. [https://github.com/systemd/systemd/issues/29893#issuecomment-1798030108]}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|&lt;br /&gt;
* This may cause issues for certain applications like an application running in a sandbox and [[Xorg]] (see workaround).&lt;br /&gt;
* This causes issues with [[D-Bus]], [[Polkit]], [[PulseAudio]] and [[bluetooth]] when using {{Pkg|systemd}} &amp;gt; 237.64-1.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The kernel has the ability to hide other users&#039; processes, normally accessible via {{ic|/proc}}, from unprivileged users by mounting the {{ic|proc}} filesystem with the {{ic|1=hidepid=}} and {{ic|1=gid=}} options documented in https://docs.kernel.org/filesystems/proc.html.&lt;br /&gt;
&lt;br /&gt;
This greatly complicates an intruder&#039;s task of gathering information about running processes, whether some daemon runs with elevated privileges, whether other user runs some sensitive program, whether other users run any program at all, makes it impossible to learn whether any user runs a specific program (given the program does not reveal itself by its behaviour), and, as an additional bonus, poorly written programs passing sensitive information via program arguments are now protected against local eavesdroppers.&lt;br /&gt;
&lt;br /&gt;
The {{ic|proc}} [[Users and groups#System groups|group]], provided by the {{Pkg|filesystem}} package, acts as a whitelist of users authorized to learn other users&#039; process information. If users or services need access to {{ic|/proc/&amp;lt;pid&amp;gt;}} directories beyond their own, [[Users and groups#Group management|add them to the group]].&lt;br /&gt;
&lt;br /&gt;
For example, to hide process information from other users except those in the {{ic|proc}} group:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/fstab|2=&lt;br /&gt;
proc	/proc	proc	nosuid,nodev,noexec,hidepid=2,gid=proc	0	0&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
For user sessions to work correctly, an exception needs to be added for &#039;&#039;systemd-logind&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/systemd/system/systemd-logind.service.d/hidepid.conf|2=&lt;br /&gt;
[Service]&lt;br /&gt;
SupplementaryGroups=proc&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Restricting module loading ===&lt;br /&gt;
&lt;br /&gt;
The default Arch kernel has {{ic|CONFIG_MODULE_SIG_ALL}} enabled, which signs all kernel modules built as part of the {{Pkg|linux}} package. This allows the kernel to only load modules signed with a valid key, i.e. out-of-tree modules compiled locally or provided by packages such as {{Pkg|virtualbox-host-modules-arch}} cannot be loaded. You can use {{ic|1=modinfo}} to verify currently loaded modules have signatures; verifying the signatures by hand is slightly more involved [https://unix.stackexchange.com/a/496800].&lt;br /&gt;
&lt;br /&gt;
Kernel module loading can be restricted by setting the {{ic|1=module.sig_enforce=1}} [[kernel parameter]]. More information can be found in the [https://docs.kernel.org/admin-guide/module-signing.html kernel documentation].&lt;br /&gt;
&lt;br /&gt;
Further, unneeded individual modules can be [[blacklist]]ed, see [https://github.com/secureblue/secureblue/blob/live/files/system/usr/lib/modprobe.d/secureblue.conf secureblue] for examples.&lt;br /&gt;
&lt;br /&gt;
=== Disable kexec ===&lt;br /&gt;
&lt;br /&gt;
Kexec allows replacing the current running kernel.&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/sysctl.d/51-kexec-restrict.conf|2=&lt;br /&gt;
kernel.kexec_load_disabled = 1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|kexec is disabled by default in {{pkg|linux-hardened}}.}}&lt;br /&gt;
&lt;br /&gt;
=== Kernel lockdown mode ===&lt;br /&gt;
&lt;br /&gt;
Linux supports an optional [https://mjg59.dreamwidth.org/55105.html lockdown feature], intended to strengthen the boundary between UID 0 (root) and the kernel. When enabled some applications may cease to work which rely on low-level access to either hardware or the kernel.&lt;br /&gt;
&lt;br /&gt;
To use lockdown, its LSM must be initialized and a lockdown mode must be set.&lt;br /&gt;
&lt;br /&gt;
All [[Kernel#Officially supported kernels|officially supported kernels]] initialize the LSM, but none of them enforce any lockdown mode.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Initialized LSMs can be verified by running {{ic|cat /sys/kernel/security/lsm}}.}}&lt;br /&gt;
&lt;br /&gt;
Lockdown has two modes of operation:&lt;br /&gt;
&lt;br /&gt;
* {{ic|integrity}}: kernel features that allow userland to modify the running kernel are disabled (e.g. kexec, bpf).&lt;br /&gt;
* {{ic|confidentiality}}: kernel features that allow userland to extract confidential information from the kernel are also disabled.&lt;br /&gt;
&lt;br /&gt;
It is recommended to use {{ic|integrity}}, unless your specific threat model dictates otherwise.&lt;br /&gt;
&lt;br /&gt;
To enable kernel lockdown at runtime, run:&lt;br /&gt;
&lt;br /&gt;
 # echo &#039;&#039;mode&#039;&#039; &amp;gt; /sys/kernel/security/lockdown&lt;br /&gt;
&lt;br /&gt;
To enable kernel lockdown on boot, use the [[kernel parameter]] {{ic|1=lockdown=&#039;&#039;mode&#039;&#039;}}.&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* Kernel lockdown cannot be disabled at runtime.&lt;br /&gt;
* Kernel lockdown disables [[hibernation]].&lt;br /&gt;
* Versions &amp;lt;6.17 of the {{man|7|kernel_lockdown}} man page incorrectly state that &amp;quot;lockdown will be automatically enabled if the system boots in EFI Secure Boot mode&amp;quot;. This is not the behaviour of the upstream kernel, nor Arch&#039;s packaged [[kernel]]s.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
See also {{man|7|kernel_lockdown}}.&lt;br /&gt;
&lt;br /&gt;
=== Linux Kernel Runtime Guard (LKRG) ===&lt;br /&gt;
&lt;br /&gt;
[https://www.openwall.com/lkrg/ LKRG] ({{AUR|lkrg-dkms}}) is a kernel module which performs integrity checking of the kernel and detection of exploit attempts.&lt;br /&gt;
&lt;br /&gt;
=== Disable emergency shell ===&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|Masking {{ic|emergency.target}} and {{ic|emergency.service}} will have no effect on those units being added to the initramfs and run in early userspace. Even with them in the initramfs, mkinitcpio&#039;s systemd hook locks the root account[https://gitlab.archlinux.org/archlinux/packaging/packages/systemd/-/commit/292cdf8a2f7dd7c6c7d91d2b59617391935c837c][https://gitlab.archlinux.org/archlinux/packaging/packages/systemd/-/commit/8835b2f5dfbe8663f1a2fd08edbd35f90bf08691] for &amp;quot;security reasons&amp;quot; (see {{Bug|70408}}). The solution for the issue in the linked article, if even needed, would be to prevent {{ic|rescue.target}}, {{ic|rescue.service}}, {{ic|emergency.target}} and {{ic|emergency.service}} from being added to the initramfs image.}}&lt;br /&gt;
&lt;br /&gt;
The emergency shell is used to interactively troubleshoot the machine during the boot process. However, it is also a gadget that an attacker can use to access secure resources such as the TPM. See [https://pulsesecurity.co.nz/advisories/tpm-luks-bypass this article] for a practical example. The difficulty of attacks can be increased by disabling the emergency shell, at the tradeoff of removing a tool to troubleshoot early boot failures.&lt;br /&gt;
&lt;br /&gt;
To disable the emergency shell, See [[systemd#Disable emergency mode on remote machine]].&lt;br /&gt;
&lt;br /&gt;
== Sandboxing applications ==&lt;br /&gt;
&lt;br /&gt;
See also [[Wikipedia:Sandbox (computer security)]].&lt;br /&gt;
&lt;br /&gt;
To improve the security of systemd service units, see [[systemd/Sandboxing]].&lt;br /&gt;
&lt;br /&gt;
{{Warning|Unprivileged user namespace usage is enabled by default in all [[Kernel#Officially supported kernels|officially supported kernels]] except for {{Pkg|linux-hardened}}. Unprivileged user namespaces greatly increase the attack surface for local privilege escalation; see [https://gitlab.com/apparmor/apparmor/-/wikis/unprivileged_userns_restriction AppArmor&#039;s Wiki] and {{Bug|36969}}.}}&lt;br /&gt;
&lt;br /&gt;
To mitigate this, either:&lt;br /&gt;
	&lt;br /&gt;
* use the {{Pkg|linux-hardened}} kernel which has the safe default, or&lt;br /&gt;
* set the {{ic|kernel.unprivileged_userns_clone}} [[sysctl]] to {{ic|0}}.&lt;br /&gt;
	&lt;br /&gt;
Note that this can break applications such as {{pkg|nsjail}}. [[Chromium]] based applications need SUID bit for {{ic|chrome-sandbox}} to work with this setting.&lt;br /&gt;
&lt;br /&gt;
=== Firejail ===&lt;br /&gt;
&lt;br /&gt;
[[Firejail]] is an easy to use tool for sandboxing applications and servers alike. It was originally created for browsers and internet facing applications, but supports a large number of applications by now. To establish a sandboxed environment with a variety of features, it is installed as a suid binary and builds a sandboxed runtime environment for the target application based on black and white lists.&lt;br /&gt;
&lt;br /&gt;
=== bubblewrap ===&lt;br /&gt;
&lt;br /&gt;
[[bubblewrap]] is a sandbox application developed for unprivileged container tools like [[Flatpak]] with a significantly smaller resource footprint and complexity than Firejail. While it lacks certain features such as file path whitelisting, bubblewrap does offer bind mounts as well as the creation of user/IPC/PID/network/cgroup namespaces and can support both simple and complex sandboxes. For the {{Pkg|linux-hardened}} kernel you will need to to use {{Pkg|bubblewrap-suid}}.&lt;br /&gt;
&lt;br /&gt;
[[Bubblejail]] sandbox is based on [[bubblewrap]] and provides a resource oriented permission model with a graphical interface to tweak permissions.&lt;br /&gt;
&lt;br /&gt;
=== Portable ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Kraftland/portable Portable] is a sandboxing framework which utilizes [[bubblewrap]] and many other tools to lockdown running applications. It is designed to be simple for packagers and efficient for users, yet cuts off security holes and monitors background processes by default.&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/Kraftland/portable-arch portable-arch] for a repository of applications sandboxed by portable.&lt;br /&gt;
&lt;br /&gt;
If a sandboxed application does not utilize the Portal file chooser, portable can pass files to the sandbox (by passing {{ic|--actions share-files}}).&lt;br /&gt;
&lt;br /&gt;
Portable is fully functional on GNOME, while other desktops may lack small amounts of features like advanced background monitoring and ScreenShot portal.&lt;br /&gt;
&lt;br /&gt;
=== chroots ===&lt;br /&gt;
&lt;br /&gt;
Manual [[chroot]] jails can also be constructed to build sandboxed process environments. It is much more limited than other sandboxing technologies; the extent of its sandboxing is file path isolation.&lt;br /&gt;
&lt;br /&gt;
=== Linux containers ===&lt;br /&gt;
&lt;br /&gt;
[[Linux Containers]] are another good option when you need more separation than the other options (short of [[#Full virtualization options|full system virtualization]]) provide. LXC is run on top of the existing kernel in a pseudo-chroot with their own virtual hardware.&lt;br /&gt;
&lt;br /&gt;
=== gVisor ===&lt;br /&gt;
&lt;br /&gt;
The [https://gvisor.dev/ gVisor] project, led by Google, is providing a sandboxing application with a focus on containers following the [https://opencontainers.org/ OCI initiative], such as [[Docker]] and [[Kubernetes]]. It isolates containers and individual applications from the host by intercepting a majority of system calls to the kernel and presenting itself as guest kernel.&lt;br /&gt;
&lt;br /&gt;
A key difference to other intercepting sandboxing projects is that gVisor re-implements system calls in the Go programming language, as described in its [https://gvisor.dev/docs/architecture_guide/intro/ design overview]. Details for the list of [https://gvisor.dev/docs/user_guide/compatibility/linux/amd64/ re-implemented syscalls support] can be seen in [https://github.com/google/gvisor/blob/master/pkg/sentry/syscalls/linux/linux64.go git]. For usage examples, limitations and special features see the project [https://gvisor.dev/docs/ documentation].&lt;br /&gt;
&lt;br /&gt;
The application is available as {{Aur|gvisor-git}} and {{Aur|gvisor-bin}}.&lt;br /&gt;
&lt;br /&gt;
=== Full virtualization options ===&lt;br /&gt;
&lt;br /&gt;
Using full virtualization options such as [[VirtualBox]], [[KVM]], [[Xen]] or [https://www.qubes-os.org/ Qubes OS] (based on Xen) can also improve isolation and security in the event you plan on running risky applications or browsing dangerous websites.&lt;br /&gt;
&lt;br /&gt;
== Network and firewalls ==&lt;br /&gt;
&lt;br /&gt;
=== Firewalls ===&lt;br /&gt;
&lt;br /&gt;
While the stock Arch kernel is capable of using [[Wikipedia:Netfilter|Netfilter]]&#039;s [[iptables]] and [[nftables]], the services are not [[enable]]d by default. It is highly recommended to set up some form of firewall to protect the services running on the system. Many resources (including ArchWiki) do not state explicitly which services are worth protecting, so enabling a firewall is a good precaution.&lt;br /&gt;
&lt;br /&gt;
* See [[iptables]] and [[nftables]] for general information.&lt;br /&gt;
* See [[Simple stateful firewall]] for a guide on setting up an iptables firewall.&lt;br /&gt;
* See [[:Category:Firewalls]] for other ways of setting up netfilter.&lt;br /&gt;
* See [[Ipset]] for blocking lists of ip addresses, such as those from Bluetack.&lt;br /&gt;
* {{Pkg|opensnitch}} is a configurable inbound and outbound firewall with support for configurable rules by application, port, host, etc.&lt;br /&gt;
&lt;br /&gt;
A quick way to setup a basic firewall is to use the tool {{ic|ufw}} (Uncomplicated Fire Wall). Then set {{ic|ufw default deny incoming}} and {{ic|ufw default allow outgoing}} and enabling it with {{ic|ufw enable}} and {{ic|systemctl enable ufw}}.&lt;br /&gt;
&lt;br /&gt;
==== Open ports ====&lt;br /&gt;
&lt;br /&gt;
{{Style|&amp;quot;Open ports&amp;quot; is not a good title since it disregards interfaces and addresses that the application may be bound to. From the firewalls&#039; point of view, ports may be &amp;quot;open&amp;quot; even if no application listens on them at the moment.}}&lt;br /&gt;
&lt;br /&gt;
Some services listen for inbound traffic on open network ports. It is important to only bind these services to the addresses and interfaces that are strictly necessary. It may be possible for a remote attacker to [https://samy.pl/slipstream/ exploit flawed network protocols to access exposed services]. This can even happen with [https://nvd.nist.gov/vuln/detail/CVE-2019-13450 processes bound to localhost].&lt;br /&gt;
&lt;br /&gt;
In general, if a service only needs to be accessible to the local system, bind to a Unix domain socket ({{man|7|unix}}) or a loopback address such as {{ic|localhost}} instead of a non-loopback address like {{ic|0.0.0.0/0}}.&lt;br /&gt;
&lt;br /&gt;
If a service needs to be accessible to other systems via the network, control the access with strict [[firewall]] rules and configure authentication, authorization and encryption whenever possible.&lt;br /&gt;
&lt;br /&gt;
You can list all current open ports with {{ic|ss -l}}. To show all &#039;&#039;&#039;l&#039;&#039;&#039;istening &#039;&#039;&#039;p&#039;&#039;&#039;rocesses and their &#039;&#039;&#039;n&#039;&#039;&#039;umeric &#039;&#039;&#039;t&#039;&#039;&#039;cp and &#039;&#039;&#039;u&#039;&#039;&#039;dp port numbers:&lt;br /&gt;
&lt;br /&gt;
 # ss -lpntu&lt;br /&gt;
&lt;br /&gt;
See {{man|8|ss}} for more options.&lt;br /&gt;
&lt;br /&gt;
=== Kernel parameters ===&lt;br /&gt;
&lt;br /&gt;
Kernel parameters which affect networking can be set using [[Sysctl]]. For how to do this, see [[Sysctl#TCP/IP stack hardening]].&lt;br /&gt;
&lt;br /&gt;
=== SSH ===&lt;br /&gt;
&lt;br /&gt;
To mitigate [[Wikipedia:Brute-force attack|brute-force attacks]] it is recommended to enforce key-based authentication. For OpenSSH see [[OpenSSH#Protection]] for more recommendations. Alternatively [[Fail2ban]] or [[Sshguard]] offer lesser forms of protection by monitoring logs and writing [[firewall]] rules but open up the potential for a denial of service, since an attacker can [[Wikipedia:Spoofing attack#Spoofing and TCP/IP|spoof]] packets as if they came from the administrator after identifying their address. Spoofing IP has lines of defense, such as by [[sysctl#Reverse path filtering|reverse path filtering]] and [[sysctl#Disable ICMP redirects|disabling ICMP redirects]].&lt;br /&gt;
&lt;br /&gt;
You may want to harden authentication even more by using two-factor authentication. [[Google Authenticator]] provides a two-step authentication procedure using one-time passcodes (OTP).&lt;br /&gt;
&lt;br /&gt;
Denying root login is also a good practice, both for tracing intrusions and adding an additional layer of security before root access. For OpenSSH, see [[OpenSSH#Deny]].&lt;br /&gt;
&lt;br /&gt;
Mozilla publishes an [https://infosec.mozilla.org/guidelines/openssh.html OpenSSH configuration guide] which configures more verbose audit logging and restricts ciphers.&lt;br /&gt;
&lt;br /&gt;
=== DNS ===&lt;br /&gt;
&lt;br /&gt;
The default domain name resolution (DNS) configuration is highly compatible but has security weaknesses. See [[Domain name resolution#Privacy and security|DNS privacy and security]] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Proxies ===&lt;br /&gt;
&lt;br /&gt;
Proxies are commonly used as an extra layer between applications and the network, sanitizing data from untrusted sources. The attack surface of a small proxy running with lower privileges is significantly smaller than a complex application running with the end user privileges.&lt;br /&gt;
&lt;br /&gt;
For example the DNS resolver is implemented in {{Pkg|glibc}}, that is linked with the application (that may be running as root), so a bug in the DNS resolver might lead to a remote code execution. This can be prevented by installing a DNS caching server, such as [[dnsmasq]], which acts as a proxy. [https://googleonlinesecurity.blogspot.it/2016/02/cve-2015-7547-glibc-getaddrinfo-stack.html]&lt;br /&gt;
&lt;br /&gt;
=== Managing TLS certificates ===&lt;br /&gt;
&lt;br /&gt;
See [[TLS#Trust management]].&lt;br /&gt;
&lt;br /&gt;
== Physical security ==&lt;br /&gt;
&lt;br /&gt;
Physical access to a computer is root access given enough time and resources. However, a high &#039;&#039;practical&#039;&#039; level of security can be obtained by putting up enough barriers.&lt;br /&gt;
&lt;br /&gt;
An attacker can gain full control of your computer on the next boot by simply attaching a malicious IEEE 1394 (FireWire), Thunderbolt or PCI Express device as they are given full memory access by default.[https://web.archive.org/web/20210312083421/http://breaknenter.org/2014/09/inception-metasploit-integration/] For Thunderbolt, you can restrict the direct memory access completely or to known devices, see [[Thunderbolt#User device authorization|user device authorization]]. For Firewire and PCI Express, there is little you can do from preventing this, or modification of the hardware itself - such as flashing malicious firmware onto a drive. However, the vast majority of attackers will not be this knowledgeable and determined.&lt;br /&gt;
&lt;br /&gt;
[[#Data-at-rest encryption|Data-at-rest encryption]] will prevent access to your data if the computer is stolen, but malicious firmware can be installed to obtain this data upon your next log in by a resourceful attacker.&lt;br /&gt;
&lt;br /&gt;
=== Locking down BIOS ===&lt;br /&gt;
&lt;br /&gt;
Adding a password to the BIOS prevents someone from booting into removable media, which is basically the same as having root access to your computer. You should make sure your drive is first in the boot order and disable the other drives from being bootable if you can.&lt;br /&gt;
&lt;br /&gt;
=== Boot loaders ===&lt;br /&gt;
&lt;br /&gt;
It is highly important to protect your [[boot loader]]. An unprotected boot loader can bypass any login restrictions, e.g. by setting the {{ic|1=init=/bin/sh}} [[kernel parameter]] to boot directly to a shell.&lt;br /&gt;
&lt;br /&gt;
==== Syslinux ====&lt;br /&gt;
&lt;br /&gt;
[[Syslinux]] supports [[Syslinux#Security|password-protecting your boot loader]]. It allows you to set either a per-menu-item password or a global boot loader password.&lt;br /&gt;
&lt;br /&gt;
==== GRUB ====&lt;br /&gt;
&lt;br /&gt;
[[GRUB]] supports boot loader passwords as well. See [[GRUB/Tips and tricks#Password protection of GRUB menu]] for details. It also has support for [[GRUB#Encrypted /boot|encrypted /boot]], which only leaves some parts of the boot loader code unencrypted. GRUB&#039;s configuration, [[kernel]] and [[initramfs]] are encrypted.&lt;br /&gt;
&lt;br /&gt;
==== systemd-boot ====&lt;br /&gt;
&lt;br /&gt;
[[systemd-boot]] disables editing of kernel parameters when [[#Secure Boot|Secure Boot]] is enabled. Alternatively, you can set [[systemd-boot#Kernel parameters editor with password protection|kernel parameters for password protection]] in systemd-boot for a more traditional password-based option.&lt;br /&gt;
&lt;br /&gt;
=== Secure Boot ===&lt;br /&gt;
&lt;br /&gt;
[[Secure Boot]] is a feature of [[UEFI]] that allows authentication of the files your computer boots. This helps preventing some [[Wikipedia:Evil maid attack|evil maid attacks]] such as replacing files inside the boot partition. Normally computers come with keys that are enrolled by vendors (OEM). However these can be removed and allow the computer to enter &#039;&#039;Setup Mode&#039;&#039; which allows the user to enroll and manage their own keys.&lt;br /&gt;
&lt;br /&gt;
The secure boot page guides you through how to set secure boot up by [[Unified Extensible Firmware Interface/Secure Boot#Using your own keys|using your own keys]].&lt;br /&gt;
&lt;br /&gt;
=== Trusted Platform Module (TPM) ===&lt;br /&gt;
&lt;br /&gt;
[[Trusted Platform Module|TPMs]] are hardware microprocessors which have cryptographic keys embedded. This forms the fundamental root of trust of most modern computers and allows end-to-end verification of the boot chain. They can be used as internal smartcards, attest the firmware running on the computer and allow users to insert secrets into a tamper-proof and brute-force resistant store.&lt;br /&gt;
&lt;br /&gt;
=== Boot partition on removable flash drive ===&lt;br /&gt;
&lt;br /&gt;
One popular idea is to place the boot partition on a flash drive in order to render the system unbootable without it. Proponents of this idea often use [[#Data-at-rest encryption|full-disk encryption]] alongside, and some also use [[Dm-crypt/Specialties#Encrypted system using a detached LUKS header|detached encryption headers]] placed on the boot partition.&lt;br /&gt;
&lt;br /&gt;
This method can also be merged with [[Dm-crypt/Specialties#Encrypted /boot and a detached LUKS header on USB|encrypting /boot]].&lt;br /&gt;
&lt;br /&gt;
=== Automatic logout ===&lt;br /&gt;
&lt;br /&gt;
If you are using [[Bash]] or [[Zsh]], you can set {{ic|TMOUT}} for an automatic logout from shells after a timeout.&lt;br /&gt;
&lt;br /&gt;
For example, the following will automatically log out from virtual consoles (but not terminal emulators in X11):&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/profile.d/shell-timeout.sh|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
TMOUT=&amp;quot;$(( 60*10 ))&amp;quot;;&lt;br /&gt;
[ -z &amp;quot;$DISPLAY&amp;quot; ] &amp;amp;&amp;amp; export TMOUT;&lt;br /&gt;
case $( /usr/bin/tty ) in&lt;br /&gt;
	/dev/tty[0-9]*) export TMOUT;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
If you really want EVERY Bash/Zsh prompt (even within X) to timeout, use:&lt;br /&gt;
&lt;br /&gt;
 $ export TMOUT=&amp;quot;$(( 60*10 ))&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
Note that this will not work if there is some command running in the shell (eg.: an SSH session or other shell without {{ic|TMOUT}} support). But if you are using VC mostly for restarting frozen GDM/Xorg as root, then this is very useful.&lt;br /&gt;
&lt;br /&gt;
=== Protect against rogue USB devices ===&lt;br /&gt;
&lt;br /&gt;
The kernel has [https://docs.kernel.org/usb/authorization.html settings to deactivate] USB ports to protect your computer against rogue USB devices (a.k.a. [[Wikipedia:BadUSB|BadUSB]], [https://github.com/samyk/poisontap PoisonTap] or [https://lanturtle.com/ LanTurtle]). They can be set at runtime and automated via [[sysctl]].&lt;br /&gt;
&lt;br /&gt;
For more control install [[USBGuard]], which is a software framework implementing basic whitelisting and blacklisting capabilities based on device attributes.&lt;br /&gt;
&lt;br /&gt;
=== Volatile data collection ===&lt;br /&gt;
&lt;br /&gt;
A computer that is powered on may be vulnerable to [https://web.archive.org/web/20210420075636/https://fedvte.usalearning.gov/courses/CSI/course/videos/pdf/CSI_D01_S05_T01_STEP.pdf volatile data collection]. It is a best practice to turn a computer completely off at times it is not necessary for it to be on, or if the computer&#039;s physical security is temporarily compromised (e.g. when passing through a security checkpoint).&lt;br /&gt;
&lt;br /&gt;
== Packages ==&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
[https://www2.cs.arizona.edu/stork/packagemanagersecurity/attacks-on-package-managers.html#overview Attacks on package managers] are possible without proper use of package signing, and can affect even package managers with [https://www2.cs.arizona.edu/stork/packagemanagersecurity/faq.html proper signature systems]. Arch uses package signing by default and relies on a web of trust from 5 trusted master keys. See [[Pacman-key]] for details.&lt;br /&gt;
&lt;br /&gt;
=== Upgrades ===&lt;br /&gt;
&lt;br /&gt;
It is important to regularly [[System maintenance#Upgrading the system|upgrade the system]].&lt;br /&gt;
&lt;br /&gt;
=== Follow vulnerability alerts ===&lt;br /&gt;
&lt;br /&gt;
Subscribe to the Common Vulnerabilities and Exposure (CVE) Security Alert updates, made available by National Vulnerability Database, and found on the [https://nvd.nist.gov/download.cfm NVD Download webpage]. &lt;br /&gt;
&lt;br /&gt;
The tool {{Pkg|arch-audit}} can be used to check for vulnerabilities affecting the running system. A graphical system tray, {{Pkg|arch-audit-gtk}}, can also be used. See also [[Arch Security Team]].&lt;br /&gt;
&lt;br /&gt;
You should also consider subscribing to the release notifications for software you use, especially if you install software through means other than the main repositories or AUR. Some software have mailing lists you can subscribe to for security notifications. Source code hosting sites often offer RSS feeds for new releases.&lt;br /&gt;
&lt;br /&gt;
=== Rebuilding packages ===&lt;br /&gt;
&lt;br /&gt;
Packages can be rebuilt and stripped of undesired functions and features as a means to reduce attack surface. For example, {{Pkg|bzip2}} can be rebuilt without {{ic|bzip2recover}} in an attempt to circumvent [https://security.archlinux.org/CVE-2016-3189 CVE-2016-3189]. Custom hardening flags can also be applied either manually or via a wrapper.&lt;br /&gt;
&lt;br /&gt;
{{Merge|Arch package guidelines/Security|Security related build flags have their own article.}}&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|Copy-pasted from a 3 years old blog post. The compiler flags are specific to [[GCC]], some are hardly security related.}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Flag !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| -D_FORTIFY_SOURCE=2 || Run-time buffer overflow detection&lt;br /&gt;
|-&lt;br /&gt;
| -D_GLIBCXX_ASSERTIONS || Run-time bounds checking for C++ strings and containers&lt;br /&gt;
|-&lt;br /&gt;
| -fasynchronous-unwind-tables || Increased reliability of backtraces&lt;br /&gt;
|-&lt;br /&gt;
| -fexceptions || Enable table-based thread cancellation&lt;br /&gt;
|-&lt;br /&gt;
| -fpie -Wl,-pie || Full ASLR for executables&lt;br /&gt;
|-&lt;br /&gt;
| -fpic -shared || No text relocations for shared libraries&lt;br /&gt;
|-&lt;br /&gt;
| -fplugin=annobin || Generate data for hardening quality control&lt;br /&gt;
|-&lt;br /&gt;
| -fstack-clash-protection || Increased reliability of stack overflow detection&lt;br /&gt;
|-&lt;br /&gt;
| -fstack-protector, -fstack-protector-all or -fstack-protector-strong || Stack smashing protector&lt;br /&gt;
|-&lt;br /&gt;
| -grecord-gcc-switches || Store compiler flags in debugging information&lt;br /&gt;
|-&lt;br /&gt;
| -mcet -fcf-protection || Control flow integrity protection&lt;br /&gt;
|-&lt;br /&gt;
| -Werror=format-security || Reject potentially unsafe format string arguments&lt;br /&gt;
|-&lt;br /&gt;
| -Werror=implicit-function-declaration || Reject missing function prototypes&lt;br /&gt;
|-&lt;br /&gt;
| -Wl,-z,defs || Detect and reject underlinking&lt;br /&gt;
|-&lt;br /&gt;
| -Wl,-z,now || Disable lazy binding&lt;br /&gt;
|-&lt;br /&gt;
| -Wl,-z,relro || Read-only segments after relocation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* [https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/ Flags and info source]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://security.archlinux.org/ Arch Linux Security Tracker]&lt;br /&gt;
* [https://wiki.centos.org/HowTos/OS_Protection CentOS Wiki: OS Protection]&lt;br /&gt;
* [https://web.archive.org/web/20210712001756/https://developer.ibm.com/technologies/linux/articles/l-harden-desktop/ Hardening the Linux desktop]&lt;br /&gt;
* [https://web.archive.org/web/20190701140035/https://www.ibm.com/developerworks/linux/tutorials/l-harden-server/index.html Hardening the Linux server]&lt;br /&gt;
* [https://github.com/lfit/itpol/blob/master/linux-workstation-security.md Linux Foundation: Linux workstation security checklist]&lt;br /&gt;
* [https://www.privacyguides.org/ privacyguides.org Privacy Resources]&lt;br /&gt;
* [https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide/ Red Hat Enterprise Linux 7 Security Guide]&lt;br /&gt;
* [https://www.debian.org/doc/manuals/securing-debian-manual/index.en.html Securing Debian Manual]&lt;br /&gt;
* [https://web.archive.org/web/20140220055801/http://crunchbang.org:80/forums/viewtopic.php?id=24722 The paranoid #! Security Guide]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Security&amp;diff=873615</id>
		<title>Security</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Security&amp;diff=873615"/>
		<updated>2026-05-11T19:15:33Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Enforcing strong passwords with pam_pwquality */ add subsection with expansion template regarding pam_unix nullok usage&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Security]]&lt;br /&gt;
[[Category:File systems]]&lt;br /&gt;
[[Category:Networking]]&lt;br /&gt;
[[de:Sicherheit]]&lt;br /&gt;
[[es:Security]]&lt;br /&gt;
[[hu:Security]]&lt;br /&gt;
[[ja:セキュリティ]]&lt;br /&gt;
[[pt:Security]]&lt;br /&gt;
[[ru:Security]]&lt;br /&gt;
[[zh-hans:Security]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|Arch Security Team}}&lt;br /&gt;
{{Related|General recommendations}}&lt;br /&gt;
{{Related|Identity management}}&lt;br /&gt;
{{Related|Capabilities}}&lt;br /&gt;
{{Related|List of Applications/Security}}&lt;br /&gt;
{{Related|Arch package guidelines/Security}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
This article contains recommendations and best practices for [[Wikipedia:Hardening (computing)|hardening]] an Arch Linux system.&lt;br /&gt;
&lt;br /&gt;
== Concepts ==&lt;br /&gt;
&lt;br /&gt;
* It &#039;&#039;is&#039;&#039; possible to tighten security to the point where the system is unusable. Security and convenience must be balanced. The trick is to create a secure &#039;&#039;and&#039;&#039; useful system.&lt;br /&gt;
* The biggest threat is, and will always be, the user.&lt;br /&gt;
* The [[Wikipedia:Principle of least privilege|principle of least privilege]]: Each part of a system should only be able to access what is strictly required, and nothing more.&lt;br /&gt;
* Defense in depth: Security works better in independent layers. When one layer is breached, another should stop the attack.&lt;br /&gt;
* Be a little paranoid. And be suspicious. If anything sounds too good to be true, it probably is!&lt;br /&gt;
* You can never make a system 100% secure unless you unplug the machine from all networks, turn it off, lock it in a safe, smother it in concrete and never use it.&lt;br /&gt;
* Prepare for failure. Create a plan ahead of time to follow when your security is broken.&lt;br /&gt;
&lt;br /&gt;
== Passwords ==&lt;br /&gt;
&lt;br /&gt;
Passwords are key to a secure system. They secure your [[Users and groups|user accounts]], [[Data-at-rest encryption|encrypted filesystems]], and [[SSH keys|SSH]]/[[GPG]] keys. They are the main way a computer chooses to trust the person using it, so a big part of security is just about picking secure passwords and protecting them.&lt;br /&gt;
&lt;br /&gt;
=== Choosing secure passwords ===&lt;br /&gt;
&lt;br /&gt;
Passwords must be complex enough to not be easily guessed from e.g. personal information, or [[Wikipedia:Password cracking|cracked]] using methods like brute-force attacks. The tenets of strong passwords are based on &#039;&#039;length&#039;&#039; and &#039;&#039;randomness&#039;&#039;. In cryptography the quality of a password is often referred to as its [[Wikipedia:Password strength#Entropy as a measure of password strength|entropy]].&lt;br /&gt;
&lt;br /&gt;
Insecure passwords include those containing or those using as a base before substitution/variation:&lt;br /&gt;
&lt;br /&gt;
* Personally identifiable information (e.g., your dog&#039;s name, date of birth, area code, favorite video game)&lt;br /&gt;
* Simple character substitutions on words (e.g., {{ic|k1araj0hns0n}}), as modern dictionary attacks can easily work with these&lt;br /&gt;
* Root &amp;quot;words&amp;quot; or common strings followed or preceded by added numbers, symbols, or characters (e.g., {{ic|DG091101%}})&lt;br /&gt;
* Common phrases or short strings of common dictionary words (e.g. {{ic|photocopyhauntbranchexpose}}) including with character substitution (e.g. {{ic|Ph0toc0pyh4uN7br@nch3xp*se}}) (See Diceware below for when a combination of dictionary words can be secure)&lt;br /&gt;
* Any of the [[Wikipedia:List of the most common passwords|most common passwords]]&lt;br /&gt;
&lt;br /&gt;
The best choice for a password is something long (the longer, the better) and generated from a random source. It is important to use a long password. [https://www.theregister.com/2019/02/14/password_length Weak hash algorithms allow an 8-character password hash to be compromised in just a few hours.]&lt;br /&gt;
&lt;br /&gt;
Tools like {{Pkg|pwgen}} or {{AUR|apg}} can generate random passwords. However, these passwords can be difficult to memorize. One memorization technique (for ones often typed) is to generate a long password and memorize a minimally secure number of characters, temporarily writing down the full generated string. Over time, increase the number of characters typed - until the password is ingrained in muscle memory and need not be remembered. This technique is more difficult, but can provide confidence that a password will not turn up in wordlists or &amp;quot;intelligent&amp;quot; brute force attacks that combine words and substitute characters.&lt;br /&gt;
&lt;br /&gt;
Apart from password management, {{Pkg|keepassxc}} offers password/passphrase generation. It is possible to customize the generation in a GUI. Dictionary based passphrases are also supported.&lt;br /&gt;
&lt;br /&gt;
One technique for memorizing a password is to use a mnemonic phrase, where each word in the phrase reminds you of the next character in the password.&lt;br /&gt;
Take for instance “the girl is walking down the rainy street” could be translated to {{ic|t6!WdtR5}} or, less simply, {{ic|t&amp;amp;6!RrlW@dtR,57}}.&lt;br /&gt;
This approach could make it easier to remember a password, but note that the various letters have very different probabilities of being found at the start of words ([[Wikipedia:Letter frequency#Relative frequencies of the first letters of a word in the English language|Wikipedia:Letter frequency]]).&lt;br /&gt;
&lt;br /&gt;
Another effective technique can be to write randomly generated passwords down and store them in a &#039;&#039;safe&#039;&#039; place, such as in a wallet, purse, or document safe. Most people do a generally good job of protecting their physical valuables from attack, and it is easier for most people to understand physical security best practices compared to digital security practices.&lt;br /&gt;
&lt;br /&gt;
It is also very effective to combine the mnemonic and random technique by saving long randomly generated passwords with a [[password manager]], which will be in turn accessed with a memorable &amp;quot;master password&amp;quot;/primary password that must be used only for that purpose. The master password must be memorized and never saved. This requires the password manager to be installed on a system to easily access the password (which could be seen as an inconvenience or a security feature, depending on the situation). Some password managers also have smartphone apps which can be used to display passwords for manual entry on systems without that password manager installed (if that is a common use case, you could still use easily typeable but secure passwords for each service instead of completely random ones, see below). Note that a password manager introduces a single point of failure if you ever forget the master password.&lt;br /&gt;
Some password managers compute the contained passwords based on the master password and the service name where you want to log in instead of encrypting them, making it possible to use it on a new system without syncing any data.&lt;br /&gt;
&lt;br /&gt;
It can be effective to use a memorable long series of unrelated words as a password. The theory is that if a sufficiently long phrase is used, the gained entropy from the password&#039;s length can counter the lost entropy from the use of dictionary words. This [https://xkcd.com/936/ xkcd comic] demonstrates the entropy tradeoff of this method, taking into account the limited set of possible words for each word in the passphrase. If the set of words you choose from is large (multiple thousand words) and you choose 5-7 or even more random words from it, this method provides great entropy, even assuming the attacker knows the set of possible words chosen from and the number of words chosen. The number of possible passphrases after settling on a set of words and number of words is: (number of words in the set of words to select from) to the power of (the number of words chosen for the passphrase). See e.g. [https://www.rempe.us/diceware/ Diceware] for more.&lt;br /&gt;
&lt;br /&gt;
See [https://www.iusmentis.com/security/passphrasefaq/ The passphrase FAQ] or [[Wikipedia:Password strength]] for some additional background.&lt;br /&gt;
&lt;br /&gt;
=== Maintaining passwords ===&lt;br /&gt;
&lt;br /&gt;
Once you pick a strong password, be sure to keep it safe. Watch out for [[Wikipedia:Keylogger|keyloggers]] (software and hardware), screen loggers, [[Wikipedia:Social engineering (security)|social engineering]], [[Wikipedia:Shoulder surfing (computer security)|shoulder surfing]], and avoid reusing passwords so insecure servers cannot leak more information than necessary. [[List of applications/Security#Password managers|Password managers]] can help manage large numbers of complex passwords: if you are copy-pasting the stored passwords from the manager to the applications that need them, make sure to clear the copy buffer every time, and ensure they are not saved in any kind of log (e.g. do not paste them in plain terminal commands, which would store them in files like {{ic|.bash_history}}). Note that password managers that are implemented as browser extensions may be vulnerable to [https://www.spookjs.com side channel attacks]. These can be mitigated by using password managers that run as separate applications.&lt;br /&gt;
&lt;br /&gt;
As a rule, do not pick insecure passwords just because secure ones are harder to remember. Passwords are a balancing act. It is better to have an encrypted database of secure passwords, guarded behind a key and one strong master password, than it is to have many similar weak passwords. Writing passwords down is perhaps equally effective [https://www.schneier.com/blog/archives/2005/06/write_down_your.html], avoiding potential vulnerabilities in software solutions while requiring physical security.&lt;br /&gt;
&lt;br /&gt;
Another aspect of the strength of the passphrase is that it must not be easily recoverable from other places.&lt;br /&gt;
&lt;br /&gt;
If you use the same passphrase for disk encryption as you use for your login password (useful e.g. to auto-mount the encrypted partition or folder on login), make sure that {{ic|/etc/shadow}} ends up on an encrypted partition or/and uses a strong key derivation function (i.e. yescrypt/argon2 or sha512 with PBKDF2, but not md5 or low iterations in PBKDF2) for the stored password hash (see [[SHA password hashes]] for more information).&lt;br /&gt;
&lt;br /&gt;
{{Tip|In 2023 Arch Linux switched the [https://archlinux.org/news/changes-to-default-password-hashing-algorithm-and-umask-settings/ default hashing] algorithm to yescrypt. If you have not customized the default, executing a password change with {{ic|passwd}} is necessary (and sufficient) to apply the new default.}}&lt;br /&gt;
&lt;br /&gt;
If you are backing up your password database, make sure that each copy is not stored behind any other passphrase which in turn is stored in it, e.g. an encrypted drive or an authenticated remote storage service, or you will not be able to access it in case of need; a useful trick is to protect the drives or accounts where the database is backed up using a simple cryptographic hash of the master password. Maintain a list of all the backup locations: if one day you fear that the master passphrase has been compromised you will have to change it immediately on all the database backups and the locations protected with keys derived from the master password.&lt;br /&gt;
&lt;br /&gt;
Version-controlling the database in a secure way can be very complicated: if you choose to do it, you must have a way to update the master password of all the database versions. It may not always be immediately clear when the master password is leaked: to reduce the risk of somebody else discovering your password before you realize that it leaked, you may choose to change it on a periodical basis. If you fear that you have lost control over a copy of the database, you will need to change all the passwords contained in it within the time that it may take to brute-force the master password, according to its entropy.&lt;br /&gt;
&lt;br /&gt;
=== Password hashes ===&lt;br /&gt;
&lt;br /&gt;
A hash is a one-way function, i.e. it is designed to make it impossible to deduct the input without computing the hash function with it (example: MD5, SHA).&lt;br /&gt;
&lt;br /&gt;
A password-hash function is designed to make deducting a user-input (password) impossible without computing the hash function with it (example: bcrypt). A [[Wikipedia:Key derivation function|key derivation function]] (KDF; examples: yescrypt, scrypt, PBKDF2) is a cryptographic algorithm designed to derive secret keys (e.g. an AES key, a password hash) from an input (a master key, a password). Hence, a KDF can serve multiple applications, including those of a password-hash function.&lt;br /&gt;
&lt;br /&gt;
By default, Arch stores the hashed user passwords in the root-only-readable {{ic|/etc/shadow}} file, separated from the other user parameters stored in the world-readable {{ic|/etc/passwd}} file, see [[Users and groups#User database]]. See also [[#Restricting root]].&lt;br /&gt;
&lt;br /&gt;
Passwords are set with the &#039;&#039;&#039;passwd&#039;&#039;&#039; command, which [[Wikipedia:Key stretching|stretches]] them with the system&#039;s crypt function and then saves them in {{ic|/etc/shadow}}. The passwords are also [[Wikipedia:Salt (cryptography)|salted]] in order to defend them against [[Wikipedia:Rainbow table|rainbow table]] attacks. See also [https://www.slashroot.in/how-are-passwords-stored-linux-understanding-hashing-shadow-utils How are passwords stored in Linux (Understanding hashing with shadow utils)].&lt;br /&gt;
&lt;br /&gt;
Since password hashes follow a defined format, the method and parameter can be configured for subsequent new invocations of the &#039;&#039;passwd&#039;&#039; command. Hence, the individual hashes stored in the {{ic|/etc/shadow}} file can be a heterogeneous mix of the hash functions supported by the system.&lt;br /&gt;
&lt;br /&gt;
See {{man|5|crypt}} for more information on the format, hashing methods and parameters.&lt;br /&gt;
&lt;br /&gt;
The {{ic|/etc/login.defs}} file configures the [https://archlinux.org/news/changes-to-default-password-hashing-algorithm-and-umask-settings/ default password hashing] method {{ic|ENCRYPT_METHOD YESCRYPT}} and its parameter {{ic|YESCRYPT_COST_FACTOR}}.&lt;br /&gt;
&lt;br /&gt;
For example, an increment of the default {{ic|YESCRYPT_COST_FACTOR}} parameter will lead to a logarithmic increase of the compute time required to deduce the hash from a password. This applies, likewise, to a third-party trying to obtain the password secret, and the system to authenticate a user log-in.&lt;br /&gt;
&lt;br /&gt;
In contrast, the compute time for the SHA-512 hash function is configured by a parameter with a linear influence. See [[SHA password hashes]] for information on the previous Arch default. Note the yescrypt algorithm internally uses SHA-256, HMAC and PBKDF2 to compute its password-hash. The main reason is to combine positive attributes of these widely used and tested functions for an enhanced resistance to attacks. For example, the usability of SHA for various purposes has resulted in hardware support for the function, i.e. the performance to compute a pure SHA hash has accelerated considerably, making its application as a password-hash function more and more derelict.&lt;br /&gt;
&lt;br /&gt;
=== Disallow empty password ===&lt;br /&gt;
&lt;br /&gt;
{{Expansion|The [https://github.com/V4bel/dirtyfrag dirtyfrag] kernel vulnerabilities mwnipulated {{ic|/etc/shadow}} and relied on the regularly used {{ic|pam_unis}} option {{ic|nullok}} in {{ic|/etc/pam.d/system-auth}}. Removing this default, thereby disallowing empty passwords, can be an option to increase security. Instructions should be accompanied by commands how to check for user accounts with unset passwords first.}}&lt;br /&gt;
&lt;br /&gt;
=== Enforcing strong passwords with pam_pwquality ===&lt;br /&gt;
&lt;br /&gt;
PAM stands for the Pluggable Authentication Modules. &#039;&#039;pam_pwquality&#039;&#039; provides protection against [[Wikipedia:Dictionary attack|Dictionary attacks]] and helps configure a password policy that can be enforced throughout the system. It is based on &#039;&#039;pam_cracklib&#039;&#039;, so it is backwards compatible with its options.&lt;br /&gt;
&lt;br /&gt;
[[Install]] the {{Pkg|libpwquality}} package.&lt;br /&gt;
&lt;br /&gt;
{{Warning|The &#039;&#039;root&#039;&#039; account is not affected by this policy by default.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* You can use the &#039;&#039;root&#039;&#039; account to set a password for a user that bypasses the desired/configured policy. This is useful when setting temporary passwords.&lt;br /&gt;
* Current security guidelines around passwords, e.g. from NIST, but also from others, do not recommend enforcing special characters, since they often only lead to predictable alterations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
If for example you want to enforce this policy:&lt;br /&gt;
&lt;br /&gt;
* prompt 2 times for password in case of an error (retry option)&lt;br /&gt;
* 10 characters minimum length (minlen option)&lt;br /&gt;
* at least 6 characters should be different from old password when entering a new one (difok option)&lt;br /&gt;
* at least 1 digit (dcredit option)&lt;br /&gt;
* at least 1 uppercase (ucredit option)&lt;br /&gt;
* at least 1 lowercase (lcredit option)&lt;br /&gt;
* at least 1 other character (ocredit option)&lt;br /&gt;
* cannot contain the words &amp;quot;myservice&amp;quot; and &amp;quot;mydomain&amp;quot;&lt;br /&gt;
* enforce the policy for root&lt;br /&gt;
&lt;br /&gt;
Edit the {{ic|/etc/pam.d/passwd}} file to read as:&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
#%PAM-1.0&lt;br /&gt;
password required pam_pwquality.so retry=2 minlen=10 difok=6 dcredit=-1 ucredit=-1 ocredit=-1 lcredit=-1 [badwords=myservice mydomain] enforce_for_root&lt;br /&gt;
password required pam_unix.so use_authtok yescrypt shadow&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The {{ic|password required pam_unix.so use_authtok}} instructs the &#039;&#039;pam_unix&#039;&#039; module to not prompt for a password but rather to use the one provided by &#039;&#039;pam_pwquality&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
You can refer to the {{man|8|pam_pwquality}} and {{man|8|pam_unix}} man pages for more information.&lt;br /&gt;
&lt;br /&gt;
== CPU ==&lt;br /&gt;
&lt;br /&gt;
=== Microcode ===&lt;br /&gt;
&lt;br /&gt;
See [[microcode]] for information on how to install important security updates for your CPU&#039;s microcode.&lt;br /&gt;
&lt;br /&gt;
=== Hardware vulnerabilities ===&lt;br /&gt;
&lt;br /&gt;
Some CPUs contain hardware vulnerabilities. See the [https://docs.kernel.org/admin-guide/hw-vuln/ kernel documentation on hardware vulnerabilities] for a list of these vulnerabilities, as well as mitigation selection guides to help customize the kernel to mitigate these vulnerabilities for specific usage scenarios.&lt;br /&gt;
&lt;br /&gt;
To check if you are affected by a known vulnerability, run the following:&lt;br /&gt;
&lt;br /&gt;
 $ grep -r . /sys/devices/system/cpu/vulnerabilities/&lt;br /&gt;
&lt;br /&gt;
In most cases, updating the kernel and microcode will mitigate vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
==== Simultaneous multithreading (hyper-threading) ====&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:Simultaneous multithreading|Simultaneous multithreading]] (SMT), also called hyper-threading on Intel CPUs, is a hardware feature that may be a source of [https://docs.kernel.org/admin-guide/hw-vuln/l1tf.html L1 Terminal Fault] and [https://docs.kernel.org/admin-guide/hw-vuln/mds.html Microarchitectural Data Sampling] vulnerabilities. The Linux kernel and microcode updates contain mitigations for known vulnerabilities, but [https://docs.kernel.org/admin-guide/hw-vuln/l1tf.html#virtualization-with-untrusted-guests disabling SMT may still be required on certain CPUs if untrusted virtualization guests are present].&lt;br /&gt;
&lt;br /&gt;
{{Note|Disabling SMT is something mostly hypervisors benefit from.[https://security.stackexchange.com/questions/219753/sacrificing-30-of-my-cpu-performance-by-disabling-hyper-threading-to-fully-mi/219759#219759] On an ordinary system it has very little to no security benefits.}}&lt;br /&gt;
&lt;br /&gt;
SMT can often be disabled in your system&#039;s firmware. Consult your motherboard or system documentation for more information. You can also disable SMT in the kernel by adding the following [[kernel parameter]]:&lt;br /&gt;
&lt;br /&gt;
 mitigations=auto,nosmt&lt;br /&gt;
&lt;br /&gt;
== Memory ==&lt;br /&gt;
&lt;br /&gt;
=== Hardened malloc ===&lt;br /&gt;
&lt;br /&gt;
{{AUR|hardened_malloc}} is a hardened replacement for [[Wikipedia:GNU C Library|glibc]]&#039;s malloc(). The project was originally developed for integration into Android&#039;s [[Wikipedia:Bionic (software)|Bionic]] and [[Wikipedia:musl|musl]] by Daniel Micay, of [[Wikipedia:GrapheneOS|GrapheneOS]], but he has also built in support for standard Linux distributions on the x86_64 architecture.&lt;br /&gt;
&lt;br /&gt;
== Storage ==&lt;br /&gt;
&lt;br /&gt;
=== Data-at-rest encryption ===&lt;br /&gt;
&lt;br /&gt;
[[Data-at-rest encryption]], preferably full-disk encryption with a [[#Passwords|strong passphrase]], is the only way to guard data against physical recovery. This provides data confidentiality when the computer is turned off or the disks in question are unmounted.&lt;br /&gt;
&lt;br /&gt;
Once the computer is powered on and the drive is mounted, however, its data becomes just as vulnerable as an unencrypted drive. It is therefore best practice to unmount data partitions as soon as they are no longer needed.&lt;br /&gt;
&lt;br /&gt;
You may also [[Trusted Platform Module#LUKS encryption|encrypt a drive with the key stored in a TPM]], although it has had [https://tpm.fail vulnerabilites in the past] and the key can be extracted by a [https://pulsesecurity.co.nz/articles/TPM-sniffing bus sniffing attack].&lt;br /&gt;
&lt;br /&gt;
Certain programs, like [[dm-crypt]], allow the user to encrypt a loop file as a virtual volume. This is a reasonable alternative to full-disk encryption when only certain parts of the system need to be secure.&lt;br /&gt;
&lt;br /&gt;
While the block-device or filesystem-based encryption types compared in the [[data-at-rest encryption]] article are useful at protecting data on physical media, most can not be used to protect data on a remote system that you can not control (such as [[Data-at-rest encryption#Cloud-storage optimized|cloud storage]]). In some cases, individual file encryption will be useful.&lt;br /&gt;
&lt;br /&gt;
These are some methods to encrypt files:&lt;br /&gt;
&lt;br /&gt;
* Some [[Archiving and compression|archiving and compressing]] tools also provide basic encryption. Some examples are [[7-Zip]] ({{ic|-p}} flag), {{Pkg|zip}} ({{ic|-e}} flag). The encryption should only be relied on particular care, because the tools may use custom algorithms for cross-platform compatibility.[https://math.ucr.edu/~mike/zipattacks.pdf]&lt;br /&gt;
* [[GnuPG]] can be used to [[GnuPG#Encrypt and decrypt|encrypt files]].&lt;br /&gt;
* {{Pkg|age}} is a simple and easy to use file encryption tool. It also supports multiple recipients and encryption using SSH keys, which is useful for secure file sharing.&lt;br /&gt;
&lt;br /&gt;
=== File systems ===&lt;br /&gt;
&lt;br /&gt;
The kernel now prevents security issues related to hardlinks and symlinks if the {{ic|fs.protected_hardlinks}} and {{ic|fs.protected_symlinks}} sysctl switches are enabled, so there is no longer a major security benefit from separating out world-writable directories.&lt;br /&gt;
&lt;br /&gt;
File systems containing world-writable directories can still be kept separate as a coarse way of limiting the damage from disk space exhaustion. However, filling {{ic|/var}} or {{ic|/tmp}} is enough to take down services. More flexible mechanisms for dealing with this concern exist (like [[Disk quota|quotas]]), and some [[file systems]] include related features themselves (Btrfs has quotas on subvolumes).&lt;br /&gt;
&lt;br /&gt;
==== Mount options ====&lt;br /&gt;
&lt;br /&gt;
Following the principle of least privilege, file systems should be mounted with the most restrictive mount options possible (without losing functionality).&lt;br /&gt;
&lt;br /&gt;
Relevant mount options are:&lt;br /&gt;
&lt;br /&gt;
* {{ic|nodev}}: Do not interpret character or block special devices on the file system.&lt;br /&gt;
* {{ic|nosuid}}: Do not allow set-user-identifier or set-group-identifier bits to take effect.&lt;br /&gt;
* {{ic|noexec}}: Do not allow direct execution of any binaries on the mounted file system.&lt;br /&gt;
** Setting {{ic|noexec}} on {{ic|/home}} disallows executable scripts and breaks [[Wine]], [[Steam]], PyCharm, [[.NET]], etc.&lt;br /&gt;
*** Wine does not need the {{ic|exec}} flag for opening Windows binaries. It is only needed when Wine itself is installed in {{ic|/home}}.&lt;br /&gt;
*** To keep [[Steam]] working you can mount {{ic|/home/user/.local/share/Steam}} as {{ic|exec}} in [[fstab]] by adding the following: {{bc|/home/user/.local/share/Steam  /home/user/.local/share/Steam  none defaults,bind,user,exec,nofail  0  0}}&lt;br /&gt;
** Some packages (building {{Pkg|nvidia-open-dkms}} for example) may require {{ic|exec}} on {{ic|/var}}.&lt;br /&gt;
&lt;br /&gt;
File systems used for data should always be mounted with {{ic|nodev}}, {{ic|nosuid}} and {{ic|noexec}}.&lt;br /&gt;
&lt;br /&gt;
Potential file system mounts to consider:&lt;br /&gt;
&lt;br /&gt;
* {{ic|/var}}&lt;br /&gt;
* {{ic|/home}}&lt;br /&gt;
* {{ic|/dev/shm}}&lt;br /&gt;
* {{ic|/tmp}}&lt;br /&gt;
* {{ic|/boot}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|When using [[systemd#GPT partition automounting|GPT partition automounting]], the ESP and XBOOTLDR partitions are [https://github.com/systemd/systemd-stable/commit/49804cfb71d3a79f433096e4cfb5616980171336 always hardened] with {{ic|noexec,nosuid,nodev}}.}}&lt;br /&gt;
&lt;br /&gt;
==== Snapshots ====&lt;br /&gt;
&lt;br /&gt;
When utilizing file system snapshots, e.g. with [[Btrfs]], [[LVM]], or [[ZFS]], it is essential to be aware that snapshots may retain sensitive information that users expect to be deleted. This is especially true when automatic snapshotting tools like [[Snapper]] are configured, as they can capture snapshots at regular intervals or in response to system events. Here are some examples of how sensitive information in {{ic|/home/}} can persist within snapshots:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Deleted files and directories&#039;&#039;: Even though files or directories are deleted from the file system, they may still exist within older snapshots. This is expected most of the time, but consider whether files and directories such as {{ic|.local/share/Trash/}}, {{ic|.history}}, etc. should be retained.&lt;br /&gt;
* &#039;&#039;Temporary files and cache&#039;&#039;: Temporary files and cached data generated by applications may be included in snapshots. For example, files kept in encrypted directories might generate thumbnails ({{ic|.cache/thumbnails}}) or work copies when opened, which might in turn be included in snapshots. The same applies e.g. to browsing history ({{ic|.mozilla/}}, {{ic|.config/chromium/}}, etc.), which could have been included in a snapshot before being purged.&lt;br /&gt;
&lt;br /&gt;
If this is supported, consider excluding such directories from snapshots altogether. For example, if using [[Btrfs]], you can create subvolumes for example {{ic|.cache/}}, {{ic|.config/}}, {{ic|.local/}}, {{ic|.var/}} or any other directory according to your use-case.&lt;br /&gt;
&lt;br /&gt;
{{Note|Moving {{ic|.local/share/Trash}} to a separate subvolume might break the trash feature in some cases, e.g. with [[GNOME/Files]].}}&lt;br /&gt;
&lt;br /&gt;
=== File access permissions ===&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|{{ic|chmod go-r}} does not &amp;quot;take away all permissions&amp;quot;, it only removes the read permission.}}&lt;br /&gt;
&lt;br /&gt;
The default [[file permissions]] allow read access to almost everything and changing the permissions can hide valuable information from an attacker who gains access to a non-root account such as the {{ic|http}} or {{ic|nobody}} users. You can use [[chmod]] to take away all permissions from the group and others:&lt;br /&gt;
&lt;br /&gt;
 # chmod go-r &#039;&#039;path_to_hide&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{Warning|Do not apply this broadly. Try this for one config at a time, ensuring that it is worth hiding, and that it will not break program functionality. You may need to remove the {{ic|g}} from the command (or re-add the permission with {{ic|chmod g+r &#039;&#039;path&#039;&#039;}} if already ran) if the group is relied on.}}&lt;br /&gt;
&lt;br /&gt;
Some paths to consider are:&lt;br /&gt;
&lt;br /&gt;
* {{ic|/boot}}: The [[Partitioning#/boot|boot directory]], which may include traditional [[vmlinuz]] and [[initramfs]] images, or a [[Unified kernel image]]. Note that safe permissions are used by default when using [[systemd#GPT partition automounting]].&lt;br /&gt;
* {{ic|/etc/nftables.conf}}: The [[nftables]] configuration, applicable to {{Pkg|nftables}} and {{Pkg|iptables}}.&lt;br /&gt;
* {{ic|/etc/iptables}}: The legacy [[iptables]] configuration, applicable to {{Pkg|iptables-legacy}}.&lt;br /&gt;
&lt;br /&gt;
The default [[umask]] {{ic|0022}} can be changed to improve security for newly created files. The [https://apps.nsa.gov/iaarchive/library/ia-guidance/security-configuration/operating-systems/guide-to-the-secure-configuration-of-red-hat-enterprise.cfm NSA RHEL5 Security Guide] suggests a umask of {{ic|0077}} for maximum security, which makes new files not readable by users other than the owner. To change this, see [[Umask#Set the mask value]]. If you use [[sudo]], consider configuring it to use the [[Sudo#Permissive umask|default root umask]].&lt;br /&gt;
&lt;br /&gt;
=== SUID and SGID files ===&lt;br /&gt;
&lt;br /&gt;
It is important to be aware of any files with the [[Wikipedia:Setuid|Setuid]] or Setgid bit. Examples of relevant files with the SUID bit set:&lt;br /&gt;
&lt;br /&gt;
* [[PAM|unix_chkpwd]]&lt;br /&gt;
* chage, expiry, gpasswd, groupmems, [[passwd]], sg ({{Pkg|shadow}})&lt;br /&gt;
* [[FUSE|fusermount3]], fusermount2&lt;br /&gt;
* [[polkit|pkexec]]&lt;br /&gt;
* [[OpenSSH|ssh-keysign]]&lt;br /&gt;
* chfn, chsh, mount, newgrp, umount, wall, write ({{Pkg|util-linux}})&lt;br /&gt;
* [[sudo]], {{Pkg|sudo-rs}}, [[doas]], [[su]], su-rs, [[Kerberos|ksu]]&lt;br /&gt;
* [[firejail]]&lt;br /&gt;
* [[Dbus|dbus-daemon-launch-helper]]&lt;br /&gt;
* [[Chromium|chromium-sandbox]]&lt;br /&gt;
* [[Xorg|Xorg.wrap]]&lt;br /&gt;
&lt;br /&gt;
The prominent risks of such executable files include privilege escalation vulnerabilities, see e.g [[Wikipedia:Setuid#Security impact]].[https://www.cvedetails.com/vulnerability-list/vendor_id-16224/product_id-36412/Calibre-ebook-Calibre.html][https://www.cvedetails.com/product/32625/Sudo-Project-Sudo.html?vendor_id=15714][https://www.cvedetails.com/vulnerability-list/vendor_id-16191/Firejail-Project.html]&lt;br /&gt;
&lt;br /&gt;
Files with the SUID bit set and not owned by root, or files with the SGID bit set &#039;&#039;typically&#039;&#039; have less potential impact but can theoretically still do decent damage if vulnerable. It is usually possible to avoid using SUID or SGID by assigning [[Capabilities]] instead.&lt;br /&gt;
&lt;br /&gt;
{{Tip|It is vital to be vigilant in keeping packages which provide SUID/SGID executables up to date in order to prevent having a vulnerable system.}}&lt;br /&gt;
&lt;br /&gt;
To search for files with either the SUID or SGID bit:&lt;br /&gt;
&lt;br /&gt;
 $ find / -perm &amp;quot;/u=s,g=s&amp;quot; -type f 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
=== Backups ===&lt;br /&gt;
&lt;br /&gt;
{{Merge|System backup|There is a dedicated page for system backups.}}&lt;br /&gt;
&lt;br /&gt;
Regularly create backups of important data. Regularly test the integrity of the backups. Regularly test that the backups can be restored.&lt;br /&gt;
&lt;br /&gt;
Make sure that at least one copy of the data is stored offline, i.e. not connected to the system under threat in any way. [[Wikipedia:Ransomware|Ransomware]] and other destructive attacks may also attack any connected backup systems.&lt;br /&gt;
&lt;br /&gt;
=== SATA SSD frozen mode ===&lt;br /&gt;
&lt;br /&gt;
See [[Solid state drive#Setting the SATA SSD state to frozen mode after waking up from sleep]].&lt;br /&gt;
&lt;br /&gt;
== User setup ==&lt;br /&gt;
&lt;br /&gt;
=== Do not use the root account for daily use ===&lt;br /&gt;
&lt;br /&gt;
Following the principle of least privilege, do not use the root user for daily use. Create a non-privileged user account for each person using the system. See [[List of applications/Security#Privilege elevation]] for ways of temporarily gaining privileged access.&lt;br /&gt;
&lt;br /&gt;
=== Enforce a delay after a failed login attempt ===&lt;br /&gt;
&lt;br /&gt;
Add the following line to {{ic|/etc/pam.d/system-login}} to add a delay of at least 4 seconds between failed login attempts:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/pam.d/system-login|2=&lt;br /&gt;
auth optional pam_faildelay.so delay=4000000&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|This line needs to be the first line in the file.}}&lt;br /&gt;
&lt;br /&gt;
{{ic|4000000}} is the time in microseconds to delay.&lt;br /&gt;
&lt;br /&gt;
Other PAM modules besides {{ic|pam_faildelay}} can also suggest such a delay; if multiple modules do so, PAM will use the longest one.&lt;br /&gt;
&lt;br /&gt;
In particular, both {{ic|pam_unix}} and {{ic|pam_faillock}} set a minimum delay of 2 seconds by default.&lt;br /&gt;
In order to completely remove this delay, you need to add the {{ic|nodelay}} parameter to any {{ic|auth}} lines of these modules, for example&lt;br /&gt;
{{hc|/etc/pam.d/system-auth|2=&lt;br /&gt;
auth       [success{{=}}1 default{{=}}bad]     pam_unix.so          try_first_pass nullok nodelay&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Lock out user after three failed login attempts ===&lt;br /&gt;
&lt;br /&gt;
Since {{Pkg|pambase}} 20200721.1-2, {{ic|pam_faillock.so}} is enabled by default to lock out users for 10 minutes after 3 failed login attempts in a 15 minute period (see {{Bug|67644}}). The lockout only applies to password authentication (e.g. login and &#039;&#039;sudo&#039;&#039;), public key authentication over SSH is still accepted. To prevent complete denial-of-service, this lockout is disabled for the root user by default.&lt;br /&gt;
&lt;br /&gt;
To unlock a user, do:&lt;br /&gt;
&lt;br /&gt;
 $ faillock --user &#039;&#039;username&#039;&#039; --reset&lt;br /&gt;
&lt;br /&gt;
By default, the lock mechanism is a file per-user located at {{ic|/run/faillock/}}. Deleting or emptying the file unlocks that user—the directory is owned by root, but the file is owned by the user, so the {{ic|faillock}} command only empties the file, therefore does not require root.&lt;br /&gt;
&lt;br /&gt;
The module {{ic|pam_faillock.so}} can be configured with the file {{ic|1=/etc/security/faillock.conf}}. The lockout parameters:&lt;br /&gt;
&lt;br /&gt;
* {{ic|unlock_time}} — the lockout time (in seconds, default 10 minutes).&lt;br /&gt;
* {{ic|fail_interval}} — the time in which failed logins can cause a lockout (in seconds, default 15 minutes).&lt;br /&gt;
* {{ic|deny}} — the number of failed logins before lockout (default 3).&lt;br /&gt;
&lt;br /&gt;
{{Tip|The primary purpose for the lockout is to slow down brute-force attacks so that they become infeasible. Hence, if lockouts due to mistyping of passwords become too frequent, relaxing the number of attempts may be preferred to reducing the lockout time.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|{{ic|1=deny = 0}} will disable the lockout mechanism entirely.}}&lt;br /&gt;
&lt;br /&gt;
By default, all user locks are lost after reboot. If your attacker can reboot the machine, it is more secure if locks persist. To make locks persist, change the {{ic|dir}} parameter in {{ic|1=/etc/security/faillock.conf}} to {{ic|/var/lib/faillock}}.&lt;br /&gt;
&lt;br /&gt;
No restart is required for changes to take effect. See {{man|5|faillock.conf}} for further configuration options, such as enabling lockout for the root account, disabling for centralized login (e.g. LDAP), etc.&lt;br /&gt;
&lt;br /&gt;
{{Note|If you make locks persistant, following the changes introduced in polkit 127: you may have to relax the sandbox of its helper agent in order to keep it functional. The best way is to create a drop-in for its systemd unit via {{ic|systemctl edit polkit-agent-helper\@.service}} and add:&lt;br /&gt;
&lt;br /&gt;
 [Service]&lt;br /&gt;
 ReadWritePaths{{=}}/var/lib/faillock&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Limit amount of processes ===&lt;br /&gt;
&lt;br /&gt;
On systems with many, or untrusted users, it is important to limit the number of processes each can run at once, therefore preventing [[Wikipedia:Fork bomb|fork bombs]] and other denial of service attacks. The {{ic|/etc/security/limits.conf}} configuration determines how many processes each user, or group can have open, and is empty (except for useful comments) by default. Adding the following lines to this file will limit all users to 100 active processes, unless they use the {{ic|prlimit}} command to explicitly raise their maximum to 200 for that session. These values can be changed according to the appropriate number of processes a user should have running, or the hardware of the box you are administrating.&lt;br /&gt;
&lt;br /&gt;
 * soft nproc 100&lt;br /&gt;
 * hard nproc 200&lt;br /&gt;
&lt;br /&gt;
The current number of threads for each user can be found with {{ic|ps --no-headers -Leo user {{!}} sort {{!}} uniq --count}}. This may help with determining appropriate values for the users&#039; limits; see also [[limits.conf]].&lt;br /&gt;
&lt;br /&gt;
=== Use Wayland ===&lt;br /&gt;
&lt;br /&gt;
Prefer using [[Wayland]] over [[Xorg]]. Xorg&#039;s design predates modern security practices and is [https://security.stackexchange.com/questions/4641/why-are-people-saying-that-the-x-window-system-is-not-secure/4646#4646 considered insecure] by many. For example, Xorg applications may record keystrokes while inactive.&lt;br /&gt;
&lt;br /&gt;
If you must run Xorg, it is recommended to [[Xorg#Rootless Xorg|avoid running it as root]]. Within Wayland, the Xwayland compatibility layer will automatically use rootless Xorg.&lt;br /&gt;
&lt;br /&gt;
== Restricting root ==&lt;br /&gt;
&lt;br /&gt;
The root user is, by definition, the most powerful user on a system. It is also difficult to [[audit]] the root user account. It is therefore important to restrict usage of the root user account as much as possible. There are a number of ways to keep the power of the root user while limiting its ability to cause harm.&lt;br /&gt;
&lt;br /&gt;
=== Use sudo instead of su ===&lt;br /&gt;
&lt;br /&gt;
Using [[sudo]] for privileged access is preferable to [[su]] for a number of reasons:&lt;br /&gt;
&lt;br /&gt;
* It keeps a log of which normal privilege user has run each privileged command.&lt;br /&gt;
* The root user password need not be given out to each user who requires root access.&lt;br /&gt;
* {{ic|sudo}} prevents users from accidentally running commands as &#039;&#039;root&#039;&#039; that do not need root access, because a full root terminal is not created. This aligns with the [[Wikipedia:Principle of least privilege|principle of least privilege]].&lt;br /&gt;
* Individual programs may be enabled per user, instead of offering complete root access just to run one command. &lt;br /&gt;
&lt;br /&gt;
See [[Sudo#Configuration]].&lt;br /&gt;
&lt;br /&gt;
==== Editing files using sudo ====&lt;br /&gt;
&lt;br /&gt;
See [[Sudo#Editing files]]. Alternatively, you can use editors like {{ic|rvim}} or {{ic|rnano}} which have restricted capabilities in order to be safe to run as root.&lt;br /&gt;
&lt;br /&gt;
=== Restricting root login ===&lt;br /&gt;
&lt;br /&gt;
Once [[sudo]] is properly configured, full root access can be heavily restricted or denied without losing much usability. To disable root, but still allowing to use [[sudo]], you can use {{man|1|passwd}} with {{ic|passwd --lock root}}.&lt;br /&gt;
&lt;br /&gt;
==== Allow only certain users ====&lt;br /&gt;
&lt;br /&gt;
The [[PAM]] {{ic|pam_wheel.so}} lets you allow only users in the group {{ic|wheel}} to login using [[su]]. See [[su#su and wheel]].&lt;br /&gt;
&lt;br /&gt;
==== Denying SSH login ====&lt;br /&gt;
&lt;br /&gt;
Even if you do not wish to deny root login for local users, it is always good practice to [[OpenSSH#Deny|deny root login via SSH]]. The purpose of this is to add an additional layer of security before a user can completely compromise your system remotely.&lt;br /&gt;
&lt;br /&gt;
==== Specify acceptable login combinations with access.conf ====&lt;br /&gt;
&lt;br /&gt;
{{Warning|If you are using GNOME 49 or later, you should make sure the group &#039;&#039;gdm&#039;&#039; can log in locally. This can be done with a {{ic|+:(gdm):LOCAL}} rule. [https://gitlab.gnome.org/GNOME/gdm/-/issues/1021]}}&lt;br /&gt;
&lt;br /&gt;
When someone attempts to log in with [[PAM]], {{ic|/etc/security/access.conf}} is checked for the first combination that matches their login properties. Their attempt then fails or succeeds based on the rule for that combination.&lt;br /&gt;
&lt;br /&gt;
 +:root:LOCAL&lt;br /&gt;
 -:root:ALL&lt;br /&gt;
&lt;br /&gt;
Rules can be set for specific groups and users. In this example, the user archie is allowed to login locally, as are all users in the wheel and adm groups. All other logins are rejected:&lt;br /&gt;
&lt;br /&gt;
 +:archie:LOCAL&lt;br /&gt;
 +:(wheel):LOCAL&lt;br /&gt;
 +:(adm):LOCAL&lt;br /&gt;
 -:ALL:ALL&lt;br /&gt;
&lt;br /&gt;
Read more at {{man|5|access.conf}}&lt;br /&gt;
&lt;br /&gt;
== Mandatory access control ==&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:Mandatory Access Control|Mandatory access control]] (MAC) is a type of security policy that differs significantly from the [[Wikipedia:Discretionary Access Control|discretionary access control]] (DAC) used by default in Arch and most Linux distributions. MAC essentially means that every action a program could perform that affects the system in any way is checked against a security ruleset. This ruleset, in contrast to DAC methods, cannot be modified by users. Using virtually any mandatory access control system will significantly improve the security of your computer, although there are differences in how it can be implemented.&lt;br /&gt;
&lt;br /&gt;
=== Pathname MAC ===&lt;br /&gt;
&lt;br /&gt;
Pathname-based access control is a simple form of access control that offers permissions based on the path of a given file. The downside to this style of access control is that permissions are not carried with files if they are moved around the system. On the positive side, pathname-based MAC can be implemented on a much wider range of filesystems, unlike labels-based alternatives.&lt;br /&gt;
&lt;br /&gt;
* [[AppArmor]] is a [[Wikipedia:Canonical (company)|Canonical]]-maintained MAC implementation seen as an &amp;quot;easier&amp;quot; alternative to SELinux.&lt;br /&gt;
* [[TOMOYO]] is another simple, easy-to-use system offering mandatory access control. It is designed to be both simple in usage and in implementation, requiring very few dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Labels MAC ===&lt;br /&gt;
&lt;br /&gt;
Labels-based access control means the extended attributes of a file are used to govern its security permissions. While this system is arguably more flexible in its security offerings than pathname-based MAC, it only works on filesystems that support these extended attributes.&lt;br /&gt;
&lt;br /&gt;
* [[SELinux]], based on an [[Wikipedia:NSA|NSA]] project to improve Linux security, implements MAC completely separate from system users and roles. It offers an extremely robust multi-level MAC policy implementation that can easily maintain control of a system that grows and changes past its original configuration.&lt;br /&gt;
&lt;br /&gt;
=== Access Control Lists ===&lt;br /&gt;
&lt;br /&gt;
[[Access Control Lists]] (ACLs) are an alternative to attaching rules directly to the filesystem in some way. ACLs implement access control by checking program actions against a list of permitted behavior.&lt;br /&gt;
&lt;br /&gt;
== Kernel hardening ==&lt;br /&gt;
&lt;br /&gt;
=== Kernel self-protection / exploit mitigation ===&lt;br /&gt;
&lt;br /&gt;
The {{pkg|linux-hardened}} package uses a [https://github.com/anthraxx/linux-hardened basic kernel hardening patch set] and more security-focused compile-time configuration options than the {{pkg|linux}} package. A custom build can be made to choose a different compromise between security and performance than the security-leaning defaults.&lt;br /&gt;
&lt;br /&gt;
However, it should be noted that several packages (such as {{pkg|throttled}}) will not work when using this kernel.&lt;br /&gt;
&lt;br /&gt;
If you use an out-of-tree driver such as [[NVIDIA]], you may need to switch to its [[DKMS]] package.&lt;br /&gt;
&lt;br /&gt;
==== Userspace ASLR comparison ====&lt;br /&gt;
&lt;br /&gt;
The {{pkg|linux-hardened}} package provides an improved implementation of Address Space Layout Randomization for userspace processes. The {{pkg|paxtest}} command can be used to obtain an estimate of the provided entropy:&lt;br /&gt;
&lt;br /&gt;
===== 64-bit processes =====&lt;br /&gt;
&lt;br /&gt;
{{hc|linux-hardened 5.4.21.a-1-hardened|&lt;br /&gt;
Anonymous mapping randomization test     : 32 quality bits (guessed)&lt;br /&gt;
Heap randomization test (ET_EXEC)        : 40 quality bits (guessed)&lt;br /&gt;
Heap randomization test (PIE)            : 40 quality bits (guessed)&lt;br /&gt;
Main executable randomization (ET_EXEC)  : 32 quality bits (guessed)&lt;br /&gt;
Main executable randomization (PIE)      : 32 quality bits (guessed)&lt;br /&gt;
Shared library randomization test        : 32 quality bits (guessed)&lt;br /&gt;
VDSO randomization test                  : 32 quality bits (guessed)&lt;br /&gt;
Stack randomization test (SEGMEXEC)      : 40 quality bits (guessed)&lt;br /&gt;
Stack randomization test (PAGEEXEC)      : 40 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (SEGMEXEC)    : 44 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (PAGEEXEC)    : 44 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_EXEC): 34 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_DYN) : 34 quality bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @~0: 32 bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @0 : 32 bits (guessed)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{hc|linux 5.5.5-arch1-1|&lt;br /&gt;
Anonymous mapping randomization test     : 28 quality bits (guessed)&lt;br /&gt;
Heap randomization test (ET_EXEC)        : 28 quality bits (guessed)&lt;br /&gt;
Heap randomization test (PIE)            : 28 quality bits (guessed)&lt;br /&gt;
Main executable randomization (ET_EXEC)  : 28 quality bits (guessed)&lt;br /&gt;
Main executable randomization (PIE)      : 28 quality bits (guessed)&lt;br /&gt;
Shared library randomization test        : 28 quality bits (guessed)&lt;br /&gt;
VDSO randomization test                  : 20 quality bits (guessed)&lt;br /&gt;
Stack randomization test (SEGMEXEC)      : 30 quality bits (guessed)&lt;br /&gt;
Stack randomization test (PAGEEXEC)      : 30 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (SEGMEXEC)    : 22 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (PAGEEXEC)    : 22 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_EXEC): 28 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_DYN) : 28 quality bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @~0: 29 bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @0 : 29 bits (guessed)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{hc|linux-lts 4.19.101-1-lts|&lt;br /&gt;
Anonymous mapping randomization test     : 28 quality bits (guessed)&lt;br /&gt;
Heap randomization test (ET_EXEC)        : 28 quality bits (guessed)&lt;br /&gt;
Heap randomization test (PIE)            : 28 quality bits (guessed)&lt;br /&gt;
Main executable randomization (ET_EXEC)  : 28 quality bits (guessed)&lt;br /&gt;
Main executable randomization (PIE)      : 28 quality bits (guessed)&lt;br /&gt;
Shared library randomization test        : 28 quality bits (guessed)&lt;br /&gt;
VDSO randomization test                  : 19 quality bits (guessed)&lt;br /&gt;
Stack randomization test (SEGMEXEC)      : 30 quality bits (guessed)&lt;br /&gt;
Stack randomization test (PAGEEXEC)      : 30 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (SEGMEXEC)    : 22 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (PAGEEXEC)    : 22 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_EXEC): 28 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_DYN) : 28 quality bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @~0: 28 bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @0 : 28 bits (guessed)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== 32-bit processes (on an x86_64 kernel) =====&lt;br /&gt;
&lt;br /&gt;
{{hc|linux-hardened|&lt;br /&gt;
Anonymous mapping randomization test     : 16 quality bits (guessed)&lt;br /&gt;
Heap randomization test (ET_EXEC)        : 22 quality bits (guessed)&lt;br /&gt;
Heap randomization test (PIE)            : 27 quality bits (guessed)&lt;br /&gt;
Main executable randomization (ET_EXEC)  : No randomization&lt;br /&gt;
Main executable randomization (PIE)      : 18 quality bits (guessed)&lt;br /&gt;
Shared library randomization test        : 16 quality bits (guessed)&lt;br /&gt;
VDSO randomization test                  : 16 quality bits (guessed)&lt;br /&gt;
Stack randomization test (SEGMEXEC)      : 24 quality bits (guessed)&lt;br /&gt;
Stack randomization test (PAGEEXEC)      : 24 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (SEGMEXEC)    : 28 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (PAGEEXEC)    : 28 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_EXEC): 18 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_DYN) : 16 quality bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @~0: 18 bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @0 : 18 bits (guessed)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{hc|linux|&lt;br /&gt;
Anonymous mapping randomization test     : 8 quality bits (guessed)&lt;br /&gt;
Heap randomization test (ET_EXEC)        : 13 quality bits (guessed)&lt;br /&gt;
Heap randomization test (PIE)            : 13 quality bits (guessed)&lt;br /&gt;
Main executable randomization (ET_EXEC)  : No randomization&lt;br /&gt;
Main executable randomization (PIE)      : 8 quality bits (guessed)&lt;br /&gt;
Shared library randomization test        : 8 quality bits (guessed)&lt;br /&gt;
VDSO randomization test                  : 8 quality bits (guessed)&lt;br /&gt;
Stack randomization test (SEGMEXEC)      : 19 quality bits (guessed)&lt;br /&gt;
Stack randomization test (PAGEEXEC)      : 19 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (SEGMEXEC)    : 11 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (PAGEEXEC)    : 11 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_EXEC): 8 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_DYN) : 13 quality bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @~0: No randomization&lt;br /&gt;
Randomization under memory exhaustion @0 : No randomization&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Restricting access to kernel pointers in the proc filesystem ===&lt;br /&gt;
&lt;br /&gt;
Setting {{ic|kernel.kptr_restrict}} to 1 will hide kernel symbol addresses in {{ic|/proc/kallsyms}} from regular users without {{ic|CAP_SYSLOG}}, making it more difficult for kernel exploits to resolve addresses/symbols dynamically. This will not help that much on a pre-compiled Arch Linux kernel, since a determined attacker could just download the kernel package and get the symbols manually from there, but if you are compiling your own kernel, this can help mitigating local root exploits. This will break some {{Pkg|perf}} commands when used by non-root users (but many {{Pkg|perf}} features require root access anyway). See {{Bug|34323}} for more information.&lt;br /&gt;
&lt;br /&gt;
Setting {{ic|kernel.kptr_restrict}} to 2 will hide kernel symbol addresses in {{ic|/proc/kallsyms}} regardless of privileges.&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/sysctl.d/51-kptr-restrict.conf|2=&lt;br /&gt;
kernel.kptr_restrict = 1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|{{pkg|linux-hardened}} sets {{ic|1=kptr_restrict=2}} by default rather than {{ic|0}}.}}&lt;br /&gt;
&lt;br /&gt;
=== BPF hardening ===&lt;br /&gt;
&lt;br /&gt;
BPF is a system used to load and execute bytecode within the kernel dynamically during runtime. It is used in a number of Linux kernel subsystems such as networking (e.g. XDP, tc), tracing (e.g. kprobes, uprobes, tracepoints) and security (e.g. seccomp). It is also useful for advanced network security, performance profiling and dynamic tracing.&lt;br /&gt;
&lt;br /&gt;
BPF was originally an acronym of [[Wikipedia:Berkeley Packet Filter|Berkeley Packet Filter]] since the original classic BPF was used for packet capture tools for BSD. This eventually evolved into Extended BPF (eBPF), which was shortly afterwards renamed to just BPF (not an acronym). BPF should not be confused with packet filtering tools like iptables or netfilter, although BPF can be used to implement packet filtering tools.&lt;br /&gt;
&lt;br /&gt;
BPF code may be either interpreted or compiled using a [[Wikipedia:Just-in-time compilation|Just-In-Time (JIT) compiler]]. The Arch kernel is built with {{ic|CONFIG_BPF_JIT_ALWAYS_ON}} which disables the BPF interpreter and forces all BPF to use JIT compilation. This makes it harder for an attacker to use BPF to escalate attacks that exploit SPECTRE-style vulnerabilities. See [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=290af86629b25ffd1ed6232c4e9107da031705cb the kernel patch which introduced CONFIG_BPF_JIT_ALWAYS_ON] for more details.&lt;br /&gt;
&lt;br /&gt;
The kernel includes a hardening feature for JIT-compiled BPF which can mitigate some types of JIT spraying attacks at the cost of performance and the ability to trace and debug many BPF programs. It may be enabled by setting {{ic|net.core.bpf_jit_harden}} to {{ic|1}} (to enable hardening of unprivileged code) or {{ic|2}} (to enable hardening of all code).&lt;br /&gt;
&lt;br /&gt;
See the {{ic|net.core.bpf_*}} settings in the [https://docs.kernel.org/admin-guide/sysctl/net.html kernel documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
{{Tip|&lt;br /&gt;
* {{Pkg|linux-hardened}} sets {{ic|1=net.core.bpf_jit_harden=2}} by default rather than {{ic|0}}.&lt;br /&gt;
* By default, BPF programs can be run even by unprivileged users. To change that behaviour set {{ic|1=kernel.unprivileged_bpf_disabled=1}}[https://access.redhat.com/security/cve/cve-2021-33624].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== ptrace scope ===&lt;br /&gt;
&lt;br /&gt;
The {{man|2|ptrace}} syscall provides a means by which one process (the &amp;quot;tracer&amp;quot;) may observe and control the execution of another process (the &amp;quot;tracee&amp;quot;), and examine and change the tracee&#039;s memory and registers. {{ic|ptrace}} is commonly used by debugging tools including &#039;&#039;gdb&#039;&#039;, &#039;&#039;strace&#039;&#039;, &#039;&#039;perf&#039;&#039;, &#039;&#039;reptyr&#039;&#039; and other debuggers. However, it also provides a means by which a malicious process can read data from and take control of other processes.&lt;br /&gt;
&lt;br /&gt;
Arch enables the [https://docs.kernel.org/admin-guide/LSM/Yama.html Yama LSM] by default, which provides a {{ic|kernel.yama.ptrace_scope}} [[kernel parameter]]. This parameter is set to {{ic|1}} (restricted) by default which prevents tracers from performing a {{ic|ptrace}} call on traces outside of a restricted scope unless the tracer is privileged or has the {{ic|CAP_SYS_PTRACE}} [[Capabilities|capability]]. This is a significant improvement in security compared to the classic permissions. Without this module, there is no separation between processes running as the same user (in the absence of additional security layers such as {{man|7|pid_namespaces}}).&lt;br /&gt;
&lt;br /&gt;
{{Note|By default, you can still use tools which require {{ic|ptrace}} by running them as privileged processes, e.g. using [[sudo]].}}&lt;br /&gt;
&lt;br /&gt;
If you do not need to use debugging tools, consider setting {{ic|kernel.yama.ptrace_scope}} to {{ic|2}} (admin-only) or {{ic|3}} (no {{ic|ptrace}} possible) to harden the system.&lt;br /&gt;
&lt;br /&gt;
{{Note|Some anti-cheat and DRM implementations rely on {{ic|ptrace}} to work, including Easy Anti-Cheat and Ubisoft Connect under Wine. Setting this parameter to {{ic|2}} or higher might prevent games using these solutions from launching.}}&lt;br /&gt;
&lt;br /&gt;
=== hidepid ===&lt;br /&gt;
&lt;br /&gt;
{{Expansion|1=[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0fb5ce62c5920b6e0a8a061f2fe80e0403281e10 Linux 5.8 implemented private instances] and new values for {{ic|1=hidepid=}}.}}&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|Enabling {{ic|hidepid}} globally is not a supported way of operation by [[systemd]], nor does it have any practical improvements security-wise when systemd is running as service manager. [https://github.com/systemd/systemd/issues/29893#issuecomment-1798030108]}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|&lt;br /&gt;
* This may cause issues for certain applications like an application running in a sandbox and [[Xorg]] (see workaround).&lt;br /&gt;
* This causes issues with [[D-Bus]], [[Polkit]], [[PulseAudio]] and [[bluetooth]] when using {{Pkg|systemd}} &amp;gt; 237.64-1.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The kernel has the ability to hide other users&#039; processes, normally accessible via {{ic|/proc}}, from unprivileged users by mounting the {{ic|proc}} filesystem with the {{ic|1=hidepid=}} and {{ic|1=gid=}} options documented in https://docs.kernel.org/filesystems/proc.html.&lt;br /&gt;
&lt;br /&gt;
This greatly complicates an intruder&#039;s task of gathering information about running processes, whether some daemon runs with elevated privileges, whether other user runs some sensitive program, whether other users run any program at all, makes it impossible to learn whether any user runs a specific program (given the program does not reveal itself by its behaviour), and, as an additional bonus, poorly written programs passing sensitive information via program arguments are now protected against local eavesdroppers.&lt;br /&gt;
&lt;br /&gt;
The {{ic|proc}} [[Users and groups#System groups|group]], provided by the {{Pkg|filesystem}} package, acts as a whitelist of users authorized to learn other users&#039; process information. If users or services need access to {{ic|/proc/&amp;lt;pid&amp;gt;}} directories beyond their own, [[Users and groups#Group management|add them to the group]].&lt;br /&gt;
&lt;br /&gt;
For example, to hide process information from other users except those in the {{ic|proc}} group:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/fstab|2=&lt;br /&gt;
proc	/proc	proc	nosuid,nodev,noexec,hidepid=2,gid=proc	0	0&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
For user sessions to work correctly, an exception needs to be added for &#039;&#039;systemd-logind&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/systemd/system/systemd-logind.service.d/hidepid.conf|2=&lt;br /&gt;
[Service]&lt;br /&gt;
SupplementaryGroups=proc&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Restricting module loading ===&lt;br /&gt;
&lt;br /&gt;
The default Arch kernel has {{ic|CONFIG_MODULE_SIG_ALL}} enabled, which signs all kernel modules built as part of the {{Pkg|linux}} package. This allows the kernel to only load modules signed with a valid key, i.e. out-of-tree modules compiled locally or provided by packages such as {{Pkg|virtualbox-host-modules-arch}} cannot be loaded. You can use {{ic|1=modinfo}} to verify currently loaded modules have signatures; verifying the signatures by hand is slightly more involved [https://unix.stackexchange.com/a/496800].&lt;br /&gt;
&lt;br /&gt;
Kernel module loading can be restricted by setting the {{ic|1=module.sig_enforce=1}} [[kernel parameter]]. More information can be found in the [https://docs.kernel.org/admin-guide/module-signing.html kernel documentation].&lt;br /&gt;
&lt;br /&gt;
Further, unneeded individual modules can be [[blacklist]]ed, see [https://github.com/secureblue/secureblue/blob/live/files/system/usr/lib/modprobe.d/secureblue.conf secureblue] for examples.&lt;br /&gt;
&lt;br /&gt;
=== Disable kexec ===&lt;br /&gt;
&lt;br /&gt;
Kexec allows replacing the current running kernel.&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/sysctl.d/51-kexec-restrict.conf|2=&lt;br /&gt;
kernel.kexec_load_disabled = 1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|kexec is disabled by default in {{pkg|linux-hardened}}.}}&lt;br /&gt;
&lt;br /&gt;
=== Kernel lockdown mode ===&lt;br /&gt;
&lt;br /&gt;
Linux supports an optional [https://mjg59.dreamwidth.org/55105.html lockdown feature], intended to strengthen the boundary between UID 0 (root) and the kernel. When enabled some applications may cease to work which rely on low-level access to either hardware or the kernel.&lt;br /&gt;
&lt;br /&gt;
To use lockdown, its LSM must be initialized and a lockdown mode must be set.&lt;br /&gt;
&lt;br /&gt;
All [[Kernel#Officially supported kernels|officially supported kernels]] initialize the LSM, but none of them enforce any lockdown mode.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Initialized LSMs can be verified by running {{ic|cat /sys/kernel/security/lsm}}.}}&lt;br /&gt;
&lt;br /&gt;
Lockdown has two modes of operation:&lt;br /&gt;
&lt;br /&gt;
* {{ic|integrity}}: kernel features that allow userland to modify the running kernel are disabled (e.g. kexec, bpf).&lt;br /&gt;
* {{ic|confidentiality}}: kernel features that allow userland to extract confidential information from the kernel are also disabled.&lt;br /&gt;
&lt;br /&gt;
It is recommended to use {{ic|integrity}}, unless your specific threat model dictates otherwise.&lt;br /&gt;
&lt;br /&gt;
To enable kernel lockdown at runtime, run:&lt;br /&gt;
&lt;br /&gt;
 # echo &#039;&#039;mode&#039;&#039; &amp;gt; /sys/kernel/security/lockdown&lt;br /&gt;
&lt;br /&gt;
To enable kernel lockdown on boot, use the [[kernel parameter]] {{ic|1=lockdown=&#039;&#039;mode&#039;&#039;}}.&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* Kernel lockdown cannot be disabled at runtime.&lt;br /&gt;
* Kernel lockdown disables [[hibernation]].&lt;br /&gt;
* Versions &amp;lt;6.17 of the {{man|7|kernel_lockdown}} man page incorrectly state that &amp;quot;lockdown will be automatically enabled if the system boots in EFI Secure Boot mode&amp;quot;. This is not the behaviour of the upstream kernel, nor Arch&#039;s packaged [[kernel]]s.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
See also {{man|7|kernel_lockdown}}.&lt;br /&gt;
&lt;br /&gt;
=== Linux Kernel Runtime Guard (LKRG) ===&lt;br /&gt;
&lt;br /&gt;
[https://www.openwall.com/lkrg/ LKRG] ({{AUR|lkrg-dkms}}) is a kernel module which performs integrity checking of the kernel and detection of exploit attempts.&lt;br /&gt;
&lt;br /&gt;
=== Disable emergency shell ===&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|Masking {{ic|emergency.target}} and {{ic|emergency.service}} will have no effect on those units being added to the initramfs and run in early userspace. Even with them in the initramfs, mkinitcpio&#039;s systemd hook locks the root account[https://gitlab.archlinux.org/archlinux/packaging/packages/systemd/-/commit/292cdf8a2f7dd7c6c7d91d2b59617391935c837c][https://gitlab.archlinux.org/archlinux/packaging/packages/systemd/-/commit/8835b2f5dfbe8663f1a2fd08edbd35f90bf08691] for &amp;quot;security reasons&amp;quot; (see {{Bug|70408}}). The solution for the issue in the linked article, if even needed, would be to prevent {{ic|rescue.target}}, {{ic|rescue.service}}, {{ic|emergency.target}} and {{ic|emergency.service}} from being added to the initramfs image.}}&lt;br /&gt;
&lt;br /&gt;
The emergency shell is used to interactively troubleshoot the machine during the boot process. However, it is also a gadget that an attacker can use to access secure resources such as the TPM. See [https://pulsesecurity.co.nz/advisories/tpm-luks-bypass this article] for a practical example. The difficulty of attacks can be increased by disabling the emergency shell, at the tradeoff of removing a tool to troubleshoot early boot failures.&lt;br /&gt;
&lt;br /&gt;
To disable the emergency shell, See [[systemd#Disable emergency mode on remote machine]].&lt;br /&gt;
&lt;br /&gt;
== Sandboxing applications ==&lt;br /&gt;
&lt;br /&gt;
See also [[Wikipedia:Sandbox (computer security)]].&lt;br /&gt;
&lt;br /&gt;
To improve the security of systemd service units, see [[systemd/Sandboxing]].&lt;br /&gt;
&lt;br /&gt;
{{Warning|Unprivileged user namespace usage is enabled by default in all [[Kernel#Officially supported kernels|officially supported kernels]] except for {{Pkg|linux-hardened}}. Unprivileged user namespaces greatly increase the attack surface for local privilege escalation; see [https://gitlab.com/apparmor/apparmor/-/wikis/unprivileged_userns_restriction AppArmor&#039;s Wiki] and {{Bug|36969}}.}}&lt;br /&gt;
&lt;br /&gt;
To mitigate this, either:&lt;br /&gt;
	&lt;br /&gt;
* use the {{Pkg|linux-hardened}} kernel which has the safe default, or&lt;br /&gt;
* set the {{ic|kernel.unprivileged_userns_clone}} [[sysctl]] to {{ic|0}}.&lt;br /&gt;
	&lt;br /&gt;
Note that this can break applications such as {{pkg|nsjail}}. [[Chromium]] based applications need SUID bit for {{ic|chrome-sandbox}} to work with this setting.&lt;br /&gt;
&lt;br /&gt;
=== Firejail ===&lt;br /&gt;
&lt;br /&gt;
[[Firejail]] is an easy to use tool for sandboxing applications and servers alike. It was originally created for browsers and internet facing applications, but supports a large number of applications by now. To establish a sandboxed environment with a variety of features, it is installed as a suid binary and builds a sandboxed runtime environment for the target application based on black and white lists.&lt;br /&gt;
&lt;br /&gt;
=== bubblewrap ===&lt;br /&gt;
&lt;br /&gt;
[[bubblewrap]] is a sandbox application developed for unprivileged container tools like [[Flatpak]] with a significantly smaller resource footprint and complexity than Firejail. While it lacks certain features such as file path whitelisting, bubblewrap does offer bind mounts as well as the creation of user/IPC/PID/network/cgroup namespaces and can support both simple and complex sandboxes. For the {{Pkg|linux-hardened}} kernel you will need to to use {{Pkg|bubblewrap-suid}}.&lt;br /&gt;
&lt;br /&gt;
[[Bubblejail]] sandbox is based on [[bubblewrap]] and provides a resource oriented permission model with a graphical interface to tweak permissions.&lt;br /&gt;
&lt;br /&gt;
=== Portable ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Kraftland/portable Portable] is a sandboxing framework which utilizes [[bubblewrap]] and many other tools to lockdown running applications. It is designed to be simple for packagers and efficient for users, yet cuts off security holes and monitors background processes by default.&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/Kraftland/portable-arch portable-arch] for a repository of applications sandboxed by portable.&lt;br /&gt;
&lt;br /&gt;
If a sandboxed application does not utilize the Portal file chooser, portable can pass files to the sandbox (by passing {{ic|--actions share-files}}).&lt;br /&gt;
&lt;br /&gt;
Portable is fully functional on GNOME, while other desktops may lack small amounts of features like advanced background monitoring and ScreenShot portal.&lt;br /&gt;
&lt;br /&gt;
=== chroots ===&lt;br /&gt;
&lt;br /&gt;
Manual [[chroot]] jails can also be constructed to build sandboxed process environments. It is much more limited than other sandboxing technologies; the extent of its sandboxing is file path isolation.&lt;br /&gt;
&lt;br /&gt;
=== Linux containers ===&lt;br /&gt;
&lt;br /&gt;
[[Linux Containers]] are another good option when you need more separation than the other options (short of [[#Full virtualization options|full system virtualization]]) provide. LXC is run on top of the existing kernel in a pseudo-chroot with their own virtual hardware.&lt;br /&gt;
&lt;br /&gt;
=== gVisor ===&lt;br /&gt;
&lt;br /&gt;
The [https://gvisor.dev/ gVisor] project, led by Google, is providing a sandboxing application with a focus on containers following the [https://opencontainers.org/ OCI initiative], such as [[Docker]] and [[Kubernetes]]. It isolates containers and individual applications from the host by intercepting a majority of system calls to the kernel and presenting itself as guest kernel.&lt;br /&gt;
&lt;br /&gt;
A key difference to other intercepting sandboxing projects is that gVisor re-implements system calls in the Go programming language, as described in its [https://gvisor.dev/docs/architecture_guide/intro/ design overview]. Details for the list of [https://gvisor.dev/docs/user_guide/compatibility/linux/amd64/ re-implemented syscalls support] can be seen in [https://github.com/google/gvisor/blob/master/pkg/sentry/syscalls/linux/linux64.go git]. For usage examples, limitations and special features see the project [https://gvisor.dev/docs/ documentation].&lt;br /&gt;
&lt;br /&gt;
The application is available as {{Aur|gvisor-git}} and {{Aur|gvisor-bin}}.&lt;br /&gt;
&lt;br /&gt;
=== Full virtualization options ===&lt;br /&gt;
&lt;br /&gt;
Using full virtualization options such as [[VirtualBox]], [[KVM]], [[Xen]] or [https://www.qubes-os.org/ Qubes OS] (based on Xen) can also improve isolation and security in the event you plan on running risky applications or browsing dangerous websites.&lt;br /&gt;
&lt;br /&gt;
== Network and firewalls ==&lt;br /&gt;
&lt;br /&gt;
=== Firewalls ===&lt;br /&gt;
&lt;br /&gt;
While the stock Arch kernel is capable of using [[Wikipedia:Netfilter|Netfilter]]&#039;s [[iptables]] and [[nftables]], the services are not [[enable]]d by default. It is highly recommended to set up some form of firewall to protect the services running on the system. Many resources (including ArchWiki) do not state explicitly which services are worth protecting, so enabling a firewall is a good precaution.&lt;br /&gt;
&lt;br /&gt;
* See [[iptables]] and [[nftables]] for general information.&lt;br /&gt;
* See [[Simple stateful firewall]] for a guide on setting up an iptables firewall.&lt;br /&gt;
* See [[:Category:Firewalls]] for other ways of setting up netfilter.&lt;br /&gt;
* See [[Ipset]] for blocking lists of ip addresses, such as those from Bluetack.&lt;br /&gt;
* {{Pkg|opensnitch}} is a configurable inbound and outbound firewall with support for configurable rules by application, port, host, etc.&lt;br /&gt;
&lt;br /&gt;
A quick way to setup a basic firewall is to use the tool {{ic|ufw}} (Uncomplicated Fire Wall). Then set {{ic|ufw default deny incoming}} and {{ic|ufw default allow outgoing}} and enabling it with {{ic|ufw enable}} and {{ic|systemctl enable ufw}}.&lt;br /&gt;
&lt;br /&gt;
==== Open ports ====&lt;br /&gt;
&lt;br /&gt;
{{Style|&amp;quot;Open ports&amp;quot; is not a good title since it disregards interfaces and addresses that the application may be bound to. From the firewalls&#039; point of view, ports may be &amp;quot;open&amp;quot; even if no application listens on them at the moment.}}&lt;br /&gt;
&lt;br /&gt;
Some services listen for inbound traffic on open network ports. It is important to only bind these services to the addresses and interfaces that are strictly necessary. It may be possible for a remote attacker to [https://samy.pl/slipstream/ exploit flawed network protocols to access exposed services]. This can even happen with [https://nvd.nist.gov/vuln/detail/CVE-2019-13450 processes bound to localhost].&lt;br /&gt;
&lt;br /&gt;
In general, if a service only needs to be accessible to the local system, bind to a Unix domain socket ({{man|7|unix}}) or a loopback address such as {{ic|localhost}} instead of a non-loopback address like {{ic|0.0.0.0/0}}.&lt;br /&gt;
&lt;br /&gt;
If a service needs to be accessible to other systems via the network, control the access with strict [[firewall]] rules and configure authentication, authorization and encryption whenever possible.&lt;br /&gt;
&lt;br /&gt;
You can list all current open ports with {{ic|ss -l}}. To show all &#039;&#039;&#039;l&#039;&#039;&#039;istening &#039;&#039;&#039;p&#039;&#039;&#039;rocesses and their &#039;&#039;&#039;n&#039;&#039;&#039;umeric &#039;&#039;&#039;t&#039;&#039;&#039;cp and &#039;&#039;&#039;u&#039;&#039;&#039;dp port numbers:&lt;br /&gt;
&lt;br /&gt;
 # ss -lpntu&lt;br /&gt;
&lt;br /&gt;
See {{man|8|ss}} for more options.&lt;br /&gt;
&lt;br /&gt;
=== Kernel parameters ===&lt;br /&gt;
&lt;br /&gt;
Kernel parameters which affect networking can be set using [[Sysctl]]. For how to do this, see [[Sysctl#TCP/IP stack hardening]].&lt;br /&gt;
&lt;br /&gt;
=== SSH ===&lt;br /&gt;
&lt;br /&gt;
To mitigate [[Wikipedia:Brute-force attack|brute-force attacks]] it is recommended to enforce key-based authentication. For OpenSSH see [[OpenSSH#Protection]] for more recommendations. Alternatively [[Fail2ban]] or [[Sshguard]] offer lesser forms of protection by monitoring logs and writing [[firewall]] rules but open up the potential for a denial of service, since an attacker can [[Wikipedia:Spoofing attack#Spoofing and TCP/IP|spoof]] packets as if they came from the administrator after identifying their address. Spoofing IP has lines of defense, such as by [[sysctl#Reverse path filtering|reverse path filtering]] and [[sysctl#Disable ICMP redirects|disabling ICMP redirects]].&lt;br /&gt;
&lt;br /&gt;
You may want to harden authentication even more by using two-factor authentication. [[Google Authenticator]] provides a two-step authentication procedure using one-time passcodes (OTP).&lt;br /&gt;
&lt;br /&gt;
Denying root login is also a good practice, both for tracing intrusions and adding an additional layer of security before root access. For OpenSSH, see [[OpenSSH#Deny]].&lt;br /&gt;
&lt;br /&gt;
Mozilla publishes an [https://infosec.mozilla.org/guidelines/openssh.html OpenSSH configuration guide] which configures more verbose audit logging and restricts ciphers.&lt;br /&gt;
&lt;br /&gt;
=== DNS ===&lt;br /&gt;
&lt;br /&gt;
The default domain name resolution (DNS) configuration is highly compatible but has security weaknesses. See [[Domain name resolution#Privacy and security|DNS privacy and security]] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Proxies ===&lt;br /&gt;
&lt;br /&gt;
Proxies are commonly used as an extra layer between applications and the network, sanitizing data from untrusted sources. The attack surface of a small proxy running with lower privileges is significantly smaller than a complex application running with the end user privileges.&lt;br /&gt;
&lt;br /&gt;
For example the DNS resolver is implemented in {{Pkg|glibc}}, that is linked with the application (that may be running as root), so a bug in the DNS resolver might lead to a remote code execution. This can be prevented by installing a DNS caching server, such as [[dnsmasq]], which acts as a proxy. [https://googleonlinesecurity.blogspot.it/2016/02/cve-2015-7547-glibc-getaddrinfo-stack.html]&lt;br /&gt;
&lt;br /&gt;
=== Managing TLS certificates ===&lt;br /&gt;
&lt;br /&gt;
See [[TLS#Trust management]].&lt;br /&gt;
&lt;br /&gt;
== Physical security ==&lt;br /&gt;
&lt;br /&gt;
Physical access to a computer is root access given enough time and resources. However, a high &#039;&#039;practical&#039;&#039; level of security can be obtained by putting up enough barriers.&lt;br /&gt;
&lt;br /&gt;
An attacker can gain full control of your computer on the next boot by simply attaching a malicious IEEE 1394 (FireWire), Thunderbolt or PCI Express device as they are given full memory access by default.[https://web.archive.org/web/20210312083421/http://breaknenter.org/2014/09/inception-metasploit-integration/] For Thunderbolt, you can restrict the direct memory access completely or to known devices, see [[Thunderbolt#User device authorization|user device authorization]]. For Firewire and PCI Express, there is little you can do from preventing this, or modification of the hardware itself - such as flashing malicious firmware onto a drive. However, the vast majority of attackers will not be this knowledgeable and determined.&lt;br /&gt;
&lt;br /&gt;
[[#Data-at-rest encryption|Data-at-rest encryption]] will prevent access to your data if the computer is stolen, but malicious firmware can be installed to obtain this data upon your next log in by a resourceful attacker.&lt;br /&gt;
&lt;br /&gt;
=== Locking down BIOS ===&lt;br /&gt;
&lt;br /&gt;
Adding a password to the BIOS prevents someone from booting into removable media, which is basically the same as having root access to your computer. You should make sure your drive is first in the boot order and disable the other drives from being bootable if you can.&lt;br /&gt;
&lt;br /&gt;
=== Boot loaders ===&lt;br /&gt;
&lt;br /&gt;
It is highly important to protect your [[boot loader]]. An unprotected boot loader can bypass any login restrictions, e.g. by setting the {{ic|1=init=/bin/sh}} [[kernel parameter]] to boot directly to a shell.&lt;br /&gt;
&lt;br /&gt;
==== Syslinux ====&lt;br /&gt;
&lt;br /&gt;
[[Syslinux]] supports [[Syslinux#Security|password-protecting your boot loader]]. It allows you to set either a per-menu-item password or a global boot loader password.&lt;br /&gt;
&lt;br /&gt;
==== GRUB ====&lt;br /&gt;
&lt;br /&gt;
[[GRUB]] supports boot loader passwords as well. See [[GRUB/Tips and tricks#Password protection of GRUB menu]] for details. It also has support for [[GRUB#Encrypted /boot|encrypted /boot]], which only leaves some parts of the boot loader code unencrypted. GRUB&#039;s configuration, [[kernel]] and [[initramfs]] are encrypted.&lt;br /&gt;
&lt;br /&gt;
==== systemd-boot ====&lt;br /&gt;
&lt;br /&gt;
[[systemd-boot]] disables editing of kernel parameters when [[#Secure Boot|Secure Boot]] is enabled. Alternatively, you can set [[systemd-boot#Kernel parameters editor with password protection|kernel parameters for password protection]] in systemd-boot for a more traditional password-based option.&lt;br /&gt;
&lt;br /&gt;
=== Secure Boot ===&lt;br /&gt;
&lt;br /&gt;
[[Secure Boot]] is a feature of [[UEFI]] that allows authentication of the files your computer boots. This helps preventing some [[Wikipedia:Evil maid attack|evil maid attacks]] such as replacing files inside the boot partition. Normally computers come with keys that are enrolled by vendors (OEM). However these can be removed and allow the computer to enter &#039;&#039;Setup Mode&#039;&#039; which allows the user to enroll and manage their own keys.&lt;br /&gt;
&lt;br /&gt;
The secure boot page guides you through how to set secure boot up by [[Unified Extensible Firmware Interface/Secure Boot#Using your own keys|using your own keys]].&lt;br /&gt;
&lt;br /&gt;
=== Trusted Platform Module (TPM) ===&lt;br /&gt;
&lt;br /&gt;
[[Trusted Platform Module|TPMs]] are hardware microprocessors which have cryptographic keys embedded. This forms the fundamental root of trust of most modern computers and allows end-to-end verification of the boot chain. They can be used as internal smartcards, attest the firmware running on the computer and allow users to insert secrets into a tamper-proof and brute-force resistant store.&lt;br /&gt;
&lt;br /&gt;
=== Boot partition on removable flash drive ===&lt;br /&gt;
&lt;br /&gt;
One popular idea is to place the boot partition on a flash drive in order to render the system unbootable without it. Proponents of this idea often use [[#Data-at-rest encryption|full-disk encryption]] alongside, and some also use [[Dm-crypt/Specialties#Encrypted system using a detached LUKS header|detached encryption headers]] placed on the boot partition.&lt;br /&gt;
&lt;br /&gt;
This method can also be merged with [[Dm-crypt/Specialties#Encrypted /boot and a detached LUKS header on USB|encrypting /boot]].&lt;br /&gt;
&lt;br /&gt;
=== Automatic logout ===&lt;br /&gt;
&lt;br /&gt;
If you are using [[Bash]] or [[Zsh]], you can set {{ic|TMOUT}} for an automatic logout from shells after a timeout.&lt;br /&gt;
&lt;br /&gt;
For example, the following will automatically log out from virtual consoles (but not terminal emulators in X11):&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/profile.d/shell-timeout.sh|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
TMOUT=&amp;quot;$(( 60*10 ))&amp;quot;;&lt;br /&gt;
[ -z &amp;quot;$DISPLAY&amp;quot; ] &amp;amp;&amp;amp; export TMOUT;&lt;br /&gt;
case $( /usr/bin/tty ) in&lt;br /&gt;
	/dev/tty[0-9]*) export TMOUT;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
If you really want EVERY Bash/Zsh prompt (even within X) to timeout, use:&lt;br /&gt;
&lt;br /&gt;
 $ export TMOUT=&amp;quot;$(( 60*10 ))&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
Note that this will not work if there is some command running in the shell (eg.: an SSH session or other shell without {{ic|TMOUT}} support). But if you are using VC mostly for restarting frozen GDM/Xorg as root, then this is very useful.&lt;br /&gt;
&lt;br /&gt;
=== Protect against rogue USB devices ===&lt;br /&gt;
&lt;br /&gt;
The kernel has [https://docs.kernel.org/usb/authorization.html settings to deactivate] USB ports to protect your computer against rogue USB devices (a.k.a. [[Wikipedia:BadUSB|BadUSB]], [https://github.com/samyk/poisontap PoisonTap] or [https://lanturtle.com/ LanTurtle]). They can be set at runtime and automated via [[sysctl]].&lt;br /&gt;
&lt;br /&gt;
For more control install [[USBGuard]], which is a software framework implementing basic whitelisting and blacklisting capabilities based on device attributes.&lt;br /&gt;
&lt;br /&gt;
=== Volatile data collection ===&lt;br /&gt;
&lt;br /&gt;
A computer that is powered on may be vulnerable to [https://web.archive.org/web/20210420075636/https://fedvte.usalearning.gov/courses/CSI/course/videos/pdf/CSI_D01_S05_T01_STEP.pdf volatile data collection]. It is a best practice to turn a computer completely off at times it is not necessary for it to be on, or if the computer&#039;s physical security is temporarily compromised (e.g. when passing through a security checkpoint).&lt;br /&gt;
&lt;br /&gt;
== Packages ==&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
[https://www2.cs.arizona.edu/stork/packagemanagersecurity/attacks-on-package-managers.html#overview Attacks on package managers] are possible without proper use of package signing, and can affect even package managers with [https://www2.cs.arizona.edu/stork/packagemanagersecurity/faq.html proper signature systems]. Arch uses package signing by default and relies on a web of trust from 5 trusted master keys. See [[Pacman-key]] for details.&lt;br /&gt;
&lt;br /&gt;
=== Upgrades ===&lt;br /&gt;
&lt;br /&gt;
It is important to regularly [[System maintenance#Upgrading the system|upgrade the system]].&lt;br /&gt;
&lt;br /&gt;
=== Follow vulnerability alerts ===&lt;br /&gt;
&lt;br /&gt;
Subscribe to the Common Vulnerabilities and Exposure (CVE) Security Alert updates, made available by National Vulnerability Database, and found on the [https://nvd.nist.gov/download.cfm NVD Download webpage]. &lt;br /&gt;
&lt;br /&gt;
The tool {{Pkg|arch-audit}} can be used to check for vulnerabilities affecting the running system. A graphical system tray, {{Pkg|arch-audit-gtk}}, can also be used. See also [[Arch Security Team]].&lt;br /&gt;
&lt;br /&gt;
You should also consider subscribing to the release notifications for software you use, especially if you install software through means other than the main repositories or AUR. Some software have mailing lists you can subscribe to for security notifications. Source code hosting sites often offer RSS feeds for new releases.&lt;br /&gt;
&lt;br /&gt;
=== Rebuilding packages ===&lt;br /&gt;
&lt;br /&gt;
Packages can be rebuilt and stripped of undesired functions and features as a means to reduce attack surface. For example, {{Pkg|bzip2}} can be rebuilt without {{ic|bzip2recover}} in an attempt to circumvent [https://security.archlinux.org/CVE-2016-3189 CVE-2016-3189]. Custom hardening flags can also be applied either manually or via a wrapper.&lt;br /&gt;
&lt;br /&gt;
{{Merge|Arch package guidelines/Security|Security related build flags have their own article.}}&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|Copy-pasted from a 3 years old blog post. The compiler flags are specific to [[GCC]], some are hardly security related.}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Flag !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| -D_FORTIFY_SOURCE=2 || Run-time buffer overflow detection&lt;br /&gt;
|-&lt;br /&gt;
| -D_GLIBCXX_ASSERTIONS || Run-time bounds checking for C++ strings and containers&lt;br /&gt;
|-&lt;br /&gt;
| -fasynchronous-unwind-tables || Increased reliability of backtraces&lt;br /&gt;
|-&lt;br /&gt;
| -fexceptions || Enable table-based thread cancellation&lt;br /&gt;
|-&lt;br /&gt;
| -fpie -Wl,-pie || Full ASLR for executables&lt;br /&gt;
|-&lt;br /&gt;
| -fpic -shared || No text relocations for shared libraries&lt;br /&gt;
|-&lt;br /&gt;
| -fplugin=annobin || Generate data for hardening quality control&lt;br /&gt;
|-&lt;br /&gt;
| -fstack-clash-protection || Increased reliability of stack overflow detection&lt;br /&gt;
|-&lt;br /&gt;
| -fstack-protector, -fstack-protector-all or -fstack-protector-strong || Stack smashing protector&lt;br /&gt;
|-&lt;br /&gt;
| -grecord-gcc-switches || Store compiler flags in debugging information&lt;br /&gt;
|-&lt;br /&gt;
| -mcet -fcf-protection || Control flow integrity protection&lt;br /&gt;
|-&lt;br /&gt;
| -Werror=format-security || Reject potentially unsafe format string arguments&lt;br /&gt;
|-&lt;br /&gt;
| -Werror=implicit-function-declaration || Reject missing function prototypes&lt;br /&gt;
|-&lt;br /&gt;
| -Wl,-z,defs || Detect and reject underlinking&lt;br /&gt;
|-&lt;br /&gt;
| -Wl,-z,now || Disable lazy binding&lt;br /&gt;
|-&lt;br /&gt;
| -Wl,-z,relro || Read-only segments after relocation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* [https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/ Flags and info source]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://security.archlinux.org/ Arch Linux Security Tracker]&lt;br /&gt;
* [https://wiki.centos.org/HowTos/OS_Protection CentOS Wiki: OS Protection]&lt;br /&gt;
* [https://web.archive.org/web/20210712001756/https://developer.ibm.com/technologies/linux/articles/l-harden-desktop/ Hardening the Linux desktop]&lt;br /&gt;
* [https://web.archive.org/web/20190701140035/https://www.ibm.com/developerworks/linux/tutorials/l-harden-server/index.html Hardening the Linux server]&lt;br /&gt;
* [https://github.com/lfit/itpol/blob/master/linux-workstation-security.md Linux Foundation: Linux workstation security checklist]&lt;br /&gt;
* [https://www.privacyguides.org/ privacyguides.org Privacy Resources]&lt;br /&gt;
* [https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide/ Red Hat Enterprise Linux 7 Security Guide]&lt;br /&gt;
* [https://www.debian.org/doc/manuals/securing-debian-manual/index.en.html Securing Debian Manual]&lt;br /&gt;
* [https://web.archive.org/web/20140220055801/http://crunchbang.org:80/forums/viewtopic.php?id=24722 The paranoid #! Security Guide]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Security&amp;diff=873614</id>
		<title>Security</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Security&amp;diff=873614"/>
		<updated>2026-05-11T18:59:26Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Enforce a delay after a failed login attempt */ expand e.g.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Security]]&lt;br /&gt;
[[Category:File systems]]&lt;br /&gt;
[[Category:Networking]]&lt;br /&gt;
[[de:Sicherheit]]&lt;br /&gt;
[[es:Security]]&lt;br /&gt;
[[hu:Security]]&lt;br /&gt;
[[ja:セキュリティ]]&lt;br /&gt;
[[pt:Security]]&lt;br /&gt;
[[ru:Security]]&lt;br /&gt;
[[zh-hans:Security]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|Arch Security Team}}&lt;br /&gt;
{{Related|General recommendations}}&lt;br /&gt;
{{Related|Identity management}}&lt;br /&gt;
{{Related|Capabilities}}&lt;br /&gt;
{{Related|List of Applications/Security}}&lt;br /&gt;
{{Related|Arch package guidelines/Security}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
This article contains recommendations and best practices for [[Wikipedia:Hardening (computing)|hardening]] an Arch Linux system.&lt;br /&gt;
&lt;br /&gt;
== Concepts ==&lt;br /&gt;
&lt;br /&gt;
* It &#039;&#039;is&#039;&#039; possible to tighten security to the point where the system is unusable. Security and convenience must be balanced. The trick is to create a secure &#039;&#039;and&#039;&#039; useful system.&lt;br /&gt;
* The biggest threat is, and will always be, the user.&lt;br /&gt;
* The [[Wikipedia:Principle of least privilege|principle of least privilege]]: Each part of a system should only be able to access what is strictly required, and nothing more.&lt;br /&gt;
* Defense in depth: Security works better in independent layers. When one layer is breached, another should stop the attack.&lt;br /&gt;
* Be a little paranoid. And be suspicious. If anything sounds too good to be true, it probably is!&lt;br /&gt;
* You can never make a system 100% secure unless you unplug the machine from all networks, turn it off, lock it in a safe, smother it in concrete and never use it.&lt;br /&gt;
* Prepare for failure. Create a plan ahead of time to follow when your security is broken.&lt;br /&gt;
&lt;br /&gt;
== Passwords ==&lt;br /&gt;
&lt;br /&gt;
Passwords are key to a secure system. They secure your [[Users and groups|user accounts]], [[Data-at-rest encryption|encrypted filesystems]], and [[SSH keys|SSH]]/[[GPG]] keys. They are the main way a computer chooses to trust the person using it, so a big part of security is just about picking secure passwords and protecting them.&lt;br /&gt;
&lt;br /&gt;
=== Choosing secure passwords ===&lt;br /&gt;
&lt;br /&gt;
Passwords must be complex enough to not be easily guessed from e.g. personal information, or [[Wikipedia:Password cracking|cracked]] using methods like brute-force attacks. The tenets of strong passwords are based on &#039;&#039;length&#039;&#039; and &#039;&#039;randomness&#039;&#039;. In cryptography the quality of a password is often referred to as its [[Wikipedia:Password strength#Entropy as a measure of password strength|entropy]].&lt;br /&gt;
&lt;br /&gt;
Insecure passwords include those containing or those using as a base before substitution/variation:&lt;br /&gt;
&lt;br /&gt;
* Personally identifiable information (e.g., your dog&#039;s name, date of birth, area code, favorite video game)&lt;br /&gt;
* Simple character substitutions on words (e.g., {{ic|k1araj0hns0n}}), as modern dictionary attacks can easily work with these&lt;br /&gt;
* Root &amp;quot;words&amp;quot; or common strings followed or preceded by added numbers, symbols, or characters (e.g., {{ic|DG091101%}})&lt;br /&gt;
* Common phrases or short strings of common dictionary words (e.g. {{ic|photocopyhauntbranchexpose}}) including with character substitution (e.g. {{ic|Ph0toc0pyh4uN7br@nch3xp*se}}) (See Diceware below for when a combination of dictionary words can be secure)&lt;br /&gt;
* Any of the [[Wikipedia:List of the most common passwords|most common passwords]]&lt;br /&gt;
&lt;br /&gt;
The best choice for a password is something long (the longer, the better) and generated from a random source. It is important to use a long password. [https://www.theregister.com/2019/02/14/password_length Weak hash algorithms allow an 8-character password hash to be compromised in just a few hours.]&lt;br /&gt;
&lt;br /&gt;
Tools like {{Pkg|pwgen}} or {{AUR|apg}} can generate random passwords. However, these passwords can be difficult to memorize. One memorization technique (for ones often typed) is to generate a long password and memorize a minimally secure number of characters, temporarily writing down the full generated string. Over time, increase the number of characters typed - until the password is ingrained in muscle memory and need not be remembered. This technique is more difficult, but can provide confidence that a password will not turn up in wordlists or &amp;quot;intelligent&amp;quot; brute force attacks that combine words and substitute characters.&lt;br /&gt;
&lt;br /&gt;
Apart from password management, {{Pkg|keepassxc}} offers password/passphrase generation. It is possible to customize the generation in a GUI. Dictionary based passphrases are also supported.&lt;br /&gt;
&lt;br /&gt;
One technique for memorizing a password is to use a mnemonic phrase, where each word in the phrase reminds you of the next character in the password.&lt;br /&gt;
Take for instance “the girl is walking down the rainy street” could be translated to {{ic|t6!WdtR5}} or, less simply, {{ic|t&amp;amp;6!RrlW@dtR,57}}.&lt;br /&gt;
This approach could make it easier to remember a password, but note that the various letters have very different probabilities of being found at the start of words ([[Wikipedia:Letter frequency#Relative frequencies of the first letters of a word in the English language|Wikipedia:Letter frequency]]).&lt;br /&gt;
&lt;br /&gt;
Another effective technique can be to write randomly generated passwords down and store them in a &#039;&#039;safe&#039;&#039; place, such as in a wallet, purse, or document safe. Most people do a generally good job of protecting their physical valuables from attack, and it is easier for most people to understand physical security best practices compared to digital security practices.&lt;br /&gt;
&lt;br /&gt;
It is also very effective to combine the mnemonic and random technique by saving long randomly generated passwords with a [[password manager]], which will be in turn accessed with a memorable &amp;quot;master password&amp;quot;/primary password that must be used only for that purpose. The master password must be memorized and never saved. This requires the password manager to be installed on a system to easily access the password (which could be seen as an inconvenience or a security feature, depending on the situation). Some password managers also have smartphone apps which can be used to display passwords for manual entry on systems without that password manager installed (if that is a common use case, you could still use easily typeable but secure passwords for each service instead of completely random ones, see below). Note that a password manager introduces a single point of failure if you ever forget the master password.&lt;br /&gt;
Some password managers compute the contained passwords based on the master password and the service name where you want to log in instead of encrypting them, making it possible to use it on a new system without syncing any data.&lt;br /&gt;
&lt;br /&gt;
It can be effective to use a memorable long series of unrelated words as a password. The theory is that if a sufficiently long phrase is used, the gained entropy from the password&#039;s length can counter the lost entropy from the use of dictionary words. This [https://xkcd.com/936/ xkcd comic] demonstrates the entropy tradeoff of this method, taking into account the limited set of possible words for each word in the passphrase. If the set of words you choose from is large (multiple thousand words) and you choose 5-7 or even more random words from it, this method provides great entropy, even assuming the attacker knows the set of possible words chosen from and the number of words chosen. The number of possible passphrases after settling on a set of words and number of words is: (number of words in the set of words to select from) to the power of (the number of words chosen for the passphrase). See e.g. [https://www.rempe.us/diceware/ Diceware] for more.&lt;br /&gt;
&lt;br /&gt;
See [https://www.iusmentis.com/security/passphrasefaq/ The passphrase FAQ] or [[Wikipedia:Password strength]] for some additional background.&lt;br /&gt;
&lt;br /&gt;
=== Maintaining passwords ===&lt;br /&gt;
&lt;br /&gt;
Once you pick a strong password, be sure to keep it safe. Watch out for [[Wikipedia:Keylogger|keyloggers]] (software and hardware), screen loggers, [[Wikipedia:Social engineering (security)|social engineering]], [[Wikipedia:Shoulder surfing (computer security)|shoulder surfing]], and avoid reusing passwords so insecure servers cannot leak more information than necessary. [[List of applications/Security#Password managers|Password managers]] can help manage large numbers of complex passwords: if you are copy-pasting the stored passwords from the manager to the applications that need them, make sure to clear the copy buffer every time, and ensure they are not saved in any kind of log (e.g. do not paste them in plain terminal commands, which would store them in files like {{ic|.bash_history}}). Note that password managers that are implemented as browser extensions may be vulnerable to [https://www.spookjs.com side channel attacks]. These can be mitigated by using password managers that run as separate applications.&lt;br /&gt;
&lt;br /&gt;
As a rule, do not pick insecure passwords just because secure ones are harder to remember. Passwords are a balancing act. It is better to have an encrypted database of secure passwords, guarded behind a key and one strong master password, than it is to have many similar weak passwords. Writing passwords down is perhaps equally effective [https://www.schneier.com/blog/archives/2005/06/write_down_your.html], avoiding potential vulnerabilities in software solutions while requiring physical security.&lt;br /&gt;
&lt;br /&gt;
Another aspect of the strength of the passphrase is that it must not be easily recoverable from other places.&lt;br /&gt;
&lt;br /&gt;
If you use the same passphrase for disk encryption as you use for your login password (useful e.g. to auto-mount the encrypted partition or folder on login), make sure that {{ic|/etc/shadow}} ends up on an encrypted partition or/and uses a strong key derivation function (i.e. yescrypt/argon2 or sha512 with PBKDF2, but not md5 or low iterations in PBKDF2) for the stored password hash (see [[SHA password hashes]] for more information).&lt;br /&gt;
&lt;br /&gt;
{{Tip|In 2023 Arch Linux switched the [https://archlinux.org/news/changes-to-default-password-hashing-algorithm-and-umask-settings/ default hashing] algorithm to yescrypt. If you have not customized the default, executing a password change with {{ic|passwd}} is necessary (and sufficient) to apply the new default.}}&lt;br /&gt;
&lt;br /&gt;
If you are backing up your password database, make sure that each copy is not stored behind any other passphrase which in turn is stored in it, e.g. an encrypted drive or an authenticated remote storage service, or you will not be able to access it in case of need; a useful trick is to protect the drives or accounts where the database is backed up using a simple cryptographic hash of the master password. Maintain a list of all the backup locations: if one day you fear that the master passphrase has been compromised you will have to change it immediately on all the database backups and the locations protected with keys derived from the master password.&lt;br /&gt;
&lt;br /&gt;
Version-controlling the database in a secure way can be very complicated: if you choose to do it, you must have a way to update the master password of all the database versions. It may not always be immediately clear when the master password is leaked: to reduce the risk of somebody else discovering your password before you realize that it leaked, you may choose to change it on a periodical basis. If you fear that you have lost control over a copy of the database, you will need to change all the passwords contained in it within the time that it may take to brute-force the master password, according to its entropy.&lt;br /&gt;
&lt;br /&gt;
=== Password hashes ===&lt;br /&gt;
&lt;br /&gt;
A hash is a one-way function, i.e. it is designed to make it impossible to deduct the input without computing the hash function with it (example: MD5, SHA).&lt;br /&gt;
&lt;br /&gt;
A password-hash function is designed to make deducting a user-input (password) impossible without computing the hash function with it (example: bcrypt). A [[Wikipedia:Key derivation function|key derivation function]] (KDF; examples: yescrypt, scrypt, PBKDF2) is a cryptographic algorithm designed to derive secret keys (e.g. an AES key, a password hash) from an input (a master key, a password). Hence, a KDF can serve multiple applications, including those of a password-hash function.&lt;br /&gt;
&lt;br /&gt;
By default, Arch stores the hashed user passwords in the root-only-readable {{ic|/etc/shadow}} file, separated from the other user parameters stored in the world-readable {{ic|/etc/passwd}} file, see [[Users and groups#User database]]. See also [[#Restricting root]].&lt;br /&gt;
&lt;br /&gt;
Passwords are set with the &#039;&#039;&#039;passwd&#039;&#039;&#039; command, which [[Wikipedia:Key stretching|stretches]] them with the system&#039;s crypt function and then saves them in {{ic|/etc/shadow}}. The passwords are also [[Wikipedia:Salt (cryptography)|salted]] in order to defend them against [[Wikipedia:Rainbow table|rainbow table]] attacks. See also [https://www.slashroot.in/how-are-passwords-stored-linux-understanding-hashing-shadow-utils How are passwords stored in Linux (Understanding hashing with shadow utils)].&lt;br /&gt;
&lt;br /&gt;
Since password hashes follow a defined format, the method and parameter can be configured for subsequent new invocations of the &#039;&#039;passwd&#039;&#039; command. Hence, the individual hashes stored in the {{ic|/etc/shadow}} file can be a heterogeneous mix of the hash functions supported by the system.&lt;br /&gt;
&lt;br /&gt;
See {{man|5|crypt}} for more information on the format, hashing methods and parameters.&lt;br /&gt;
&lt;br /&gt;
The {{ic|/etc/login.defs}} file configures the [https://archlinux.org/news/changes-to-default-password-hashing-algorithm-and-umask-settings/ default password hashing] method {{ic|ENCRYPT_METHOD YESCRYPT}} and its parameter {{ic|YESCRYPT_COST_FACTOR}}.&lt;br /&gt;
&lt;br /&gt;
For example, an increment of the default {{ic|YESCRYPT_COST_FACTOR}} parameter will lead to a logarithmic increase of the compute time required to deduce the hash from a password. This applies, likewise, to a third-party trying to obtain the password secret, and the system to authenticate a user log-in.&lt;br /&gt;
&lt;br /&gt;
In contrast, the compute time for the SHA-512 hash function is configured by a parameter with a linear influence. See [[SHA password hashes]] for information on the previous Arch default. Note the yescrypt algorithm internally uses SHA-256, HMAC and PBKDF2 to compute its password-hash. The main reason is to combine positive attributes of these widely used and tested functions for an enhanced resistance to attacks. For example, the usability of SHA for various purposes has resulted in hardware support for the function, i.e. the performance to compute a pure SHA hash has accelerated considerably, making its application as a password-hash function more and more derelict.&lt;br /&gt;
&lt;br /&gt;
=== Enforcing strong passwords with pam_pwquality ===&lt;br /&gt;
&lt;br /&gt;
PAM stands for the Pluggable Authentication Modules. &#039;&#039;pam_pwquality&#039;&#039; provides protection against [[Wikipedia:Dictionary attack|Dictionary attacks]] and helps configure a password policy that can be enforced throughout the system. It is based on &#039;&#039;pam_cracklib&#039;&#039;, so it is backwards compatible with its options.&lt;br /&gt;
&lt;br /&gt;
[[Install]] the {{Pkg|libpwquality}} package.&lt;br /&gt;
&lt;br /&gt;
{{Warning|The &#039;&#039;root&#039;&#039; account is not affected by this policy by default.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* You can use the &#039;&#039;root&#039;&#039; account to set a password for a user that bypasses the desired/configured policy. This is useful when setting temporary passwords.&lt;br /&gt;
* Current security guidelines around passwords, e.g. from NIST, but also from others, do not recommend enforcing special characters, since they often only lead to predictable alterations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
If for example you want to enforce this policy:&lt;br /&gt;
&lt;br /&gt;
* prompt 2 times for password in case of an error (retry option)&lt;br /&gt;
* 10 characters minimum length (minlen option)&lt;br /&gt;
* at least 6 characters should be different from old password when entering a new one (difok option)&lt;br /&gt;
* at least 1 digit (dcredit option)&lt;br /&gt;
* at least 1 uppercase (ucredit option)&lt;br /&gt;
* at least 1 lowercase (lcredit option)&lt;br /&gt;
* at least 1 other character (ocredit option)&lt;br /&gt;
* cannot contain the words &amp;quot;myservice&amp;quot; and &amp;quot;mydomain&amp;quot;&lt;br /&gt;
* enforce the policy for root&lt;br /&gt;
&lt;br /&gt;
Edit the {{ic|/etc/pam.d/passwd}} file to read as:&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
#%PAM-1.0&lt;br /&gt;
password required pam_pwquality.so retry=2 minlen=10 difok=6 dcredit=-1 ucredit=-1 ocredit=-1 lcredit=-1 [badwords=myservice mydomain] enforce_for_root&lt;br /&gt;
password required pam_unix.so use_authtok yescrypt shadow&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The {{ic|password required pam_unix.so use_authtok}} instructs the &#039;&#039;pam_unix&#039;&#039; module to not prompt for a password but rather to use the one provided by &#039;&#039;pam_pwquality&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
You can refer to the {{man|8|pam_pwquality}} and {{man|8|pam_unix}} man pages for more information.&lt;br /&gt;
&lt;br /&gt;
== CPU ==&lt;br /&gt;
&lt;br /&gt;
=== Microcode ===&lt;br /&gt;
&lt;br /&gt;
See [[microcode]] for information on how to install important security updates for your CPU&#039;s microcode.&lt;br /&gt;
&lt;br /&gt;
=== Hardware vulnerabilities ===&lt;br /&gt;
&lt;br /&gt;
Some CPUs contain hardware vulnerabilities. See the [https://docs.kernel.org/admin-guide/hw-vuln/ kernel documentation on hardware vulnerabilities] for a list of these vulnerabilities, as well as mitigation selection guides to help customize the kernel to mitigate these vulnerabilities for specific usage scenarios.&lt;br /&gt;
&lt;br /&gt;
To check if you are affected by a known vulnerability, run the following:&lt;br /&gt;
&lt;br /&gt;
 $ grep -r . /sys/devices/system/cpu/vulnerabilities/&lt;br /&gt;
&lt;br /&gt;
In most cases, updating the kernel and microcode will mitigate vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
==== Simultaneous multithreading (hyper-threading) ====&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:Simultaneous multithreading|Simultaneous multithreading]] (SMT), also called hyper-threading on Intel CPUs, is a hardware feature that may be a source of [https://docs.kernel.org/admin-guide/hw-vuln/l1tf.html L1 Terminal Fault] and [https://docs.kernel.org/admin-guide/hw-vuln/mds.html Microarchitectural Data Sampling] vulnerabilities. The Linux kernel and microcode updates contain mitigations for known vulnerabilities, but [https://docs.kernel.org/admin-guide/hw-vuln/l1tf.html#virtualization-with-untrusted-guests disabling SMT may still be required on certain CPUs if untrusted virtualization guests are present].&lt;br /&gt;
&lt;br /&gt;
{{Note|Disabling SMT is something mostly hypervisors benefit from.[https://security.stackexchange.com/questions/219753/sacrificing-30-of-my-cpu-performance-by-disabling-hyper-threading-to-fully-mi/219759#219759] On an ordinary system it has very little to no security benefits.}}&lt;br /&gt;
&lt;br /&gt;
SMT can often be disabled in your system&#039;s firmware. Consult your motherboard or system documentation for more information. You can also disable SMT in the kernel by adding the following [[kernel parameter]]:&lt;br /&gt;
&lt;br /&gt;
 mitigations=auto,nosmt&lt;br /&gt;
&lt;br /&gt;
== Memory ==&lt;br /&gt;
&lt;br /&gt;
=== Hardened malloc ===&lt;br /&gt;
&lt;br /&gt;
{{AUR|hardened_malloc}} is a hardened replacement for [[Wikipedia:GNU C Library|glibc]]&#039;s malloc(). The project was originally developed for integration into Android&#039;s [[Wikipedia:Bionic (software)|Bionic]] and [[Wikipedia:musl|musl]] by Daniel Micay, of [[Wikipedia:GrapheneOS|GrapheneOS]], but he has also built in support for standard Linux distributions on the x86_64 architecture.&lt;br /&gt;
&lt;br /&gt;
== Storage ==&lt;br /&gt;
&lt;br /&gt;
=== Data-at-rest encryption ===&lt;br /&gt;
&lt;br /&gt;
[[Data-at-rest encryption]], preferably full-disk encryption with a [[#Passwords|strong passphrase]], is the only way to guard data against physical recovery. This provides data confidentiality when the computer is turned off or the disks in question are unmounted.&lt;br /&gt;
&lt;br /&gt;
Once the computer is powered on and the drive is mounted, however, its data becomes just as vulnerable as an unencrypted drive. It is therefore best practice to unmount data partitions as soon as they are no longer needed.&lt;br /&gt;
&lt;br /&gt;
You may also [[Trusted Platform Module#LUKS encryption|encrypt a drive with the key stored in a TPM]], although it has had [https://tpm.fail vulnerabilites in the past] and the key can be extracted by a [https://pulsesecurity.co.nz/articles/TPM-sniffing bus sniffing attack].&lt;br /&gt;
&lt;br /&gt;
Certain programs, like [[dm-crypt]], allow the user to encrypt a loop file as a virtual volume. This is a reasonable alternative to full-disk encryption when only certain parts of the system need to be secure.&lt;br /&gt;
&lt;br /&gt;
While the block-device or filesystem-based encryption types compared in the [[data-at-rest encryption]] article are useful at protecting data on physical media, most can not be used to protect data on a remote system that you can not control (such as [[Data-at-rest encryption#Cloud-storage optimized|cloud storage]]). In some cases, individual file encryption will be useful.&lt;br /&gt;
&lt;br /&gt;
These are some methods to encrypt files:&lt;br /&gt;
&lt;br /&gt;
* Some [[Archiving and compression|archiving and compressing]] tools also provide basic encryption. Some examples are [[7-Zip]] ({{ic|-p}} flag), {{Pkg|zip}} ({{ic|-e}} flag). The encryption should only be relied on particular care, because the tools may use custom algorithms for cross-platform compatibility.[https://math.ucr.edu/~mike/zipattacks.pdf]&lt;br /&gt;
* [[GnuPG]] can be used to [[GnuPG#Encrypt and decrypt|encrypt files]].&lt;br /&gt;
* {{Pkg|age}} is a simple and easy to use file encryption tool. It also supports multiple recipients and encryption using SSH keys, which is useful for secure file sharing.&lt;br /&gt;
&lt;br /&gt;
=== File systems ===&lt;br /&gt;
&lt;br /&gt;
The kernel now prevents security issues related to hardlinks and symlinks if the {{ic|fs.protected_hardlinks}} and {{ic|fs.protected_symlinks}} sysctl switches are enabled, so there is no longer a major security benefit from separating out world-writable directories.&lt;br /&gt;
&lt;br /&gt;
File systems containing world-writable directories can still be kept separate as a coarse way of limiting the damage from disk space exhaustion. However, filling {{ic|/var}} or {{ic|/tmp}} is enough to take down services. More flexible mechanisms for dealing with this concern exist (like [[Disk quota|quotas]]), and some [[file systems]] include related features themselves (Btrfs has quotas on subvolumes).&lt;br /&gt;
&lt;br /&gt;
==== Mount options ====&lt;br /&gt;
&lt;br /&gt;
Following the principle of least privilege, file systems should be mounted with the most restrictive mount options possible (without losing functionality).&lt;br /&gt;
&lt;br /&gt;
Relevant mount options are:&lt;br /&gt;
&lt;br /&gt;
* {{ic|nodev}}: Do not interpret character or block special devices on the file system.&lt;br /&gt;
* {{ic|nosuid}}: Do not allow set-user-identifier or set-group-identifier bits to take effect.&lt;br /&gt;
* {{ic|noexec}}: Do not allow direct execution of any binaries on the mounted file system.&lt;br /&gt;
** Setting {{ic|noexec}} on {{ic|/home}} disallows executable scripts and breaks [[Wine]], [[Steam]], PyCharm, [[.NET]], etc.&lt;br /&gt;
*** Wine does not need the {{ic|exec}} flag for opening Windows binaries. It is only needed when Wine itself is installed in {{ic|/home}}.&lt;br /&gt;
*** To keep [[Steam]] working you can mount {{ic|/home/user/.local/share/Steam}} as {{ic|exec}} in [[fstab]] by adding the following: {{bc|/home/user/.local/share/Steam  /home/user/.local/share/Steam  none defaults,bind,user,exec,nofail  0  0}}&lt;br /&gt;
** Some packages (building {{Pkg|nvidia-open-dkms}} for example) may require {{ic|exec}} on {{ic|/var}}.&lt;br /&gt;
&lt;br /&gt;
File systems used for data should always be mounted with {{ic|nodev}}, {{ic|nosuid}} and {{ic|noexec}}.&lt;br /&gt;
&lt;br /&gt;
Potential file system mounts to consider:&lt;br /&gt;
&lt;br /&gt;
* {{ic|/var}}&lt;br /&gt;
* {{ic|/home}}&lt;br /&gt;
* {{ic|/dev/shm}}&lt;br /&gt;
* {{ic|/tmp}}&lt;br /&gt;
* {{ic|/boot}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|When using [[systemd#GPT partition automounting|GPT partition automounting]], the ESP and XBOOTLDR partitions are [https://github.com/systemd/systemd-stable/commit/49804cfb71d3a79f433096e4cfb5616980171336 always hardened] with {{ic|noexec,nosuid,nodev}}.}}&lt;br /&gt;
&lt;br /&gt;
==== Snapshots ====&lt;br /&gt;
&lt;br /&gt;
When utilizing file system snapshots, e.g. with [[Btrfs]], [[LVM]], or [[ZFS]], it is essential to be aware that snapshots may retain sensitive information that users expect to be deleted. This is especially true when automatic snapshotting tools like [[Snapper]] are configured, as they can capture snapshots at regular intervals or in response to system events. Here are some examples of how sensitive information in {{ic|/home/}} can persist within snapshots:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Deleted files and directories&#039;&#039;: Even though files or directories are deleted from the file system, they may still exist within older snapshots. This is expected most of the time, but consider whether files and directories such as {{ic|.local/share/Trash/}}, {{ic|.history}}, etc. should be retained.&lt;br /&gt;
* &#039;&#039;Temporary files and cache&#039;&#039;: Temporary files and cached data generated by applications may be included in snapshots. For example, files kept in encrypted directories might generate thumbnails ({{ic|.cache/thumbnails}}) or work copies when opened, which might in turn be included in snapshots. The same applies e.g. to browsing history ({{ic|.mozilla/}}, {{ic|.config/chromium/}}, etc.), which could have been included in a snapshot before being purged.&lt;br /&gt;
&lt;br /&gt;
If this is supported, consider excluding such directories from snapshots altogether. For example, if using [[Btrfs]], you can create subvolumes for example {{ic|.cache/}}, {{ic|.config/}}, {{ic|.local/}}, {{ic|.var/}} or any other directory according to your use-case.&lt;br /&gt;
&lt;br /&gt;
{{Note|Moving {{ic|.local/share/Trash}} to a separate subvolume might break the trash feature in some cases, e.g. with [[GNOME/Files]].}}&lt;br /&gt;
&lt;br /&gt;
=== File access permissions ===&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|{{ic|chmod go-r}} does not &amp;quot;take away all permissions&amp;quot;, it only removes the read permission.}}&lt;br /&gt;
&lt;br /&gt;
The default [[file permissions]] allow read access to almost everything and changing the permissions can hide valuable information from an attacker who gains access to a non-root account such as the {{ic|http}} or {{ic|nobody}} users. You can use [[chmod]] to take away all permissions from the group and others:&lt;br /&gt;
&lt;br /&gt;
 # chmod go-r &#039;&#039;path_to_hide&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{Warning|Do not apply this broadly. Try this for one config at a time, ensuring that it is worth hiding, and that it will not break program functionality. You may need to remove the {{ic|g}} from the command (or re-add the permission with {{ic|chmod g+r &#039;&#039;path&#039;&#039;}} if already ran) if the group is relied on.}}&lt;br /&gt;
&lt;br /&gt;
Some paths to consider are:&lt;br /&gt;
&lt;br /&gt;
* {{ic|/boot}}: The [[Partitioning#/boot|boot directory]], which may include traditional [[vmlinuz]] and [[initramfs]] images, or a [[Unified kernel image]]. Note that safe permissions are used by default when using [[systemd#GPT partition automounting]].&lt;br /&gt;
* {{ic|/etc/nftables.conf}}: The [[nftables]] configuration, applicable to {{Pkg|nftables}} and {{Pkg|iptables}}.&lt;br /&gt;
* {{ic|/etc/iptables}}: The legacy [[iptables]] configuration, applicable to {{Pkg|iptables-legacy}}.&lt;br /&gt;
&lt;br /&gt;
The default [[umask]] {{ic|0022}} can be changed to improve security for newly created files. The [https://apps.nsa.gov/iaarchive/library/ia-guidance/security-configuration/operating-systems/guide-to-the-secure-configuration-of-red-hat-enterprise.cfm NSA RHEL5 Security Guide] suggests a umask of {{ic|0077}} for maximum security, which makes new files not readable by users other than the owner. To change this, see [[Umask#Set the mask value]]. If you use [[sudo]], consider configuring it to use the [[Sudo#Permissive umask|default root umask]].&lt;br /&gt;
&lt;br /&gt;
=== SUID and SGID files ===&lt;br /&gt;
&lt;br /&gt;
It is important to be aware of any files with the [[Wikipedia:Setuid|Setuid]] or Setgid bit. Examples of relevant files with the SUID bit set:&lt;br /&gt;
&lt;br /&gt;
* [[PAM|unix_chkpwd]]&lt;br /&gt;
* chage, expiry, gpasswd, groupmems, [[passwd]], sg ({{Pkg|shadow}})&lt;br /&gt;
* [[FUSE|fusermount3]], fusermount2&lt;br /&gt;
* [[polkit|pkexec]]&lt;br /&gt;
* [[OpenSSH|ssh-keysign]]&lt;br /&gt;
* chfn, chsh, mount, newgrp, umount, wall, write ({{Pkg|util-linux}})&lt;br /&gt;
* [[sudo]], {{Pkg|sudo-rs}}, [[doas]], [[su]], su-rs, [[Kerberos|ksu]]&lt;br /&gt;
* [[firejail]]&lt;br /&gt;
* [[Dbus|dbus-daemon-launch-helper]]&lt;br /&gt;
* [[Chromium|chromium-sandbox]]&lt;br /&gt;
* [[Xorg|Xorg.wrap]]&lt;br /&gt;
&lt;br /&gt;
The prominent risks of such executable files include privilege escalation vulnerabilities, see e.g [[Wikipedia:Setuid#Security impact]].[https://www.cvedetails.com/vulnerability-list/vendor_id-16224/product_id-36412/Calibre-ebook-Calibre.html][https://www.cvedetails.com/product/32625/Sudo-Project-Sudo.html?vendor_id=15714][https://www.cvedetails.com/vulnerability-list/vendor_id-16191/Firejail-Project.html]&lt;br /&gt;
&lt;br /&gt;
Files with the SUID bit set and not owned by root, or files with the SGID bit set &#039;&#039;typically&#039;&#039; have less potential impact but can theoretically still do decent damage if vulnerable. It is usually possible to avoid using SUID or SGID by assigning [[Capabilities]] instead.&lt;br /&gt;
&lt;br /&gt;
{{Tip|It is vital to be vigilant in keeping packages which provide SUID/SGID executables up to date in order to prevent having a vulnerable system.}}&lt;br /&gt;
&lt;br /&gt;
To search for files with either the SUID or SGID bit:&lt;br /&gt;
&lt;br /&gt;
 $ find / -perm &amp;quot;/u=s,g=s&amp;quot; -type f 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
=== Backups ===&lt;br /&gt;
&lt;br /&gt;
{{Merge|System backup|There is a dedicated page for system backups.}}&lt;br /&gt;
&lt;br /&gt;
Regularly create backups of important data. Regularly test the integrity of the backups. Regularly test that the backups can be restored.&lt;br /&gt;
&lt;br /&gt;
Make sure that at least one copy of the data is stored offline, i.e. not connected to the system under threat in any way. [[Wikipedia:Ransomware|Ransomware]] and other destructive attacks may also attack any connected backup systems.&lt;br /&gt;
&lt;br /&gt;
=== SATA SSD frozen mode ===&lt;br /&gt;
&lt;br /&gt;
See [[Solid state drive#Setting the SATA SSD state to frozen mode after waking up from sleep]].&lt;br /&gt;
&lt;br /&gt;
== User setup ==&lt;br /&gt;
&lt;br /&gt;
=== Do not use the root account for daily use ===&lt;br /&gt;
&lt;br /&gt;
Following the principle of least privilege, do not use the root user for daily use. Create a non-privileged user account for each person using the system. See [[List of applications/Security#Privilege elevation]] for ways of temporarily gaining privileged access.&lt;br /&gt;
&lt;br /&gt;
=== Enforce a delay after a failed login attempt ===&lt;br /&gt;
&lt;br /&gt;
Add the following line to {{ic|/etc/pam.d/system-login}} to add a delay of at least 4 seconds between failed login attempts:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/pam.d/system-login|2=&lt;br /&gt;
auth optional pam_faildelay.so delay=4000000&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|This line needs to be the first line in the file.}}&lt;br /&gt;
&lt;br /&gt;
{{ic|4000000}} is the time in microseconds to delay.&lt;br /&gt;
&lt;br /&gt;
Other PAM modules besides {{ic|pam_faildelay}} can also suggest such a delay; if multiple modules do so, PAM will use the longest one.&lt;br /&gt;
&lt;br /&gt;
In particular, both {{ic|pam_unix}} and {{ic|pam_faillock}} set a minimum delay of 2 seconds by default.&lt;br /&gt;
In order to completely remove this delay, you need to add the {{ic|nodelay}} parameter to any {{ic|auth}} lines of these modules, for example&lt;br /&gt;
{{hc|/etc/pam.d/system-auth|2=&lt;br /&gt;
auth       [success{{=}}1 default{{=}}bad]     pam_unix.so          try_first_pass nullok nodelay&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Lock out user after three failed login attempts ===&lt;br /&gt;
&lt;br /&gt;
Since {{Pkg|pambase}} 20200721.1-2, {{ic|pam_faillock.so}} is enabled by default to lock out users for 10 minutes after 3 failed login attempts in a 15 minute period (see {{Bug|67644}}). The lockout only applies to password authentication (e.g. login and &#039;&#039;sudo&#039;&#039;), public key authentication over SSH is still accepted. To prevent complete denial-of-service, this lockout is disabled for the root user by default.&lt;br /&gt;
&lt;br /&gt;
To unlock a user, do:&lt;br /&gt;
&lt;br /&gt;
 $ faillock --user &#039;&#039;username&#039;&#039; --reset&lt;br /&gt;
&lt;br /&gt;
By default, the lock mechanism is a file per-user located at {{ic|/run/faillock/}}. Deleting or emptying the file unlocks that user—the directory is owned by root, but the file is owned by the user, so the {{ic|faillock}} command only empties the file, therefore does not require root.&lt;br /&gt;
&lt;br /&gt;
The module {{ic|pam_faillock.so}} can be configured with the file {{ic|1=/etc/security/faillock.conf}}. The lockout parameters:&lt;br /&gt;
&lt;br /&gt;
* {{ic|unlock_time}} — the lockout time (in seconds, default 10 minutes).&lt;br /&gt;
* {{ic|fail_interval}} — the time in which failed logins can cause a lockout (in seconds, default 15 minutes).&lt;br /&gt;
* {{ic|deny}} — the number of failed logins before lockout (default 3).&lt;br /&gt;
&lt;br /&gt;
{{Tip|The primary purpose for the lockout is to slow down brute-force attacks so that they become infeasible. Hence, if lockouts due to mistyping of passwords become too frequent, relaxing the number of attempts may be preferred to reducing the lockout time.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|{{ic|1=deny = 0}} will disable the lockout mechanism entirely.}}&lt;br /&gt;
&lt;br /&gt;
By default, all user locks are lost after reboot. If your attacker can reboot the machine, it is more secure if locks persist. To make locks persist, change the {{ic|dir}} parameter in {{ic|1=/etc/security/faillock.conf}} to {{ic|/var/lib/faillock}}.&lt;br /&gt;
&lt;br /&gt;
No restart is required for changes to take effect. See {{man|5|faillock.conf}} for further configuration options, such as enabling lockout for the root account, disabling for centralized login (e.g. LDAP), etc.&lt;br /&gt;
&lt;br /&gt;
{{Note|If you make locks persistant, following the changes introduced in polkit 127: you may have to relax the sandbox of its helper agent in order to keep it functional. The best way is to create a drop-in for its systemd unit via {{ic|systemctl edit polkit-agent-helper\@.service}} and add:&lt;br /&gt;
&lt;br /&gt;
 [Service]&lt;br /&gt;
 ReadWritePaths{{=}}/var/lib/faillock&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Limit amount of processes ===&lt;br /&gt;
&lt;br /&gt;
On systems with many, or untrusted users, it is important to limit the number of processes each can run at once, therefore preventing [[Wikipedia:Fork bomb|fork bombs]] and other denial of service attacks. The {{ic|/etc/security/limits.conf}} configuration determines how many processes each user, or group can have open, and is empty (except for useful comments) by default. Adding the following lines to this file will limit all users to 100 active processes, unless they use the {{ic|prlimit}} command to explicitly raise their maximum to 200 for that session. These values can be changed according to the appropriate number of processes a user should have running, or the hardware of the box you are administrating.&lt;br /&gt;
&lt;br /&gt;
 * soft nproc 100&lt;br /&gt;
 * hard nproc 200&lt;br /&gt;
&lt;br /&gt;
The current number of threads for each user can be found with {{ic|ps --no-headers -Leo user {{!}} sort {{!}} uniq --count}}. This may help with determining appropriate values for the users&#039; limits; see also [[limits.conf]].&lt;br /&gt;
&lt;br /&gt;
=== Use Wayland ===&lt;br /&gt;
&lt;br /&gt;
Prefer using [[Wayland]] over [[Xorg]]. Xorg&#039;s design predates modern security practices and is [https://security.stackexchange.com/questions/4641/why-are-people-saying-that-the-x-window-system-is-not-secure/4646#4646 considered insecure] by many. For example, Xorg applications may record keystrokes while inactive.&lt;br /&gt;
&lt;br /&gt;
If you must run Xorg, it is recommended to [[Xorg#Rootless Xorg|avoid running it as root]]. Within Wayland, the Xwayland compatibility layer will automatically use rootless Xorg.&lt;br /&gt;
&lt;br /&gt;
== Restricting root ==&lt;br /&gt;
&lt;br /&gt;
The root user is, by definition, the most powerful user on a system. It is also difficult to [[audit]] the root user account. It is therefore important to restrict usage of the root user account as much as possible. There are a number of ways to keep the power of the root user while limiting its ability to cause harm.&lt;br /&gt;
&lt;br /&gt;
=== Use sudo instead of su ===&lt;br /&gt;
&lt;br /&gt;
Using [[sudo]] for privileged access is preferable to [[su]] for a number of reasons:&lt;br /&gt;
&lt;br /&gt;
* It keeps a log of which normal privilege user has run each privileged command.&lt;br /&gt;
* The root user password need not be given out to each user who requires root access.&lt;br /&gt;
* {{ic|sudo}} prevents users from accidentally running commands as &#039;&#039;root&#039;&#039; that do not need root access, because a full root terminal is not created. This aligns with the [[Wikipedia:Principle of least privilege|principle of least privilege]].&lt;br /&gt;
* Individual programs may be enabled per user, instead of offering complete root access just to run one command. &lt;br /&gt;
&lt;br /&gt;
See [[Sudo#Configuration]].&lt;br /&gt;
&lt;br /&gt;
==== Editing files using sudo ====&lt;br /&gt;
&lt;br /&gt;
See [[Sudo#Editing files]]. Alternatively, you can use editors like {{ic|rvim}} or {{ic|rnano}} which have restricted capabilities in order to be safe to run as root.&lt;br /&gt;
&lt;br /&gt;
=== Restricting root login ===&lt;br /&gt;
&lt;br /&gt;
Once [[sudo]] is properly configured, full root access can be heavily restricted or denied without losing much usability. To disable root, but still allowing to use [[sudo]], you can use {{man|1|passwd}} with {{ic|passwd --lock root}}.&lt;br /&gt;
&lt;br /&gt;
==== Allow only certain users ====&lt;br /&gt;
&lt;br /&gt;
The [[PAM]] {{ic|pam_wheel.so}} lets you allow only users in the group {{ic|wheel}} to login using [[su]]. See [[su#su and wheel]].&lt;br /&gt;
&lt;br /&gt;
==== Denying SSH login ====&lt;br /&gt;
&lt;br /&gt;
Even if you do not wish to deny root login for local users, it is always good practice to [[OpenSSH#Deny|deny root login via SSH]]. The purpose of this is to add an additional layer of security before a user can completely compromise your system remotely.&lt;br /&gt;
&lt;br /&gt;
==== Specify acceptable login combinations with access.conf ====&lt;br /&gt;
&lt;br /&gt;
{{Warning|If you are using GNOME 49 or later, you should make sure the group &#039;&#039;gdm&#039;&#039; can log in locally. This can be done with a {{ic|+:(gdm):LOCAL}} rule. [https://gitlab.gnome.org/GNOME/gdm/-/issues/1021]}}&lt;br /&gt;
&lt;br /&gt;
When someone attempts to log in with [[PAM]], {{ic|/etc/security/access.conf}} is checked for the first combination that matches their login properties. Their attempt then fails or succeeds based on the rule for that combination.&lt;br /&gt;
&lt;br /&gt;
 +:root:LOCAL&lt;br /&gt;
 -:root:ALL&lt;br /&gt;
&lt;br /&gt;
Rules can be set for specific groups and users. In this example, the user archie is allowed to login locally, as are all users in the wheel and adm groups. All other logins are rejected:&lt;br /&gt;
&lt;br /&gt;
 +:archie:LOCAL&lt;br /&gt;
 +:(wheel):LOCAL&lt;br /&gt;
 +:(adm):LOCAL&lt;br /&gt;
 -:ALL:ALL&lt;br /&gt;
&lt;br /&gt;
Read more at {{man|5|access.conf}}&lt;br /&gt;
&lt;br /&gt;
== Mandatory access control ==&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:Mandatory Access Control|Mandatory access control]] (MAC) is a type of security policy that differs significantly from the [[Wikipedia:Discretionary Access Control|discretionary access control]] (DAC) used by default in Arch and most Linux distributions. MAC essentially means that every action a program could perform that affects the system in any way is checked against a security ruleset. This ruleset, in contrast to DAC methods, cannot be modified by users. Using virtually any mandatory access control system will significantly improve the security of your computer, although there are differences in how it can be implemented.&lt;br /&gt;
&lt;br /&gt;
=== Pathname MAC ===&lt;br /&gt;
&lt;br /&gt;
Pathname-based access control is a simple form of access control that offers permissions based on the path of a given file. The downside to this style of access control is that permissions are not carried with files if they are moved around the system. On the positive side, pathname-based MAC can be implemented on a much wider range of filesystems, unlike labels-based alternatives.&lt;br /&gt;
&lt;br /&gt;
* [[AppArmor]] is a [[Wikipedia:Canonical (company)|Canonical]]-maintained MAC implementation seen as an &amp;quot;easier&amp;quot; alternative to SELinux.&lt;br /&gt;
* [[TOMOYO]] is another simple, easy-to-use system offering mandatory access control. It is designed to be both simple in usage and in implementation, requiring very few dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Labels MAC ===&lt;br /&gt;
&lt;br /&gt;
Labels-based access control means the extended attributes of a file are used to govern its security permissions. While this system is arguably more flexible in its security offerings than pathname-based MAC, it only works on filesystems that support these extended attributes.&lt;br /&gt;
&lt;br /&gt;
* [[SELinux]], based on an [[Wikipedia:NSA|NSA]] project to improve Linux security, implements MAC completely separate from system users and roles. It offers an extremely robust multi-level MAC policy implementation that can easily maintain control of a system that grows and changes past its original configuration.&lt;br /&gt;
&lt;br /&gt;
=== Access Control Lists ===&lt;br /&gt;
&lt;br /&gt;
[[Access Control Lists]] (ACLs) are an alternative to attaching rules directly to the filesystem in some way. ACLs implement access control by checking program actions against a list of permitted behavior.&lt;br /&gt;
&lt;br /&gt;
== Kernel hardening ==&lt;br /&gt;
&lt;br /&gt;
=== Kernel self-protection / exploit mitigation ===&lt;br /&gt;
&lt;br /&gt;
The {{pkg|linux-hardened}} package uses a [https://github.com/anthraxx/linux-hardened basic kernel hardening patch set] and more security-focused compile-time configuration options than the {{pkg|linux}} package. A custom build can be made to choose a different compromise between security and performance than the security-leaning defaults.&lt;br /&gt;
&lt;br /&gt;
However, it should be noted that several packages (such as {{pkg|throttled}}) will not work when using this kernel.&lt;br /&gt;
&lt;br /&gt;
If you use an out-of-tree driver such as [[NVIDIA]], you may need to switch to its [[DKMS]] package.&lt;br /&gt;
&lt;br /&gt;
==== Userspace ASLR comparison ====&lt;br /&gt;
&lt;br /&gt;
The {{pkg|linux-hardened}} package provides an improved implementation of Address Space Layout Randomization for userspace processes. The {{pkg|paxtest}} command can be used to obtain an estimate of the provided entropy:&lt;br /&gt;
&lt;br /&gt;
===== 64-bit processes =====&lt;br /&gt;
&lt;br /&gt;
{{hc|linux-hardened 5.4.21.a-1-hardened|&lt;br /&gt;
Anonymous mapping randomization test     : 32 quality bits (guessed)&lt;br /&gt;
Heap randomization test (ET_EXEC)        : 40 quality bits (guessed)&lt;br /&gt;
Heap randomization test (PIE)            : 40 quality bits (guessed)&lt;br /&gt;
Main executable randomization (ET_EXEC)  : 32 quality bits (guessed)&lt;br /&gt;
Main executable randomization (PIE)      : 32 quality bits (guessed)&lt;br /&gt;
Shared library randomization test        : 32 quality bits (guessed)&lt;br /&gt;
VDSO randomization test                  : 32 quality bits (guessed)&lt;br /&gt;
Stack randomization test (SEGMEXEC)      : 40 quality bits (guessed)&lt;br /&gt;
Stack randomization test (PAGEEXEC)      : 40 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (SEGMEXEC)    : 44 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (PAGEEXEC)    : 44 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_EXEC): 34 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_DYN) : 34 quality bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @~0: 32 bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @0 : 32 bits (guessed)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{hc|linux 5.5.5-arch1-1|&lt;br /&gt;
Anonymous mapping randomization test     : 28 quality bits (guessed)&lt;br /&gt;
Heap randomization test (ET_EXEC)        : 28 quality bits (guessed)&lt;br /&gt;
Heap randomization test (PIE)            : 28 quality bits (guessed)&lt;br /&gt;
Main executable randomization (ET_EXEC)  : 28 quality bits (guessed)&lt;br /&gt;
Main executable randomization (PIE)      : 28 quality bits (guessed)&lt;br /&gt;
Shared library randomization test        : 28 quality bits (guessed)&lt;br /&gt;
VDSO randomization test                  : 20 quality bits (guessed)&lt;br /&gt;
Stack randomization test (SEGMEXEC)      : 30 quality bits (guessed)&lt;br /&gt;
Stack randomization test (PAGEEXEC)      : 30 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (SEGMEXEC)    : 22 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (PAGEEXEC)    : 22 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_EXEC): 28 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_DYN) : 28 quality bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @~0: 29 bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @0 : 29 bits (guessed)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{hc|linux-lts 4.19.101-1-lts|&lt;br /&gt;
Anonymous mapping randomization test     : 28 quality bits (guessed)&lt;br /&gt;
Heap randomization test (ET_EXEC)        : 28 quality bits (guessed)&lt;br /&gt;
Heap randomization test (PIE)            : 28 quality bits (guessed)&lt;br /&gt;
Main executable randomization (ET_EXEC)  : 28 quality bits (guessed)&lt;br /&gt;
Main executable randomization (PIE)      : 28 quality bits (guessed)&lt;br /&gt;
Shared library randomization test        : 28 quality bits (guessed)&lt;br /&gt;
VDSO randomization test                  : 19 quality bits (guessed)&lt;br /&gt;
Stack randomization test (SEGMEXEC)      : 30 quality bits (guessed)&lt;br /&gt;
Stack randomization test (PAGEEXEC)      : 30 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (SEGMEXEC)    : 22 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (PAGEEXEC)    : 22 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_EXEC): 28 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_DYN) : 28 quality bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @~0: 28 bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @0 : 28 bits (guessed)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== 32-bit processes (on an x86_64 kernel) =====&lt;br /&gt;
&lt;br /&gt;
{{hc|linux-hardened|&lt;br /&gt;
Anonymous mapping randomization test     : 16 quality bits (guessed)&lt;br /&gt;
Heap randomization test (ET_EXEC)        : 22 quality bits (guessed)&lt;br /&gt;
Heap randomization test (PIE)            : 27 quality bits (guessed)&lt;br /&gt;
Main executable randomization (ET_EXEC)  : No randomization&lt;br /&gt;
Main executable randomization (PIE)      : 18 quality bits (guessed)&lt;br /&gt;
Shared library randomization test        : 16 quality bits (guessed)&lt;br /&gt;
VDSO randomization test                  : 16 quality bits (guessed)&lt;br /&gt;
Stack randomization test (SEGMEXEC)      : 24 quality bits (guessed)&lt;br /&gt;
Stack randomization test (PAGEEXEC)      : 24 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (SEGMEXEC)    : 28 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (PAGEEXEC)    : 28 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_EXEC): 18 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_DYN) : 16 quality bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @~0: 18 bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @0 : 18 bits (guessed)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{hc|linux|&lt;br /&gt;
Anonymous mapping randomization test     : 8 quality bits (guessed)&lt;br /&gt;
Heap randomization test (ET_EXEC)        : 13 quality bits (guessed)&lt;br /&gt;
Heap randomization test (PIE)            : 13 quality bits (guessed)&lt;br /&gt;
Main executable randomization (ET_EXEC)  : No randomization&lt;br /&gt;
Main executable randomization (PIE)      : 8 quality bits (guessed)&lt;br /&gt;
Shared library randomization test        : 8 quality bits (guessed)&lt;br /&gt;
VDSO randomization test                  : 8 quality bits (guessed)&lt;br /&gt;
Stack randomization test (SEGMEXEC)      : 19 quality bits (guessed)&lt;br /&gt;
Stack randomization test (PAGEEXEC)      : 19 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (SEGMEXEC)    : 11 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (PAGEEXEC)    : 11 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_EXEC): 8 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_DYN) : 13 quality bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @~0: No randomization&lt;br /&gt;
Randomization under memory exhaustion @0 : No randomization&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Restricting access to kernel pointers in the proc filesystem ===&lt;br /&gt;
&lt;br /&gt;
Setting {{ic|kernel.kptr_restrict}} to 1 will hide kernel symbol addresses in {{ic|/proc/kallsyms}} from regular users without {{ic|CAP_SYSLOG}}, making it more difficult for kernel exploits to resolve addresses/symbols dynamically. This will not help that much on a pre-compiled Arch Linux kernel, since a determined attacker could just download the kernel package and get the symbols manually from there, but if you are compiling your own kernel, this can help mitigating local root exploits. This will break some {{Pkg|perf}} commands when used by non-root users (but many {{Pkg|perf}} features require root access anyway). See {{Bug|34323}} for more information.&lt;br /&gt;
&lt;br /&gt;
Setting {{ic|kernel.kptr_restrict}} to 2 will hide kernel symbol addresses in {{ic|/proc/kallsyms}} regardless of privileges.&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/sysctl.d/51-kptr-restrict.conf|2=&lt;br /&gt;
kernel.kptr_restrict = 1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|{{pkg|linux-hardened}} sets {{ic|1=kptr_restrict=2}} by default rather than {{ic|0}}.}}&lt;br /&gt;
&lt;br /&gt;
=== BPF hardening ===&lt;br /&gt;
&lt;br /&gt;
BPF is a system used to load and execute bytecode within the kernel dynamically during runtime. It is used in a number of Linux kernel subsystems such as networking (e.g. XDP, tc), tracing (e.g. kprobes, uprobes, tracepoints) and security (e.g. seccomp). It is also useful for advanced network security, performance profiling and dynamic tracing.&lt;br /&gt;
&lt;br /&gt;
BPF was originally an acronym of [[Wikipedia:Berkeley Packet Filter|Berkeley Packet Filter]] since the original classic BPF was used for packet capture tools for BSD. This eventually evolved into Extended BPF (eBPF), which was shortly afterwards renamed to just BPF (not an acronym). BPF should not be confused with packet filtering tools like iptables or netfilter, although BPF can be used to implement packet filtering tools.&lt;br /&gt;
&lt;br /&gt;
BPF code may be either interpreted or compiled using a [[Wikipedia:Just-in-time compilation|Just-In-Time (JIT) compiler]]. The Arch kernel is built with {{ic|CONFIG_BPF_JIT_ALWAYS_ON}} which disables the BPF interpreter and forces all BPF to use JIT compilation. This makes it harder for an attacker to use BPF to escalate attacks that exploit SPECTRE-style vulnerabilities. See [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=290af86629b25ffd1ed6232c4e9107da031705cb the kernel patch which introduced CONFIG_BPF_JIT_ALWAYS_ON] for more details.&lt;br /&gt;
&lt;br /&gt;
The kernel includes a hardening feature for JIT-compiled BPF which can mitigate some types of JIT spraying attacks at the cost of performance and the ability to trace and debug many BPF programs. It may be enabled by setting {{ic|net.core.bpf_jit_harden}} to {{ic|1}} (to enable hardening of unprivileged code) or {{ic|2}} (to enable hardening of all code).&lt;br /&gt;
&lt;br /&gt;
See the {{ic|net.core.bpf_*}} settings in the [https://docs.kernel.org/admin-guide/sysctl/net.html kernel documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
{{Tip|&lt;br /&gt;
* {{Pkg|linux-hardened}} sets {{ic|1=net.core.bpf_jit_harden=2}} by default rather than {{ic|0}}.&lt;br /&gt;
* By default, BPF programs can be run even by unprivileged users. To change that behaviour set {{ic|1=kernel.unprivileged_bpf_disabled=1}}[https://access.redhat.com/security/cve/cve-2021-33624].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== ptrace scope ===&lt;br /&gt;
&lt;br /&gt;
The {{man|2|ptrace}} syscall provides a means by which one process (the &amp;quot;tracer&amp;quot;) may observe and control the execution of another process (the &amp;quot;tracee&amp;quot;), and examine and change the tracee&#039;s memory and registers. {{ic|ptrace}} is commonly used by debugging tools including &#039;&#039;gdb&#039;&#039;, &#039;&#039;strace&#039;&#039;, &#039;&#039;perf&#039;&#039;, &#039;&#039;reptyr&#039;&#039; and other debuggers. However, it also provides a means by which a malicious process can read data from and take control of other processes.&lt;br /&gt;
&lt;br /&gt;
Arch enables the [https://docs.kernel.org/admin-guide/LSM/Yama.html Yama LSM] by default, which provides a {{ic|kernel.yama.ptrace_scope}} [[kernel parameter]]. This parameter is set to {{ic|1}} (restricted) by default which prevents tracers from performing a {{ic|ptrace}} call on traces outside of a restricted scope unless the tracer is privileged or has the {{ic|CAP_SYS_PTRACE}} [[Capabilities|capability]]. This is a significant improvement in security compared to the classic permissions. Without this module, there is no separation between processes running as the same user (in the absence of additional security layers such as {{man|7|pid_namespaces}}).&lt;br /&gt;
&lt;br /&gt;
{{Note|By default, you can still use tools which require {{ic|ptrace}} by running them as privileged processes, e.g. using [[sudo]].}}&lt;br /&gt;
&lt;br /&gt;
If you do not need to use debugging tools, consider setting {{ic|kernel.yama.ptrace_scope}} to {{ic|2}} (admin-only) or {{ic|3}} (no {{ic|ptrace}} possible) to harden the system.&lt;br /&gt;
&lt;br /&gt;
{{Note|Some anti-cheat and DRM implementations rely on {{ic|ptrace}} to work, including Easy Anti-Cheat and Ubisoft Connect under Wine. Setting this parameter to {{ic|2}} or higher might prevent games using these solutions from launching.}}&lt;br /&gt;
&lt;br /&gt;
=== hidepid ===&lt;br /&gt;
&lt;br /&gt;
{{Expansion|1=[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0fb5ce62c5920b6e0a8a061f2fe80e0403281e10 Linux 5.8 implemented private instances] and new values for {{ic|1=hidepid=}}.}}&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|Enabling {{ic|hidepid}} globally is not a supported way of operation by [[systemd]], nor does it have any practical improvements security-wise when systemd is running as service manager. [https://github.com/systemd/systemd/issues/29893#issuecomment-1798030108]}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|&lt;br /&gt;
* This may cause issues for certain applications like an application running in a sandbox and [[Xorg]] (see workaround).&lt;br /&gt;
* This causes issues with [[D-Bus]], [[Polkit]], [[PulseAudio]] and [[bluetooth]] when using {{Pkg|systemd}} &amp;gt; 237.64-1.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The kernel has the ability to hide other users&#039; processes, normally accessible via {{ic|/proc}}, from unprivileged users by mounting the {{ic|proc}} filesystem with the {{ic|1=hidepid=}} and {{ic|1=gid=}} options documented in https://docs.kernel.org/filesystems/proc.html.&lt;br /&gt;
&lt;br /&gt;
This greatly complicates an intruder&#039;s task of gathering information about running processes, whether some daemon runs with elevated privileges, whether other user runs some sensitive program, whether other users run any program at all, makes it impossible to learn whether any user runs a specific program (given the program does not reveal itself by its behaviour), and, as an additional bonus, poorly written programs passing sensitive information via program arguments are now protected against local eavesdroppers.&lt;br /&gt;
&lt;br /&gt;
The {{ic|proc}} [[Users and groups#System groups|group]], provided by the {{Pkg|filesystem}} package, acts as a whitelist of users authorized to learn other users&#039; process information. If users or services need access to {{ic|/proc/&amp;lt;pid&amp;gt;}} directories beyond their own, [[Users and groups#Group management|add them to the group]].&lt;br /&gt;
&lt;br /&gt;
For example, to hide process information from other users except those in the {{ic|proc}} group:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/fstab|2=&lt;br /&gt;
proc	/proc	proc	nosuid,nodev,noexec,hidepid=2,gid=proc	0	0&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
For user sessions to work correctly, an exception needs to be added for &#039;&#039;systemd-logind&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/systemd/system/systemd-logind.service.d/hidepid.conf|2=&lt;br /&gt;
[Service]&lt;br /&gt;
SupplementaryGroups=proc&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Restricting module loading ===&lt;br /&gt;
&lt;br /&gt;
The default Arch kernel has {{ic|CONFIG_MODULE_SIG_ALL}} enabled, which signs all kernel modules built as part of the {{Pkg|linux}} package. This allows the kernel to only load modules signed with a valid key, i.e. out-of-tree modules compiled locally or provided by packages such as {{Pkg|virtualbox-host-modules-arch}} cannot be loaded. You can use {{ic|1=modinfo}} to verify currently loaded modules have signatures; verifying the signatures by hand is slightly more involved [https://unix.stackexchange.com/a/496800].&lt;br /&gt;
&lt;br /&gt;
Kernel module loading can be restricted by setting the {{ic|1=module.sig_enforce=1}} [[kernel parameter]]. More information can be found in the [https://docs.kernel.org/admin-guide/module-signing.html kernel documentation].&lt;br /&gt;
&lt;br /&gt;
Further, unneeded individual modules can be [[blacklist]]ed, see [https://github.com/secureblue/secureblue/blob/live/files/system/usr/lib/modprobe.d/secureblue.conf secureblue] for examples.&lt;br /&gt;
&lt;br /&gt;
=== Disable kexec ===&lt;br /&gt;
&lt;br /&gt;
Kexec allows replacing the current running kernel.&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/sysctl.d/51-kexec-restrict.conf|2=&lt;br /&gt;
kernel.kexec_load_disabled = 1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|kexec is disabled by default in {{pkg|linux-hardened}}.}}&lt;br /&gt;
&lt;br /&gt;
=== Kernel lockdown mode ===&lt;br /&gt;
&lt;br /&gt;
Linux supports an optional [https://mjg59.dreamwidth.org/55105.html lockdown feature], intended to strengthen the boundary between UID 0 (root) and the kernel. When enabled some applications may cease to work which rely on low-level access to either hardware or the kernel.&lt;br /&gt;
&lt;br /&gt;
To use lockdown, its LSM must be initialized and a lockdown mode must be set.&lt;br /&gt;
&lt;br /&gt;
All [[Kernel#Officially supported kernels|officially supported kernels]] initialize the LSM, but none of them enforce any lockdown mode.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Initialized LSMs can be verified by running {{ic|cat /sys/kernel/security/lsm}}.}}&lt;br /&gt;
&lt;br /&gt;
Lockdown has two modes of operation:&lt;br /&gt;
&lt;br /&gt;
* {{ic|integrity}}: kernel features that allow userland to modify the running kernel are disabled (e.g. kexec, bpf).&lt;br /&gt;
* {{ic|confidentiality}}: kernel features that allow userland to extract confidential information from the kernel are also disabled.&lt;br /&gt;
&lt;br /&gt;
It is recommended to use {{ic|integrity}}, unless your specific threat model dictates otherwise.&lt;br /&gt;
&lt;br /&gt;
To enable kernel lockdown at runtime, run:&lt;br /&gt;
&lt;br /&gt;
 # echo &#039;&#039;mode&#039;&#039; &amp;gt; /sys/kernel/security/lockdown&lt;br /&gt;
&lt;br /&gt;
To enable kernel lockdown on boot, use the [[kernel parameter]] {{ic|1=lockdown=&#039;&#039;mode&#039;&#039;}}.&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* Kernel lockdown cannot be disabled at runtime.&lt;br /&gt;
* Kernel lockdown disables [[hibernation]].&lt;br /&gt;
* Versions &amp;lt;6.17 of the {{man|7|kernel_lockdown}} man page incorrectly state that &amp;quot;lockdown will be automatically enabled if the system boots in EFI Secure Boot mode&amp;quot;. This is not the behaviour of the upstream kernel, nor Arch&#039;s packaged [[kernel]]s.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
See also {{man|7|kernel_lockdown}}.&lt;br /&gt;
&lt;br /&gt;
=== Linux Kernel Runtime Guard (LKRG) ===&lt;br /&gt;
&lt;br /&gt;
[https://www.openwall.com/lkrg/ LKRG] ({{AUR|lkrg-dkms}}) is a kernel module which performs integrity checking of the kernel and detection of exploit attempts.&lt;br /&gt;
&lt;br /&gt;
=== Disable emergency shell ===&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|Masking {{ic|emergency.target}} and {{ic|emergency.service}} will have no effect on those units being added to the initramfs and run in early userspace. Even with them in the initramfs, mkinitcpio&#039;s systemd hook locks the root account[https://gitlab.archlinux.org/archlinux/packaging/packages/systemd/-/commit/292cdf8a2f7dd7c6c7d91d2b59617391935c837c][https://gitlab.archlinux.org/archlinux/packaging/packages/systemd/-/commit/8835b2f5dfbe8663f1a2fd08edbd35f90bf08691] for &amp;quot;security reasons&amp;quot; (see {{Bug|70408}}). The solution for the issue in the linked article, if even needed, would be to prevent {{ic|rescue.target}}, {{ic|rescue.service}}, {{ic|emergency.target}} and {{ic|emergency.service}} from being added to the initramfs image.}}&lt;br /&gt;
&lt;br /&gt;
The emergency shell is used to interactively troubleshoot the machine during the boot process. However, it is also a gadget that an attacker can use to access secure resources such as the TPM. See [https://pulsesecurity.co.nz/advisories/tpm-luks-bypass this article] for a practical example. The difficulty of attacks can be increased by disabling the emergency shell, at the tradeoff of removing a tool to troubleshoot early boot failures.&lt;br /&gt;
&lt;br /&gt;
To disable the emergency shell, See [[systemd#Disable emergency mode on remote machine]].&lt;br /&gt;
&lt;br /&gt;
== Sandboxing applications ==&lt;br /&gt;
&lt;br /&gt;
See also [[Wikipedia:Sandbox (computer security)]].&lt;br /&gt;
&lt;br /&gt;
To improve the security of systemd service units, see [[systemd/Sandboxing]].&lt;br /&gt;
&lt;br /&gt;
{{Warning|Unprivileged user namespace usage is enabled by default in all [[Kernel#Officially supported kernels|officially supported kernels]] except for {{Pkg|linux-hardened}}. Unprivileged user namespaces greatly increase the attack surface for local privilege escalation; see [https://gitlab.com/apparmor/apparmor/-/wikis/unprivileged_userns_restriction AppArmor&#039;s Wiki] and {{Bug|36969}}.}}&lt;br /&gt;
&lt;br /&gt;
To mitigate this, either:&lt;br /&gt;
	&lt;br /&gt;
* use the {{Pkg|linux-hardened}} kernel which has the safe default, or&lt;br /&gt;
* set the {{ic|kernel.unprivileged_userns_clone}} [[sysctl]] to {{ic|0}}.&lt;br /&gt;
	&lt;br /&gt;
Note that this can break applications such as {{pkg|nsjail}}. [[Chromium]] based applications need SUID bit for {{ic|chrome-sandbox}} to work with this setting.&lt;br /&gt;
&lt;br /&gt;
=== Firejail ===&lt;br /&gt;
&lt;br /&gt;
[[Firejail]] is an easy to use tool for sandboxing applications and servers alike. It was originally created for browsers and internet facing applications, but supports a large number of applications by now. To establish a sandboxed environment with a variety of features, it is installed as a suid binary and builds a sandboxed runtime environment for the target application based on black and white lists.&lt;br /&gt;
&lt;br /&gt;
=== bubblewrap ===&lt;br /&gt;
&lt;br /&gt;
[[bubblewrap]] is a sandbox application developed for unprivileged container tools like [[Flatpak]] with a significantly smaller resource footprint and complexity than Firejail. While it lacks certain features such as file path whitelisting, bubblewrap does offer bind mounts as well as the creation of user/IPC/PID/network/cgroup namespaces and can support both simple and complex sandboxes. For the {{Pkg|linux-hardened}} kernel you will need to to use {{Pkg|bubblewrap-suid}}.&lt;br /&gt;
&lt;br /&gt;
[[Bubblejail]] sandbox is based on [[bubblewrap]] and provides a resource oriented permission model with a graphical interface to tweak permissions.&lt;br /&gt;
&lt;br /&gt;
=== Portable ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Kraftland/portable Portable] is a sandboxing framework which utilizes [[bubblewrap]] and many other tools to lockdown running applications. It is designed to be simple for packagers and efficient for users, yet cuts off security holes and monitors background processes by default.&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/Kraftland/portable-arch portable-arch] for a repository of applications sandboxed by portable.&lt;br /&gt;
&lt;br /&gt;
If a sandboxed application does not utilize the Portal file chooser, portable can pass files to the sandbox (by passing {{ic|--actions share-files}}).&lt;br /&gt;
&lt;br /&gt;
Portable is fully functional on GNOME, while other desktops may lack small amounts of features like advanced background monitoring and ScreenShot portal.&lt;br /&gt;
&lt;br /&gt;
=== chroots ===&lt;br /&gt;
&lt;br /&gt;
Manual [[chroot]] jails can also be constructed to build sandboxed process environments. It is much more limited than other sandboxing technologies; the extent of its sandboxing is file path isolation.&lt;br /&gt;
&lt;br /&gt;
=== Linux containers ===&lt;br /&gt;
&lt;br /&gt;
[[Linux Containers]] are another good option when you need more separation than the other options (short of [[#Full virtualization options|full system virtualization]]) provide. LXC is run on top of the existing kernel in a pseudo-chroot with their own virtual hardware.&lt;br /&gt;
&lt;br /&gt;
=== gVisor ===&lt;br /&gt;
&lt;br /&gt;
The [https://gvisor.dev/ gVisor] project, led by Google, is providing a sandboxing application with a focus on containers following the [https://opencontainers.org/ OCI initiative], such as [[Docker]] and [[Kubernetes]]. It isolates containers and individual applications from the host by intercepting a majority of system calls to the kernel and presenting itself as guest kernel.&lt;br /&gt;
&lt;br /&gt;
A key difference to other intercepting sandboxing projects is that gVisor re-implements system calls in the Go programming language, as described in its [https://gvisor.dev/docs/architecture_guide/intro/ design overview]. Details for the list of [https://gvisor.dev/docs/user_guide/compatibility/linux/amd64/ re-implemented syscalls support] can be seen in [https://github.com/google/gvisor/blob/master/pkg/sentry/syscalls/linux/linux64.go git]. For usage examples, limitations and special features see the project [https://gvisor.dev/docs/ documentation].&lt;br /&gt;
&lt;br /&gt;
The application is available as {{Aur|gvisor-git}} and {{Aur|gvisor-bin}}.&lt;br /&gt;
&lt;br /&gt;
=== Full virtualization options ===&lt;br /&gt;
&lt;br /&gt;
Using full virtualization options such as [[VirtualBox]], [[KVM]], [[Xen]] or [https://www.qubes-os.org/ Qubes OS] (based on Xen) can also improve isolation and security in the event you plan on running risky applications or browsing dangerous websites.&lt;br /&gt;
&lt;br /&gt;
== Network and firewalls ==&lt;br /&gt;
&lt;br /&gt;
=== Firewalls ===&lt;br /&gt;
&lt;br /&gt;
While the stock Arch kernel is capable of using [[Wikipedia:Netfilter|Netfilter]]&#039;s [[iptables]] and [[nftables]], the services are not [[enable]]d by default. It is highly recommended to set up some form of firewall to protect the services running on the system. Many resources (including ArchWiki) do not state explicitly which services are worth protecting, so enabling a firewall is a good precaution.&lt;br /&gt;
&lt;br /&gt;
* See [[iptables]] and [[nftables]] for general information.&lt;br /&gt;
* See [[Simple stateful firewall]] for a guide on setting up an iptables firewall.&lt;br /&gt;
* See [[:Category:Firewalls]] for other ways of setting up netfilter.&lt;br /&gt;
* See [[Ipset]] for blocking lists of ip addresses, such as those from Bluetack.&lt;br /&gt;
* {{Pkg|opensnitch}} is a configurable inbound and outbound firewall with support for configurable rules by application, port, host, etc.&lt;br /&gt;
&lt;br /&gt;
A quick way to setup a basic firewall is to use the tool {{ic|ufw}} (Uncomplicated Fire Wall). Then set {{ic|ufw default deny incoming}} and {{ic|ufw default allow outgoing}} and enabling it with {{ic|ufw enable}} and {{ic|systemctl enable ufw}}.&lt;br /&gt;
&lt;br /&gt;
==== Open ports ====&lt;br /&gt;
&lt;br /&gt;
{{Style|&amp;quot;Open ports&amp;quot; is not a good title since it disregards interfaces and addresses that the application may be bound to. From the firewalls&#039; point of view, ports may be &amp;quot;open&amp;quot; even if no application listens on them at the moment.}}&lt;br /&gt;
&lt;br /&gt;
Some services listen for inbound traffic on open network ports. It is important to only bind these services to the addresses and interfaces that are strictly necessary. It may be possible for a remote attacker to [https://samy.pl/slipstream/ exploit flawed network protocols to access exposed services]. This can even happen with [https://nvd.nist.gov/vuln/detail/CVE-2019-13450 processes bound to localhost].&lt;br /&gt;
&lt;br /&gt;
In general, if a service only needs to be accessible to the local system, bind to a Unix domain socket ({{man|7|unix}}) or a loopback address such as {{ic|localhost}} instead of a non-loopback address like {{ic|0.0.0.0/0}}.&lt;br /&gt;
&lt;br /&gt;
If a service needs to be accessible to other systems via the network, control the access with strict [[firewall]] rules and configure authentication, authorization and encryption whenever possible.&lt;br /&gt;
&lt;br /&gt;
You can list all current open ports with {{ic|ss -l}}. To show all &#039;&#039;&#039;l&#039;&#039;&#039;istening &#039;&#039;&#039;p&#039;&#039;&#039;rocesses and their &#039;&#039;&#039;n&#039;&#039;&#039;umeric &#039;&#039;&#039;t&#039;&#039;&#039;cp and &#039;&#039;&#039;u&#039;&#039;&#039;dp port numbers:&lt;br /&gt;
&lt;br /&gt;
 # ss -lpntu&lt;br /&gt;
&lt;br /&gt;
See {{man|8|ss}} for more options.&lt;br /&gt;
&lt;br /&gt;
=== Kernel parameters ===&lt;br /&gt;
&lt;br /&gt;
Kernel parameters which affect networking can be set using [[Sysctl]]. For how to do this, see [[Sysctl#TCP/IP stack hardening]].&lt;br /&gt;
&lt;br /&gt;
=== SSH ===&lt;br /&gt;
&lt;br /&gt;
To mitigate [[Wikipedia:Brute-force attack|brute-force attacks]] it is recommended to enforce key-based authentication. For OpenSSH see [[OpenSSH#Protection]] for more recommendations. Alternatively [[Fail2ban]] or [[Sshguard]] offer lesser forms of protection by monitoring logs and writing [[firewall]] rules but open up the potential for a denial of service, since an attacker can [[Wikipedia:Spoofing attack#Spoofing and TCP/IP|spoof]] packets as if they came from the administrator after identifying their address. Spoofing IP has lines of defense, such as by [[sysctl#Reverse path filtering|reverse path filtering]] and [[sysctl#Disable ICMP redirects|disabling ICMP redirects]].&lt;br /&gt;
&lt;br /&gt;
You may want to harden authentication even more by using two-factor authentication. [[Google Authenticator]] provides a two-step authentication procedure using one-time passcodes (OTP).&lt;br /&gt;
&lt;br /&gt;
Denying root login is also a good practice, both for tracing intrusions and adding an additional layer of security before root access. For OpenSSH, see [[OpenSSH#Deny]].&lt;br /&gt;
&lt;br /&gt;
Mozilla publishes an [https://infosec.mozilla.org/guidelines/openssh.html OpenSSH configuration guide] which configures more verbose audit logging and restricts ciphers.&lt;br /&gt;
&lt;br /&gt;
=== DNS ===&lt;br /&gt;
&lt;br /&gt;
The default domain name resolution (DNS) configuration is highly compatible but has security weaknesses. See [[Domain name resolution#Privacy and security|DNS privacy and security]] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Proxies ===&lt;br /&gt;
&lt;br /&gt;
Proxies are commonly used as an extra layer between applications and the network, sanitizing data from untrusted sources. The attack surface of a small proxy running with lower privileges is significantly smaller than a complex application running with the end user privileges.&lt;br /&gt;
&lt;br /&gt;
For example the DNS resolver is implemented in {{Pkg|glibc}}, that is linked with the application (that may be running as root), so a bug in the DNS resolver might lead to a remote code execution. This can be prevented by installing a DNS caching server, such as [[dnsmasq]], which acts as a proxy. [https://googleonlinesecurity.blogspot.it/2016/02/cve-2015-7547-glibc-getaddrinfo-stack.html]&lt;br /&gt;
&lt;br /&gt;
=== Managing TLS certificates ===&lt;br /&gt;
&lt;br /&gt;
See [[TLS#Trust management]].&lt;br /&gt;
&lt;br /&gt;
== Physical security ==&lt;br /&gt;
&lt;br /&gt;
Physical access to a computer is root access given enough time and resources. However, a high &#039;&#039;practical&#039;&#039; level of security can be obtained by putting up enough barriers.&lt;br /&gt;
&lt;br /&gt;
An attacker can gain full control of your computer on the next boot by simply attaching a malicious IEEE 1394 (FireWire), Thunderbolt or PCI Express device as they are given full memory access by default.[https://web.archive.org/web/20210312083421/http://breaknenter.org/2014/09/inception-metasploit-integration/] For Thunderbolt, you can restrict the direct memory access completely or to known devices, see [[Thunderbolt#User device authorization|user device authorization]]. For Firewire and PCI Express, there is little you can do from preventing this, or modification of the hardware itself - such as flashing malicious firmware onto a drive. However, the vast majority of attackers will not be this knowledgeable and determined.&lt;br /&gt;
&lt;br /&gt;
[[#Data-at-rest encryption|Data-at-rest encryption]] will prevent access to your data if the computer is stolen, but malicious firmware can be installed to obtain this data upon your next log in by a resourceful attacker.&lt;br /&gt;
&lt;br /&gt;
=== Locking down BIOS ===&lt;br /&gt;
&lt;br /&gt;
Adding a password to the BIOS prevents someone from booting into removable media, which is basically the same as having root access to your computer. You should make sure your drive is first in the boot order and disable the other drives from being bootable if you can.&lt;br /&gt;
&lt;br /&gt;
=== Boot loaders ===&lt;br /&gt;
&lt;br /&gt;
It is highly important to protect your [[boot loader]]. An unprotected boot loader can bypass any login restrictions, e.g. by setting the {{ic|1=init=/bin/sh}} [[kernel parameter]] to boot directly to a shell.&lt;br /&gt;
&lt;br /&gt;
==== Syslinux ====&lt;br /&gt;
&lt;br /&gt;
[[Syslinux]] supports [[Syslinux#Security|password-protecting your boot loader]]. It allows you to set either a per-menu-item password or a global boot loader password.&lt;br /&gt;
&lt;br /&gt;
==== GRUB ====&lt;br /&gt;
&lt;br /&gt;
[[GRUB]] supports boot loader passwords as well. See [[GRUB/Tips and tricks#Password protection of GRUB menu]] for details. It also has support for [[GRUB#Encrypted /boot|encrypted /boot]], which only leaves some parts of the boot loader code unencrypted. GRUB&#039;s configuration, [[kernel]] and [[initramfs]] are encrypted.&lt;br /&gt;
&lt;br /&gt;
==== systemd-boot ====&lt;br /&gt;
&lt;br /&gt;
[[systemd-boot]] disables editing of kernel parameters when [[#Secure Boot|Secure Boot]] is enabled. Alternatively, you can set [[systemd-boot#Kernel parameters editor with password protection|kernel parameters for password protection]] in systemd-boot for a more traditional password-based option.&lt;br /&gt;
&lt;br /&gt;
=== Secure Boot ===&lt;br /&gt;
&lt;br /&gt;
[[Secure Boot]] is a feature of [[UEFI]] that allows authentication of the files your computer boots. This helps preventing some [[Wikipedia:Evil maid attack|evil maid attacks]] such as replacing files inside the boot partition. Normally computers come with keys that are enrolled by vendors (OEM). However these can be removed and allow the computer to enter &#039;&#039;Setup Mode&#039;&#039; which allows the user to enroll and manage their own keys.&lt;br /&gt;
&lt;br /&gt;
The secure boot page guides you through how to set secure boot up by [[Unified Extensible Firmware Interface/Secure Boot#Using your own keys|using your own keys]].&lt;br /&gt;
&lt;br /&gt;
=== Trusted Platform Module (TPM) ===&lt;br /&gt;
&lt;br /&gt;
[[Trusted Platform Module|TPMs]] are hardware microprocessors which have cryptographic keys embedded. This forms the fundamental root of trust of most modern computers and allows end-to-end verification of the boot chain. They can be used as internal smartcards, attest the firmware running on the computer and allow users to insert secrets into a tamper-proof and brute-force resistant store.&lt;br /&gt;
&lt;br /&gt;
=== Boot partition on removable flash drive ===&lt;br /&gt;
&lt;br /&gt;
One popular idea is to place the boot partition on a flash drive in order to render the system unbootable without it. Proponents of this idea often use [[#Data-at-rest encryption|full-disk encryption]] alongside, and some also use [[Dm-crypt/Specialties#Encrypted system using a detached LUKS header|detached encryption headers]] placed on the boot partition.&lt;br /&gt;
&lt;br /&gt;
This method can also be merged with [[Dm-crypt/Specialties#Encrypted /boot and a detached LUKS header on USB|encrypting /boot]].&lt;br /&gt;
&lt;br /&gt;
=== Automatic logout ===&lt;br /&gt;
&lt;br /&gt;
If you are using [[Bash]] or [[Zsh]], you can set {{ic|TMOUT}} for an automatic logout from shells after a timeout.&lt;br /&gt;
&lt;br /&gt;
For example, the following will automatically log out from virtual consoles (but not terminal emulators in X11):&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/profile.d/shell-timeout.sh|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
TMOUT=&amp;quot;$(( 60*10 ))&amp;quot;;&lt;br /&gt;
[ -z &amp;quot;$DISPLAY&amp;quot; ] &amp;amp;&amp;amp; export TMOUT;&lt;br /&gt;
case $( /usr/bin/tty ) in&lt;br /&gt;
	/dev/tty[0-9]*) export TMOUT;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
If you really want EVERY Bash/Zsh prompt (even within X) to timeout, use:&lt;br /&gt;
&lt;br /&gt;
 $ export TMOUT=&amp;quot;$(( 60*10 ))&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
Note that this will not work if there is some command running in the shell (eg.: an SSH session or other shell without {{ic|TMOUT}} support). But if you are using VC mostly for restarting frozen GDM/Xorg as root, then this is very useful.&lt;br /&gt;
&lt;br /&gt;
=== Protect against rogue USB devices ===&lt;br /&gt;
&lt;br /&gt;
The kernel has [https://docs.kernel.org/usb/authorization.html settings to deactivate] USB ports to protect your computer against rogue USB devices (a.k.a. [[Wikipedia:BadUSB|BadUSB]], [https://github.com/samyk/poisontap PoisonTap] or [https://lanturtle.com/ LanTurtle]). They can be set at runtime and automated via [[sysctl]].&lt;br /&gt;
&lt;br /&gt;
For more control install [[USBGuard]], which is a software framework implementing basic whitelisting and blacklisting capabilities based on device attributes.&lt;br /&gt;
&lt;br /&gt;
=== Volatile data collection ===&lt;br /&gt;
&lt;br /&gt;
A computer that is powered on may be vulnerable to [https://web.archive.org/web/20210420075636/https://fedvte.usalearning.gov/courses/CSI/course/videos/pdf/CSI_D01_S05_T01_STEP.pdf volatile data collection]. It is a best practice to turn a computer completely off at times it is not necessary for it to be on, or if the computer&#039;s physical security is temporarily compromised (e.g. when passing through a security checkpoint).&lt;br /&gt;
&lt;br /&gt;
== Packages ==&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
[https://www2.cs.arizona.edu/stork/packagemanagersecurity/attacks-on-package-managers.html#overview Attacks on package managers] are possible without proper use of package signing, and can affect even package managers with [https://www2.cs.arizona.edu/stork/packagemanagersecurity/faq.html proper signature systems]. Arch uses package signing by default and relies on a web of trust from 5 trusted master keys. See [[Pacman-key]] for details.&lt;br /&gt;
&lt;br /&gt;
=== Upgrades ===&lt;br /&gt;
&lt;br /&gt;
It is important to regularly [[System maintenance#Upgrading the system|upgrade the system]].&lt;br /&gt;
&lt;br /&gt;
=== Follow vulnerability alerts ===&lt;br /&gt;
&lt;br /&gt;
Subscribe to the Common Vulnerabilities and Exposure (CVE) Security Alert updates, made available by National Vulnerability Database, and found on the [https://nvd.nist.gov/download.cfm NVD Download webpage]. &lt;br /&gt;
&lt;br /&gt;
The tool {{Pkg|arch-audit}} can be used to check for vulnerabilities affecting the running system. A graphical system tray, {{Pkg|arch-audit-gtk}}, can also be used. See also [[Arch Security Team]].&lt;br /&gt;
&lt;br /&gt;
You should also consider subscribing to the release notifications for software you use, especially if you install software through means other than the main repositories or AUR. Some software have mailing lists you can subscribe to for security notifications. Source code hosting sites often offer RSS feeds for new releases.&lt;br /&gt;
&lt;br /&gt;
=== Rebuilding packages ===&lt;br /&gt;
&lt;br /&gt;
Packages can be rebuilt and stripped of undesired functions and features as a means to reduce attack surface. For example, {{Pkg|bzip2}} can be rebuilt without {{ic|bzip2recover}} in an attempt to circumvent [https://security.archlinux.org/CVE-2016-3189 CVE-2016-3189]. Custom hardening flags can also be applied either manually or via a wrapper.&lt;br /&gt;
&lt;br /&gt;
{{Merge|Arch package guidelines/Security|Security related build flags have their own article.}}&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|Copy-pasted from a 3 years old blog post. The compiler flags are specific to [[GCC]], some are hardly security related.}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Flag !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| -D_FORTIFY_SOURCE=2 || Run-time buffer overflow detection&lt;br /&gt;
|-&lt;br /&gt;
| -D_GLIBCXX_ASSERTIONS || Run-time bounds checking for C++ strings and containers&lt;br /&gt;
|-&lt;br /&gt;
| -fasynchronous-unwind-tables || Increased reliability of backtraces&lt;br /&gt;
|-&lt;br /&gt;
| -fexceptions || Enable table-based thread cancellation&lt;br /&gt;
|-&lt;br /&gt;
| -fpie -Wl,-pie || Full ASLR for executables&lt;br /&gt;
|-&lt;br /&gt;
| -fpic -shared || No text relocations for shared libraries&lt;br /&gt;
|-&lt;br /&gt;
| -fplugin=annobin || Generate data for hardening quality control&lt;br /&gt;
|-&lt;br /&gt;
| -fstack-clash-protection || Increased reliability of stack overflow detection&lt;br /&gt;
|-&lt;br /&gt;
| -fstack-protector, -fstack-protector-all or -fstack-protector-strong || Stack smashing protector&lt;br /&gt;
|-&lt;br /&gt;
| -grecord-gcc-switches || Store compiler flags in debugging information&lt;br /&gt;
|-&lt;br /&gt;
| -mcet -fcf-protection || Control flow integrity protection&lt;br /&gt;
|-&lt;br /&gt;
| -Werror=format-security || Reject potentially unsafe format string arguments&lt;br /&gt;
|-&lt;br /&gt;
| -Werror=implicit-function-declaration || Reject missing function prototypes&lt;br /&gt;
|-&lt;br /&gt;
| -Wl,-z,defs || Detect and reject underlinking&lt;br /&gt;
|-&lt;br /&gt;
| -Wl,-z,now || Disable lazy binding&lt;br /&gt;
|-&lt;br /&gt;
| -Wl,-z,relro || Read-only segments after relocation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* [https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/ Flags and info source]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://security.archlinux.org/ Arch Linux Security Tracker]&lt;br /&gt;
* [https://wiki.centos.org/HowTos/OS_Protection CentOS Wiki: OS Protection]&lt;br /&gt;
* [https://web.archive.org/web/20210712001756/https://developer.ibm.com/technologies/linux/articles/l-harden-desktop/ Hardening the Linux desktop]&lt;br /&gt;
* [https://web.archive.org/web/20190701140035/https://www.ibm.com/developerworks/linux/tutorials/l-harden-server/index.html Hardening the Linux server]&lt;br /&gt;
* [https://github.com/lfit/itpol/blob/master/linux-workstation-security.md Linux Foundation: Linux workstation security checklist]&lt;br /&gt;
* [https://www.privacyguides.org/ privacyguides.org Privacy Resources]&lt;br /&gt;
* [https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide/ Red Hat Enterprise Linux 7 Security Guide]&lt;br /&gt;
* [https://www.debian.org/doc/manuals/securing-debian-manual/index.en.html Securing Debian Manual]&lt;br /&gt;
* [https://web.archive.org/web/20140220055801/http://crunchbang.org:80/forums/viewtopic.php?id=24722 The paranoid #! Security Guide]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Security&amp;diff=873613</id>
		<title>Security</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Security&amp;diff=873613"/>
		<updated>2026-05-11T18:57:53Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Enforce a delay after a failed login attempt */ remove note template for readability; the previous short note is important to accomplish the configuration, the rest regular supplementary info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Security]]&lt;br /&gt;
[[Category:File systems]]&lt;br /&gt;
[[Category:Networking]]&lt;br /&gt;
[[de:Sicherheit]]&lt;br /&gt;
[[es:Security]]&lt;br /&gt;
[[hu:Security]]&lt;br /&gt;
[[ja:セキュリティ]]&lt;br /&gt;
[[pt:Security]]&lt;br /&gt;
[[ru:Security]]&lt;br /&gt;
[[zh-hans:Security]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|Arch Security Team}}&lt;br /&gt;
{{Related|General recommendations}}&lt;br /&gt;
{{Related|Identity management}}&lt;br /&gt;
{{Related|Capabilities}}&lt;br /&gt;
{{Related|List of Applications/Security}}&lt;br /&gt;
{{Related|Arch package guidelines/Security}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
This article contains recommendations and best practices for [[Wikipedia:Hardening (computing)|hardening]] an Arch Linux system.&lt;br /&gt;
&lt;br /&gt;
== Concepts ==&lt;br /&gt;
&lt;br /&gt;
* It &#039;&#039;is&#039;&#039; possible to tighten security to the point where the system is unusable. Security and convenience must be balanced. The trick is to create a secure &#039;&#039;and&#039;&#039; useful system.&lt;br /&gt;
* The biggest threat is, and will always be, the user.&lt;br /&gt;
* The [[Wikipedia:Principle of least privilege|principle of least privilege]]: Each part of a system should only be able to access what is strictly required, and nothing more.&lt;br /&gt;
* Defense in depth: Security works better in independent layers. When one layer is breached, another should stop the attack.&lt;br /&gt;
* Be a little paranoid. And be suspicious. If anything sounds too good to be true, it probably is!&lt;br /&gt;
* You can never make a system 100% secure unless you unplug the machine from all networks, turn it off, lock it in a safe, smother it in concrete and never use it.&lt;br /&gt;
* Prepare for failure. Create a plan ahead of time to follow when your security is broken.&lt;br /&gt;
&lt;br /&gt;
== Passwords ==&lt;br /&gt;
&lt;br /&gt;
Passwords are key to a secure system. They secure your [[Users and groups|user accounts]], [[Data-at-rest encryption|encrypted filesystems]], and [[SSH keys|SSH]]/[[GPG]] keys. They are the main way a computer chooses to trust the person using it, so a big part of security is just about picking secure passwords and protecting them.&lt;br /&gt;
&lt;br /&gt;
=== Choosing secure passwords ===&lt;br /&gt;
&lt;br /&gt;
Passwords must be complex enough to not be easily guessed from e.g. personal information, or [[Wikipedia:Password cracking|cracked]] using methods like brute-force attacks. The tenets of strong passwords are based on &#039;&#039;length&#039;&#039; and &#039;&#039;randomness&#039;&#039;. In cryptography the quality of a password is often referred to as its [[Wikipedia:Password strength#Entropy as a measure of password strength|entropy]].&lt;br /&gt;
&lt;br /&gt;
Insecure passwords include those containing or those using as a base before substitution/variation:&lt;br /&gt;
&lt;br /&gt;
* Personally identifiable information (e.g., your dog&#039;s name, date of birth, area code, favorite video game)&lt;br /&gt;
* Simple character substitutions on words (e.g., {{ic|k1araj0hns0n}}), as modern dictionary attacks can easily work with these&lt;br /&gt;
* Root &amp;quot;words&amp;quot; or common strings followed or preceded by added numbers, symbols, or characters (e.g., {{ic|DG091101%}})&lt;br /&gt;
* Common phrases or short strings of common dictionary words (e.g. {{ic|photocopyhauntbranchexpose}}) including with character substitution (e.g. {{ic|Ph0toc0pyh4uN7br@nch3xp*se}}) (See Diceware below for when a combination of dictionary words can be secure)&lt;br /&gt;
* Any of the [[Wikipedia:List of the most common passwords|most common passwords]]&lt;br /&gt;
&lt;br /&gt;
The best choice for a password is something long (the longer, the better) and generated from a random source. It is important to use a long password. [https://www.theregister.com/2019/02/14/password_length Weak hash algorithms allow an 8-character password hash to be compromised in just a few hours.]&lt;br /&gt;
&lt;br /&gt;
Tools like {{Pkg|pwgen}} or {{AUR|apg}} can generate random passwords. However, these passwords can be difficult to memorize. One memorization technique (for ones often typed) is to generate a long password and memorize a minimally secure number of characters, temporarily writing down the full generated string. Over time, increase the number of characters typed - until the password is ingrained in muscle memory and need not be remembered. This technique is more difficult, but can provide confidence that a password will not turn up in wordlists or &amp;quot;intelligent&amp;quot; brute force attacks that combine words and substitute characters.&lt;br /&gt;
&lt;br /&gt;
Apart from password management, {{Pkg|keepassxc}} offers password/passphrase generation. It is possible to customize the generation in a GUI. Dictionary based passphrases are also supported.&lt;br /&gt;
&lt;br /&gt;
One technique for memorizing a password is to use a mnemonic phrase, where each word in the phrase reminds you of the next character in the password.&lt;br /&gt;
Take for instance “the girl is walking down the rainy street” could be translated to {{ic|t6!WdtR5}} or, less simply, {{ic|t&amp;amp;6!RrlW@dtR,57}}.&lt;br /&gt;
This approach could make it easier to remember a password, but note that the various letters have very different probabilities of being found at the start of words ([[Wikipedia:Letter frequency#Relative frequencies of the first letters of a word in the English language|Wikipedia:Letter frequency]]).&lt;br /&gt;
&lt;br /&gt;
Another effective technique can be to write randomly generated passwords down and store them in a &#039;&#039;safe&#039;&#039; place, such as in a wallet, purse, or document safe. Most people do a generally good job of protecting their physical valuables from attack, and it is easier for most people to understand physical security best practices compared to digital security practices.&lt;br /&gt;
&lt;br /&gt;
It is also very effective to combine the mnemonic and random technique by saving long randomly generated passwords with a [[password manager]], which will be in turn accessed with a memorable &amp;quot;master password&amp;quot;/primary password that must be used only for that purpose. The master password must be memorized and never saved. This requires the password manager to be installed on a system to easily access the password (which could be seen as an inconvenience or a security feature, depending on the situation). Some password managers also have smartphone apps which can be used to display passwords for manual entry on systems without that password manager installed (if that is a common use case, you could still use easily typeable but secure passwords for each service instead of completely random ones, see below). Note that a password manager introduces a single point of failure if you ever forget the master password.&lt;br /&gt;
Some password managers compute the contained passwords based on the master password and the service name where you want to log in instead of encrypting them, making it possible to use it on a new system without syncing any data.&lt;br /&gt;
&lt;br /&gt;
It can be effective to use a memorable long series of unrelated words as a password. The theory is that if a sufficiently long phrase is used, the gained entropy from the password&#039;s length can counter the lost entropy from the use of dictionary words. This [https://xkcd.com/936/ xkcd comic] demonstrates the entropy tradeoff of this method, taking into account the limited set of possible words for each word in the passphrase. If the set of words you choose from is large (multiple thousand words) and you choose 5-7 or even more random words from it, this method provides great entropy, even assuming the attacker knows the set of possible words chosen from and the number of words chosen. The number of possible passphrases after settling on a set of words and number of words is: (number of words in the set of words to select from) to the power of (the number of words chosen for the passphrase). See e.g. [https://www.rempe.us/diceware/ Diceware] for more.&lt;br /&gt;
&lt;br /&gt;
See [https://www.iusmentis.com/security/passphrasefaq/ The passphrase FAQ] or [[Wikipedia:Password strength]] for some additional background.&lt;br /&gt;
&lt;br /&gt;
=== Maintaining passwords ===&lt;br /&gt;
&lt;br /&gt;
Once you pick a strong password, be sure to keep it safe. Watch out for [[Wikipedia:Keylogger|keyloggers]] (software and hardware), screen loggers, [[Wikipedia:Social engineering (security)|social engineering]], [[Wikipedia:Shoulder surfing (computer security)|shoulder surfing]], and avoid reusing passwords so insecure servers cannot leak more information than necessary. [[List of applications/Security#Password managers|Password managers]] can help manage large numbers of complex passwords: if you are copy-pasting the stored passwords from the manager to the applications that need them, make sure to clear the copy buffer every time, and ensure they are not saved in any kind of log (e.g. do not paste them in plain terminal commands, which would store them in files like {{ic|.bash_history}}). Note that password managers that are implemented as browser extensions may be vulnerable to [https://www.spookjs.com side channel attacks]. These can be mitigated by using password managers that run as separate applications.&lt;br /&gt;
&lt;br /&gt;
As a rule, do not pick insecure passwords just because secure ones are harder to remember. Passwords are a balancing act. It is better to have an encrypted database of secure passwords, guarded behind a key and one strong master password, than it is to have many similar weak passwords. Writing passwords down is perhaps equally effective [https://www.schneier.com/blog/archives/2005/06/write_down_your.html], avoiding potential vulnerabilities in software solutions while requiring physical security.&lt;br /&gt;
&lt;br /&gt;
Another aspect of the strength of the passphrase is that it must not be easily recoverable from other places.&lt;br /&gt;
&lt;br /&gt;
If you use the same passphrase for disk encryption as you use for your login password (useful e.g. to auto-mount the encrypted partition or folder on login), make sure that {{ic|/etc/shadow}} ends up on an encrypted partition or/and uses a strong key derivation function (i.e. yescrypt/argon2 or sha512 with PBKDF2, but not md5 or low iterations in PBKDF2) for the stored password hash (see [[SHA password hashes]] for more information).&lt;br /&gt;
&lt;br /&gt;
{{Tip|In 2023 Arch Linux switched the [https://archlinux.org/news/changes-to-default-password-hashing-algorithm-and-umask-settings/ default hashing] algorithm to yescrypt. If you have not customized the default, executing a password change with {{ic|passwd}} is necessary (and sufficient) to apply the new default.}}&lt;br /&gt;
&lt;br /&gt;
If you are backing up your password database, make sure that each copy is not stored behind any other passphrase which in turn is stored in it, e.g. an encrypted drive or an authenticated remote storage service, or you will not be able to access it in case of need; a useful trick is to protect the drives or accounts where the database is backed up using a simple cryptographic hash of the master password. Maintain a list of all the backup locations: if one day you fear that the master passphrase has been compromised you will have to change it immediately on all the database backups and the locations protected with keys derived from the master password.&lt;br /&gt;
&lt;br /&gt;
Version-controlling the database in a secure way can be very complicated: if you choose to do it, you must have a way to update the master password of all the database versions. It may not always be immediately clear when the master password is leaked: to reduce the risk of somebody else discovering your password before you realize that it leaked, you may choose to change it on a periodical basis. If you fear that you have lost control over a copy of the database, you will need to change all the passwords contained in it within the time that it may take to brute-force the master password, according to its entropy.&lt;br /&gt;
&lt;br /&gt;
=== Password hashes ===&lt;br /&gt;
&lt;br /&gt;
A hash is a one-way function, i.e. it is designed to make it impossible to deduct the input without computing the hash function with it (example: MD5, SHA).&lt;br /&gt;
&lt;br /&gt;
A password-hash function is designed to make deducting a user-input (password) impossible without computing the hash function with it (example: bcrypt). A [[Wikipedia:Key derivation function|key derivation function]] (KDF; examples: yescrypt, scrypt, PBKDF2) is a cryptographic algorithm designed to derive secret keys (e.g. an AES key, a password hash) from an input (a master key, a password). Hence, a KDF can serve multiple applications, including those of a password-hash function.&lt;br /&gt;
&lt;br /&gt;
By default, Arch stores the hashed user passwords in the root-only-readable {{ic|/etc/shadow}} file, separated from the other user parameters stored in the world-readable {{ic|/etc/passwd}} file, see [[Users and groups#User database]]. See also [[#Restricting root]].&lt;br /&gt;
&lt;br /&gt;
Passwords are set with the &#039;&#039;&#039;passwd&#039;&#039;&#039; command, which [[Wikipedia:Key stretching|stretches]] them with the system&#039;s crypt function and then saves them in {{ic|/etc/shadow}}. The passwords are also [[Wikipedia:Salt (cryptography)|salted]] in order to defend them against [[Wikipedia:Rainbow table|rainbow table]] attacks. See also [https://www.slashroot.in/how-are-passwords-stored-linux-understanding-hashing-shadow-utils How are passwords stored in Linux (Understanding hashing with shadow utils)].&lt;br /&gt;
&lt;br /&gt;
Since password hashes follow a defined format, the method and parameter can be configured for subsequent new invocations of the &#039;&#039;passwd&#039;&#039; command. Hence, the individual hashes stored in the {{ic|/etc/shadow}} file can be a heterogeneous mix of the hash functions supported by the system.&lt;br /&gt;
&lt;br /&gt;
See {{man|5|crypt}} for more information on the format, hashing methods and parameters.&lt;br /&gt;
&lt;br /&gt;
The {{ic|/etc/login.defs}} file configures the [https://archlinux.org/news/changes-to-default-password-hashing-algorithm-and-umask-settings/ default password hashing] method {{ic|ENCRYPT_METHOD YESCRYPT}} and its parameter {{ic|YESCRYPT_COST_FACTOR}}.&lt;br /&gt;
&lt;br /&gt;
For example, an increment of the default {{ic|YESCRYPT_COST_FACTOR}} parameter will lead to a logarithmic increase of the compute time required to deduce the hash from a password. This applies, likewise, to a third-party trying to obtain the password secret, and the system to authenticate a user log-in.&lt;br /&gt;
&lt;br /&gt;
In contrast, the compute time for the SHA-512 hash function is configured by a parameter with a linear influence. See [[SHA password hashes]] for information on the previous Arch default. Note the yescrypt algorithm internally uses SHA-256, HMAC and PBKDF2 to compute its password-hash. The main reason is to combine positive attributes of these widely used and tested functions for an enhanced resistance to attacks. For example, the usability of SHA for various purposes has resulted in hardware support for the function, i.e. the performance to compute a pure SHA hash has accelerated considerably, making its application as a password-hash function more and more derelict.&lt;br /&gt;
&lt;br /&gt;
=== Enforcing strong passwords with pam_pwquality ===&lt;br /&gt;
&lt;br /&gt;
PAM stands for the Pluggable Authentication Modules. &#039;&#039;pam_pwquality&#039;&#039; provides protection against [[Wikipedia:Dictionary attack|Dictionary attacks]] and helps configure a password policy that can be enforced throughout the system. It is based on &#039;&#039;pam_cracklib&#039;&#039;, so it is backwards compatible with its options.&lt;br /&gt;
&lt;br /&gt;
[[Install]] the {{Pkg|libpwquality}} package.&lt;br /&gt;
&lt;br /&gt;
{{Warning|The &#039;&#039;root&#039;&#039; account is not affected by this policy by default.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* You can use the &#039;&#039;root&#039;&#039; account to set a password for a user that bypasses the desired/configured policy. This is useful when setting temporary passwords.&lt;br /&gt;
* Current security guidelines around passwords, e.g. from NIST, but also from others, do not recommend enforcing special characters, since they often only lead to predictable alterations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
If for example you want to enforce this policy:&lt;br /&gt;
&lt;br /&gt;
* prompt 2 times for password in case of an error (retry option)&lt;br /&gt;
* 10 characters minimum length (minlen option)&lt;br /&gt;
* at least 6 characters should be different from old password when entering a new one (difok option)&lt;br /&gt;
* at least 1 digit (dcredit option)&lt;br /&gt;
* at least 1 uppercase (ucredit option)&lt;br /&gt;
* at least 1 lowercase (lcredit option)&lt;br /&gt;
* at least 1 other character (ocredit option)&lt;br /&gt;
* cannot contain the words &amp;quot;myservice&amp;quot; and &amp;quot;mydomain&amp;quot;&lt;br /&gt;
* enforce the policy for root&lt;br /&gt;
&lt;br /&gt;
Edit the {{ic|/etc/pam.d/passwd}} file to read as:&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
#%PAM-1.0&lt;br /&gt;
password required pam_pwquality.so retry=2 minlen=10 difok=6 dcredit=-1 ucredit=-1 ocredit=-1 lcredit=-1 [badwords=myservice mydomain] enforce_for_root&lt;br /&gt;
password required pam_unix.so use_authtok yescrypt shadow&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The {{ic|password required pam_unix.so use_authtok}} instructs the &#039;&#039;pam_unix&#039;&#039; module to not prompt for a password but rather to use the one provided by &#039;&#039;pam_pwquality&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
You can refer to the {{man|8|pam_pwquality}} and {{man|8|pam_unix}} man pages for more information.&lt;br /&gt;
&lt;br /&gt;
== CPU ==&lt;br /&gt;
&lt;br /&gt;
=== Microcode ===&lt;br /&gt;
&lt;br /&gt;
See [[microcode]] for information on how to install important security updates for your CPU&#039;s microcode.&lt;br /&gt;
&lt;br /&gt;
=== Hardware vulnerabilities ===&lt;br /&gt;
&lt;br /&gt;
Some CPUs contain hardware vulnerabilities. See the [https://docs.kernel.org/admin-guide/hw-vuln/ kernel documentation on hardware vulnerabilities] for a list of these vulnerabilities, as well as mitigation selection guides to help customize the kernel to mitigate these vulnerabilities for specific usage scenarios.&lt;br /&gt;
&lt;br /&gt;
To check if you are affected by a known vulnerability, run the following:&lt;br /&gt;
&lt;br /&gt;
 $ grep -r . /sys/devices/system/cpu/vulnerabilities/&lt;br /&gt;
&lt;br /&gt;
In most cases, updating the kernel and microcode will mitigate vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
==== Simultaneous multithreading (hyper-threading) ====&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:Simultaneous multithreading|Simultaneous multithreading]] (SMT), also called hyper-threading on Intel CPUs, is a hardware feature that may be a source of [https://docs.kernel.org/admin-guide/hw-vuln/l1tf.html L1 Terminal Fault] and [https://docs.kernel.org/admin-guide/hw-vuln/mds.html Microarchitectural Data Sampling] vulnerabilities. The Linux kernel and microcode updates contain mitigations for known vulnerabilities, but [https://docs.kernel.org/admin-guide/hw-vuln/l1tf.html#virtualization-with-untrusted-guests disabling SMT may still be required on certain CPUs if untrusted virtualization guests are present].&lt;br /&gt;
&lt;br /&gt;
{{Note|Disabling SMT is something mostly hypervisors benefit from.[https://security.stackexchange.com/questions/219753/sacrificing-30-of-my-cpu-performance-by-disabling-hyper-threading-to-fully-mi/219759#219759] On an ordinary system it has very little to no security benefits.}}&lt;br /&gt;
&lt;br /&gt;
SMT can often be disabled in your system&#039;s firmware. Consult your motherboard or system documentation for more information. You can also disable SMT in the kernel by adding the following [[kernel parameter]]:&lt;br /&gt;
&lt;br /&gt;
 mitigations=auto,nosmt&lt;br /&gt;
&lt;br /&gt;
== Memory ==&lt;br /&gt;
&lt;br /&gt;
=== Hardened malloc ===&lt;br /&gt;
&lt;br /&gt;
{{AUR|hardened_malloc}} is a hardened replacement for [[Wikipedia:GNU C Library|glibc]]&#039;s malloc(). The project was originally developed for integration into Android&#039;s [[Wikipedia:Bionic (software)|Bionic]] and [[Wikipedia:musl|musl]] by Daniel Micay, of [[Wikipedia:GrapheneOS|GrapheneOS]], but he has also built in support for standard Linux distributions on the x86_64 architecture.&lt;br /&gt;
&lt;br /&gt;
== Storage ==&lt;br /&gt;
&lt;br /&gt;
=== Data-at-rest encryption ===&lt;br /&gt;
&lt;br /&gt;
[[Data-at-rest encryption]], preferably full-disk encryption with a [[#Passwords|strong passphrase]], is the only way to guard data against physical recovery. This provides data confidentiality when the computer is turned off or the disks in question are unmounted.&lt;br /&gt;
&lt;br /&gt;
Once the computer is powered on and the drive is mounted, however, its data becomes just as vulnerable as an unencrypted drive. It is therefore best practice to unmount data partitions as soon as they are no longer needed.&lt;br /&gt;
&lt;br /&gt;
You may also [[Trusted Platform Module#LUKS encryption|encrypt a drive with the key stored in a TPM]], although it has had [https://tpm.fail vulnerabilites in the past] and the key can be extracted by a [https://pulsesecurity.co.nz/articles/TPM-sniffing bus sniffing attack].&lt;br /&gt;
&lt;br /&gt;
Certain programs, like [[dm-crypt]], allow the user to encrypt a loop file as a virtual volume. This is a reasonable alternative to full-disk encryption when only certain parts of the system need to be secure.&lt;br /&gt;
&lt;br /&gt;
While the block-device or filesystem-based encryption types compared in the [[data-at-rest encryption]] article are useful at protecting data on physical media, most can not be used to protect data on a remote system that you can not control (such as [[Data-at-rest encryption#Cloud-storage optimized|cloud storage]]). In some cases, individual file encryption will be useful.&lt;br /&gt;
&lt;br /&gt;
These are some methods to encrypt files:&lt;br /&gt;
&lt;br /&gt;
* Some [[Archiving and compression|archiving and compressing]] tools also provide basic encryption. Some examples are [[7-Zip]] ({{ic|-p}} flag), {{Pkg|zip}} ({{ic|-e}} flag). The encryption should only be relied on particular care, because the tools may use custom algorithms for cross-platform compatibility.[https://math.ucr.edu/~mike/zipattacks.pdf]&lt;br /&gt;
* [[GnuPG]] can be used to [[GnuPG#Encrypt and decrypt|encrypt files]].&lt;br /&gt;
* {{Pkg|age}} is a simple and easy to use file encryption tool. It also supports multiple recipients and encryption using SSH keys, which is useful for secure file sharing.&lt;br /&gt;
&lt;br /&gt;
=== File systems ===&lt;br /&gt;
&lt;br /&gt;
The kernel now prevents security issues related to hardlinks and symlinks if the {{ic|fs.protected_hardlinks}} and {{ic|fs.protected_symlinks}} sysctl switches are enabled, so there is no longer a major security benefit from separating out world-writable directories.&lt;br /&gt;
&lt;br /&gt;
File systems containing world-writable directories can still be kept separate as a coarse way of limiting the damage from disk space exhaustion. However, filling {{ic|/var}} or {{ic|/tmp}} is enough to take down services. More flexible mechanisms for dealing with this concern exist (like [[Disk quota|quotas]]), and some [[file systems]] include related features themselves (Btrfs has quotas on subvolumes).&lt;br /&gt;
&lt;br /&gt;
==== Mount options ====&lt;br /&gt;
&lt;br /&gt;
Following the principle of least privilege, file systems should be mounted with the most restrictive mount options possible (without losing functionality).&lt;br /&gt;
&lt;br /&gt;
Relevant mount options are:&lt;br /&gt;
&lt;br /&gt;
* {{ic|nodev}}: Do not interpret character or block special devices on the file system.&lt;br /&gt;
* {{ic|nosuid}}: Do not allow set-user-identifier or set-group-identifier bits to take effect.&lt;br /&gt;
* {{ic|noexec}}: Do not allow direct execution of any binaries on the mounted file system.&lt;br /&gt;
** Setting {{ic|noexec}} on {{ic|/home}} disallows executable scripts and breaks [[Wine]], [[Steam]], PyCharm, [[.NET]], etc.&lt;br /&gt;
*** Wine does not need the {{ic|exec}} flag for opening Windows binaries. It is only needed when Wine itself is installed in {{ic|/home}}.&lt;br /&gt;
*** To keep [[Steam]] working you can mount {{ic|/home/user/.local/share/Steam}} as {{ic|exec}} in [[fstab]] by adding the following: {{bc|/home/user/.local/share/Steam  /home/user/.local/share/Steam  none defaults,bind,user,exec,nofail  0  0}}&lt;br /&gt;
** Some packages (building {{Pkg|nvidia-open-dkms}} for example) may require {{ic|exec}} on {{ic|/var}}.&lt;br /&gt;
&lt;br /&gt;
File systems used for data should always be mounted with {{ic|nodev}}, {{ic|nosuid}} and {{ic|noexec}}.&lt;br /&gt;
&lt;br /&gt;
Potential file system mounts to consider:&lt;br /&gt;
&lt;br /&gt;
* {{ic|/var}}&lt;br /&gt;
* {{ic|/home}}&lt;br /&gt;
* {{ic|/dev/shm}}&lt;br /&gt;
* {{ic|/tmp}}&lt;br /&gt;
* {{ic|/boot}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|When using [[systemd#GPT partition automounting|GPT partition automounting]], the ESP and XBOOTLDR partitions are [https://github.com/systemd/systemd-stable/commit/49804cfb71d3a79f433096e4cfb5616980171336 always hardened] with {{ic|noexec,nosuid,nodev}}.}}&lt;br /&gt;
&lt;br /&gt;
==== Snapshots ====&lt;br /&gt;
&lt;br /&gt;
When utilizing file system snapshots, e.g. with [[Btrfs]], [[LVM]], or [[ZFS]], it is essential to be aware that snapshots may retain sensitive information that users expect to be deleted. This is especially true when automatic snapshotting tools like [[Snapper]] are configured, as they can capture snapshots at regular intervals or in response to system events. Here are some examples of how sensitive information in {{ic|/home/}} can persist within snapshots:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Deleted files and directories&#039;&#039;: Even though files or directories are deleted from the file system, they may still exist within older snapshots. This is expected most of the time, but consider whether files and directories such as {{ic|.local/share/Trash/}}, {{ic|.history}}, etc. should be retained.&lt;br /&gt;
* &#039;&#039;Temporary files and cache&#039;&#039;: Temporary files and cached data generated by applications may be included in snapshots. For example, files kept in encrypted directories might generate thumbnails ({{ic|.cache/thumbnails}}) or work copies when opened, which might in turn be included in snapshots. The same applies e.g. to browsing history ({{ic|.mozilla/}}, {{ic|.config/chromium/}}, etc.), which could have been included in a snapshot before being purged.&lt;br /&gt;
&lt;br /&gt;
If this is supported, consider excluding such directories from snapshots altogether. For example, if using [[Btrfs]], you can create subvolumes for example {{ic|.cache/}}, {{ic|.config/}}, {{ic|.local/}}, {{ic|.var/}} or any other directory according to your use-case.&lt;br /&gt;
&lt;br /&gt;
{{Note|Moving {{ic|.local/share/Trash}} to a separate subvolume might break the trash feature in some cases, e.g. with [[GNOME/Files]].}}&lt;br /&gt;
&lt;br /&gt;
=== File access permissions ===&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|{{ic|chmod go-r}} does not &amp;quot;take away all permissions&amp;quot;, it only removes the read permission.}}&lt;br /&gt;
&lt;br /&gt;
The default [[file permissions]] allow read access to almost everything and changing the permissions can hide valuable information from an attacker who gains access to a non-root account such as the {{ic|http}} or {{ic|nobody}} users. You can use [[chmod]] to take away all permissions from the group and others:&lt;br /&gt;
&lt;br /&gt;
 # chmod go-r &#039;&#039;path_to_hide&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{Warning|Do not apply this broadly. Try this for one config at a time, ensuring that it is worth hiding, and that it will not break program functionality. You may need to remove the {{ic|g}} from the command (or re-add the permission with {{ic|chmod g+r &#039;&#039;path&#039;&#039;}} if already ran) if the group is relied on.}}&lt;br /&gt;
&lt;br /&gt;
Some paths to consider are:&lt;br /&gt;
&lt;br /&gt;
* {{ic|/boot}}: The [[Partitioning#/boot|boot directory]], which may include traditional [[vmlinuz]] and [[initramfs]] images, or a [[Unified kernel image]]. Note that safe permissions are used by default when using [[systemd#GPT partition automounting]].&lt;br /&gt;
* {{ic|/etc/nftables.conf}}: The [[nftables]] configuration, applicable to {{Pkg|nftables}} and {{Pkg|iptables}}.&lt;br /&gt;
* {{ic|/etc/iptables}}: The legacy [[iptables]] configuration, applicable to {{Pkg|iptables-legacy}}.&lt;br /&gt;
&lt;br /&gt;
The default [[umask]] {{ic|0022}} can be changed to improve security for newly created files. The [https://apps.nsa.gov/iaarchive/library/ia-guidance/security-configuration/operating-systems/guide-to-the-secure-configuration-of-red-hat-enterprise.cfm NSA RHEL5 Security Guide] suggests a umask of {{ic|0077}} for maximum security, which makes new files not readable by users other than the owner. To change this, see [[Umask#Set the mask value]]. If you use [[sudo]], consider configuring it to use the [[Sudo#Permissive umask|default root umask]].&lt;br /&gt;
&lt;br /&gt;
=== SUID and SGID files ===&lt;br /&gt;
&lt;br /&gt;
It is important to be aware of any files with the [[Wikipedia:Setuid|Setuid]] or Setgid bit. Examples of relevant files with the SUID bit set:&lt;br /&gt;
&lt;br /&gt;
* [[PAM|unix_chkpwd]]&lt;br /&gt;
* chage, expiry, gpasswd, groupmems, [[passwd]], sg ({{Pkg|shadow}})&lt;br /&gt;
* [[FUSE|fusermount3]], fusermount2&lt;br /&gt;
* [[polkit|pkexec]]&lt;br /&gt;
* [[OpenSSH|ssh-keysign]]&lt;br /&gt;
* chfn, chsh, mount, newgrp, umount, wall, write ({{Pkg|util-linux}})&lt;br /&gt;
* [[sudo]], {{Pkg|sudo-rs}}, [[doas]], [[su]], su-rs, [[Kerberos|ksu]]&lt;br /&gt;
* [[firejail]]&lt;br /&gt;
* [[Dbus|dbus-daemon-launch-helper]]&lt;br /&gt;
* [[Chromium|chromium-sandbox]]&lt;br /&gt;
* [[Xorg|Xorg.wrap]]&lt;br /&gt;
&lt;br /&gt;
The prominent risks of such executable files include privilege escalation vulnerabilities, see e.g [[Wikipedia:Setuid#Security impact]].[https://www.cvedetails.com/vulnerability-list/vendor_id-16224/product_id-36412/Calibre-ebook-Calibre.html][https://www.cvedetails.com/product/32625/Sudo-Project-Sudo.html?vendor_id=15714][https://www.cvedetails.com/vulnerability-list/vendor_id-16191/Firejail-Project.html]&lt;br /&gt;
&lt;br /&gt;
Files with the SUID bit set and not owned by root, or files with the SGID bit set &#039;&#039;typically&#039;&#039; have less potential impact but can theoretically still do decent damage if vulnerable. It is usually possible to avoid using SUID or SGID by assigning [[Capabilities]] instead.&lt;br /&gt;
&lt;br /&gt;
{{Tip|It is vital to be vigilant in keeping packages which provide SUID/SGID executables up to date in order to prevent having a vulnerable system.}}&lt;br /&gt;
&lt;br /&gt;
To search for files with either the SUID or SGID bit:&lt;br /&gt;
&lt;br /&gt;
 $ find / -perm &amp;quot;/u=s,g=s&amp;quot; -type f 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
=== Backups ===&lt;br /&gt;
&lt;br /&gt;
{{Merge|System backup|There is a dedicated page for system backups.}}&lt;br /&gt;
&lt;br /&gt;
Regularly create backups of important data. Regularly test the integrity of the backups. Regularly test that the backups can be restored.&lt;br /&gt;
&lt;br /&gt;
Make sure that at least one copy of the data is stored offline, i.e. not connected to the system under threat in any way. [[Wikipedia:Ransomware|Ransomware]] and other destructive attacks may also attack any connected backup systems.&lt;br /&gt;
&lt;br /&gt;
=== SATA SSD frozen mode ===&lt;br /&gt;
&lt;br /&gt;
See [[Solid state drive#Setting the SATA SSD state to frozen mode after waking up from sleep]].&lt;br /&gt;
&lt;br /&gt;
== User setup ==&lt;br /&gt;
&lt;br /&gt;
=== Do not use the root account for daily use ===&lt;br /&gt;
&lt;br /&gt;
Following the principle of least privilege, do not use the root user for daily use. Create a non-privileged user account for each person using the system. See [[List of applications/Security#Privilege elevation]] for ways of temporarily gaining privileged access.&lt;br /&gt;
&lt;br /&gt;
=== Enforce a delay after a failed login attempt ===&lt;br /&gt;
&lt;br /&gt;
Add the following line to {{ic|/etc/pam.d/system-login}} to add a delay of at least 4 seconds between failed login attempts:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/pam.d/system-login|2=&lt;br /&gt;
auth optional pam_faildelay.so delay=4000000&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|This line needs to be the first line in the file.}}&lt;br /&gt;
&lt;br /&gt;
{{ic|4000000}} is the time in microseconds to delay.&lt;br /&gt;
&lt;br /&gt;
Other PAM modules besides {{ic|pam_faildelay}} can also suggest such a delay; if multiple modules do so, PAM will use the longest one.&lt;br /&gt;
In particular, both {{ic|pam_unix}} and {{ic|pam_faillock}} set a minimum delay of 2 seconds by default.&lt;br /&gt;
In order to completely remove this delay, you need to add the {{ic|nodelay}} parameter to any {{ic|auth}} lines of these modules, e.g.&lt;br /&gt;
{{hc|/etc/pam.d/system-auth|2=&lt;br /&gt;
auth       [success{{=}}1 default{{=}}bad]     pam_unix.so          try_first_pass nullok nodelay&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Lock out user after three failed login attempts ===&lt;br /&gt;
&lt;br /&gt;
Since {{Pkg|pambase}} 20200721.1-2, {{ic|pam_faillock.so}} is enabled by default to lock out users for 10 minutes after 3 failed login attempts in a 15 minute period (see {{Bug|67644}}). The lockout only applies to password authentication (e.g. login and &#039;&#039;sudo&#039;&#039;), public key authentication over SSH is still accepted. To prevent complete denial-of-service, this lockout is disabled for the root user by default.&lt;br /&gt;
&lt;br /&gt;
To unlock a user, do:&lt;br /&gt;
&lt;br /&gt;
 $ faillock --user &#039;&#039;username&#039;&#039; --reset&lt;br /&gt;
&lt;br /&gt;
By default, the lock mechanism is a file per-user located at {{ic|/run/faillock/}}. Deleting or emptying the file unlocks that user—the directory is owned by root, but the file is owned by the user, so the {{ic|faillock}} command only empties the file, therefore does not require root.&lt;br /&gt;
&lt;br /&gt;
The module {{ic|pam_faillock.so}} can be configured with the file {{ic|1=/etc/security/faillock.conf}}. The lockout parameters:&lt;br /&gt;
&lt;br /&gt;
* {{ic|unlock_time}} — the lockout time (in seconds, default 10 minutes).&lt;br /&gt;
* {{ic|fail_interval}} — the time in which failed logins can cause a lockout (in seconds, default 15 minutes).&lt;br /&gt;
* {{ic|deny}} — the number of failed logins before lockout (default 3).&lt;br /&gt;
&lt;br /&gt;
{{Tip|The primary purpose for the lockout is to slow down brute-force attacks so that they become infeasible. Hence, if lockouts due to mistyping of passwords become too frequent, relaxing the number of attempts may be preferred to reducing the lockout time.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|{{ic|1=deny = 0}} will disable the lockout mechanism entirely.}}&lt;br /&gt;
&lt;br /&gt;
By default, all user locks are lost after reboot. If your attacker can reboot the machine, it is more secure if locks persist. To make locks persist, change the {{ic|dir}} parameter in {{ic|1=/etc/security/faillock.conf}} to {{ic|/var/lib/faillock}}.&lt;br /&gt;
&lt;br /&gt;
No restart is required for changes to take effect. See {{man|5|faillock.conf}} for further configuration options, such as enabling lockout for the root account, disabling for centralized login (e.g. LDAP), etc.&lt;br /&gt;
&lt;br /&gt;
{{Note|If you make locks persistant, following the changes introduced in polkit 127: you may have to relax the sandbox of its helper agent in order to keep it functional. The best way is to create a drop-in for its systemd unit via {{ic|systemctl edit polkit-agent-helper\@.service}} and add:&lt;br /&gt;
&lt;br /&gt;
 [Service]&lt;br /&gt;
 ReadWritePaths{{=}}/var/lib/faillock&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Limit amount of processes ===&lt;br /&gt;
&lt;br /&gt;
On systems with many, or untrusted users, it is important to limit the number of processes each can run at once, therefore preventing [[Wikipedia:Fork bomb|fork bombs]] and other denial of service attacks. The {{ic|/etc/security/limits.conf}} configuration determines how many processes each user, or group can have open, and is empty (except for useful comments) by default. Adding the following lines to this file will limit all users to 100 active processes, unless they use the {{ic|prlimit}} command to explicitly raise their maximum to 200 for that session. These values can be changed according to the appropriate number of processes a user should have running, or the hardware of the box you are administrating.&lt;br /&gt;
&lt;br /&gt;
 * soft nproc 100&lt;br /&gt;
 * hard nproc 200&lt;br /&gt;
&lt;br /&gt;
The current number of threads for each user can be found with {{ic|ps --no-headers -Leo user {{!}} sort {{!}} uniq --count}}. This may help with determining appropriate values for the users&#039; limits; see also [[limits.conf]].&lt;br /&gt;
&lt;br /&gt;
=== Use Wayland ===&lt;br /&gt;
&lt;br /&gt;
Prefer using [[Wayland]] over [[Xorg]]. Xorg&#039;s design predates modern security practices and is [https://security.stackexchange.com/questions/4641/why-are-people-saying-that-the-x-window-system-is-not-secure/4646#4646 considered insecure] by many. For example, Xorg applications may record keystrokes while inactive.&lt;br /&gt;
&lt;br /&gt;
If you must run Xorg, it is recommended to [[Xorg#Rootless Xorg|avoid running it as root]]. Within Wayland, the Xwayland compatibility layer will automatically use rootless Xorg.&lt;br /&gt;
&lt;br /&gt;
== Restricting root ==&lt;br /&gt;
&lt;br /&gt;
The root user is, by definition, the most powerful user on a system. It is also difficult to [[audit]] the root user account. It is therefore important to restrict usage of the root user account as much as possible. There are a number of ways to keep the power of the root user while limiting its ability to cause harm.&lt;br /&gt;
&lt;br /&gt;
=== Use sudo instead of su ===&lt;br /&gt;
&lt;br /&gt;
Using [[sudo]] for privileged access is preferable to [[su]] for a number of reasons:&lt;br /&gt;
&lt;br /&gt;
* It keeps a log of which normal privilege user has run each privileged command.&lt;br /&gt;
* The root user password need not be given out to each user who requires root access.&lt;br /&gt;
* {{ic|sudo}} prevents users from accidentally running commands as &#039;&#039;root&#039;&#039; that do not need root access, because a full root terminal is not created. This aligns with the [[Wikipedia:Principle of least privilege|principle of least privilege]].&lt;br /&gt;
* Individual programs may be enabled per user, instead of offering complete root access just to run one command. &lt;br /&gt;
&lt;br /&gt;
See [[Sudo#Configuration]].&lt;br /&gt;
&lt;br /&gt;
==== Editing files using sudo ====&lt;br /&gt;
&lt;br /&gt;
See [[Sudo#Editing files]]. Alternatively, you can use editors like {{ic|rvim}} or {{ic|rnano}} which have restricted capabilities in order to be safe to run as root.&lt;br /&gt;
&lt;br /&gt;
=== Restricting root login ===&lt;br /&gt;
&lt;br /&gt;
Once [[sudo]] is properly configured, full root access can be heavily restricted or denied without losing much usability. To disable root, but still allowing to use [[sudo]], you can use {{man|1|passwd}} with {{ic|passwd --lock root}}.&lt;br /&gt;
&lt;br /&gt;
==== Allow only certain users ====&lt;br /&gt;
&lt;br /&gt;
The [[PAM]] {{ic|pam_wheel.so}} lets you allow only users in the group {{ic|wheel}} to login using [[su]]. See [[su#su and wheel]].&lt;br /&gt;
&lt;br /&gt;
==== Denying SSH login ====&lt;br /&gt;
&lt;br /&gt;
Even if you do not wish to deny root login for local users, it is always good practice to [[OpenSSH#Deny|deny root login via SSH]]. The purpose of this is to add an additional layer of security before a user can completely compromise your system remotely.&lt;br /&gt;
&lt;br /&gt;
==== Specify acceptable login combinations with access.conf ====&lt;br /&gt;
&lt;br /&gt;
{{Warning|If you are using GNOME 49 or later, you should make sure the group &#039;&#039;gdm&#039;&#039; can log in locally. This can be done with a {{ic|+:(gdm):LOCAL}} rule. [https://gitlab.gnome.org/GNOME/gdm/-/issues/1021]}}&lt;br /&gt;
&lt;br /&gt;
When someone attempts to log in with [[PAM]], {{ic|/etc/security/access.conf}} is checked for the first combination that matches their login properties. Their attempt then fails or succeeds based on the rule for that combination.&lt;br /&gt;
&lt;br /&gt;
 +:root:LOCAL&lt;br /&gt;
 -:root:ALL&lt;br /&gt;
&lt;br /&gt;
Rules can be set for specific groups and users. In this example, the user archie is allowed to login locally, as are all users in the wheel and adm groups. All other logins are rejected:&lt;br /&gt;
&lt;br /&gt;
 +:archie:LOCAL&lt;br /&gt;
 +:(wheel):LOCAL&lt;br /&gt;
 +:(adm):LOCAL&lt;br /&gt;
 -:ALL:ALL&lt;br /&gt;
&lt;br /&gt;
Read more at {{man|5|access.conf}}&lt;br /&gt;
&lt;br /&gt;
== Mandatory access control ==&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:Mandatory Access Control|Mandatory access control]] (MAC) is a type of security policy that differs significantly from the [[Wikipedia:Discretionary Access Control|discretionary access control]] (DAC) used by default in Arch and most Linux distributions. MAC essentially means that every action a program could perform that affects the system in any way is checked against a security ruleset. This ruleset, in contrast to DAC methods, cannot be modified by users. Using virtually any mandatory access control system will significantly improve the security of your computer, although there are differences in how it can be implemented.&lt;br /&gt;
&lt;br /&gt;
=== Pathname MAC ===&lt;br /&gt;
&lt;br /&gt;
Pathname-based access control is a simple form of access control that offers permissions based on the path of a given file. The downside to this style of access control is that permissions are not carried with files if they are moved around the system. On the positive side, pathname-based MAC can be implemented on a much wider range of filesystems, unlike labels-based alternatives.&lt;br /&gt;
&lt;br /&gt;
* [[AppArmor]] is a [[Wikipedia:Canonical (company)|Canonical]]-maintained MAC implementation seen as an &amp;quot;easier&amp;quot; alternative to SELinux.&lt;br /&gt;
* [[TOMOYO]] is another simple, easy-to-use system offering mandatory access control. It is designed to be both simple in usage and in implementation, requiring very few dependencies.&lt;br /&gt;
&lt;br /&gt;
=== Labels MAC ===&lt;br /&gt;
&lt;br /&gt;
Labels-based access control means the extended attributes of a file are used to govern its security permissions. While this system is arguably more flexible in its security offerings than pathname-based MAC, it only works on filesystems that support these extended attributes.&lt;br /&gt;
&lt;br /&gt;
* [[SELinux]], based on an [[Wikipedia:NSA|NSA]] project to improve Linux security, implements MAC completely separate from system users and roles. It offers an extremely robust multi-level MAC policy implementation that can easily maintain control of a system that grows and changes past its original configuration.&lt;br /&gt;
&lt;br /&gt;
=== Access Control Lists ===&lt;br /&gt;
&lt;br /&gt;
[[Access Control Lists]] (ACLs) are an alternative to attaching rules directly to the filesystem in some way. ACLs implement access control by checking program actions against a list of permitted behavior.&lt;br /&gt;
&lt;br /&gt;
== Kernel hardening ==&lt;br /&gt;
&lt;br /&gt;
=== Kernel self-protection / exploit mitigation ===&lt;br /&gt;
&lt;br /&gt;
The {{pkg|linux-hardened}} package uses a [https://github.com/anthraxx/linux-hardened basic kernel hardening patch set] and more security-focused compile-time configuration options than the {{pkg|linux}} package. A custom build can be made to choose a different compromise between security and performance than the security-leaning defaults.&lt;br /&gt;
&lt;br /&gt;
However, it should be noted that several packages (such as {{pkg|throttled}}) will not work when using this kernel.&lt;br /&gt;
&lt;br /&gt;
If you use an out-of-tree driver such as [[NVIDIA]], you may need to switch to its [[DKMS]] package.&lt;br /&gt;
&lt;br /&gt;
==== Userspace ASLR comparison ====&lt;br /&gt;
&lt;br /&gt;
The {{pkg|linux-hardened}} package provides an improved implementation of Address Space Layout Randomization for userspace processes. The {{pkg|paxtest}} command can be used to obtain an estimate of the provided entropy:&lt;br /&gt;
&lt;br /&gt;
===== 64-bit processes =====&lt;br /&gt;
&lt;br /&gt;
{{hc|linux-hardened 5.4.21.a-1-hardened|&lt;br /&gt;
Anonymous mapping randomization test     : 32 quality bits (guessed)&lt;br /&gt;
Heap randomization test (ET_EXEC)        : 40 quality bits (guessed)&lt;br /&gt;
Heap randomization test (PIE)            : 40 quality bits (guessed)&lt;br /&gt;
Main executable randomization (ET_EXEC)  : 32 quality bits (guessed)&lt;br /&gt;
Main executable randomization (PIE)      : 32 quality bits (guessed)&lt;br /&gt;
Shared library randomization test        : 32 quality bits (guessed)&lt;br /&gt;
VDSO randomization test                  : 32 quality bits (guessed)&lt;br /&gt;
Stack randomization test (SEGMEXEC)      : 40 quality bits (guessed)&lt;br /&gt;
Stack randomization test (PAGEEXEC)      : 40 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (SEGMEXEC)    : 44 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (PAGEEXEC)    : 44 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_EXEC): 34 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_DYN) : 34 quality bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @~0: 32 bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @0 : 32 bits (guessed)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{hc|linux 5.5.5-arch1-1|&lt;br /&gt;
Anonymous mapping randomization test     : 28 quality bits (guessed)&lt;br /&gt;
Heap randomization test (ET_EXEC)        : 28 quality bits (guessed)&lt;br /&gt;
Heap randomization test (PIE)            : 28 quality bits (guessed)&lt;br /&gt;
Main executable randomization (ET_EXEC)  : 28 quality bits (guessed)&lt;br /&gt;
Main executable randomization (PIE)      : 28 quality bits (guessed)&lt;br /&gt;
Shared library randomization test        : 28 quality bits (guessed)&lt;br /&gt;
VDSO randomization test                  : 20 quality bits (guessed)&lt;br /&gt;
Stack randomization test (SEGMEXEC)      : 30 quality bits (guessed)&lt;br /&gt;
Stack randomization test (PAGEEXEC)      : 30 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (SEGMEXEC)    : 22 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (PAGEEXEC)    : 22 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_EXEC): 28 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_DYN) : 28 quality bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @~0: 29 bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @0 : 29 bits (guessed)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{hc|linux-lts 4.19.101-1-lts|&lt;br /&gt;
Anonymous mapping randomization test     : 28 quality bits (guessed)&lt;br /&gt;
Heap randomization test (ET_EXEC)        : 28 quality bits (guessed)&lt;br /&gt;
Heap randomization test (PIE)            : 28 quality bits (guessed)&lt;br /&gt;
Main executable randomization (ET_EXEC)  : 28 quality bits (guessed)&lt;br /&gt;
Main executable randomization (PIE)      : 28 quality bits (guessed)&lt;br /&gt;
Shared library randomization test        : 28 quality bits (guessed)&lt;br /&gt;
VDSO randomization test                  : 19 quality bits (guessed)&lt;br /&gt;
Stack randomization test (SEGMEXEC)      : 30 quality bits (guessed)&lt;br /&gt;
Stack randomization test (PAGEEXEC)      : 30 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (SEGMEXEC)    : 22 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (PAGEEXEC)    : 22 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_EXEC): 28 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_DYN) : 28 quality bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @~0: 28 bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @0 : 28 bits (guessed)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== 32-bit processes (on an x86_64 kernel) =====&lt;br /&gt;
&lt;br /&gt;
{{hc|linux-hardened|&lt;br /&gt;
Anonymous mapping randomization test     : 16 quality bits (guessed)&lt;br /&gt;
Heap randomization test (ET_EXEC)        : 22 quality bits (guessed)&lt;br /&gt;
Heap randomization test (PIE)            : 27 quality bits (guessed)&lt;br /&gt;
Main executable randomization (ET_EXEC)  : No randomization&lt;br /&gt;
Main executable randomization (PIE)      : 18 quality bits (guessed)&lt;br /&gt;
Shared library randomization test        : 16 quality bits (guessed)&lt;br /&gt;
VDSO randomization test                  : 16 quality bits (guessed)&lt;br /&gt;
Stack randomization test (SEGMEXEC)      : 24 quality bits (guessed)&lt;br /&gt;
Stack randomization test (PAGEEXEC)      : 24 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (SEGMEXEC)    : 28 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (PAGEEXEC)    : 28 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_EXEC): 18 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_DYN) : 16 quality bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @~0: 18 bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @0 : 18 bits (guessed)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{hc|linux|&lt;br /&gt;
Anonymous mapping randomization test     : 8 quality bits (guessed)&lt;br /&gt;
Heap randomization test (ET_EXEC)        : 13 quality bits (guessed)&lt;br /&gt;
Heap randomization test (PIE)            : 13 quality bits (guessed)&lt;br /&gt;
Main executable randomization (ET_EXEC)  : No randomization&lt;br /&gt;
Main executable randomization (PIE)      : 8 quality bits (guessed)&lt;br /&gt;
Shared library randomization test        : 8 quality bits (guessed)&lt;br /&gt;
VDSO randomization test                  : 8 quality bits (guessed)&lt;br /&gt;
Stack randomization test (SEGMEXEC)      : 19 quality bits (guessed)&lt;br /&gt;
Stack randomization test (PAGEEXEC)      : 19 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (SEGMEXEC)    : 11 quality bits (guessed)&lt;br /&gt;
Arg/env randomization test (PAGEEXEC)    : 11 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_EXEC): 8 quality bits (guessed)&lt;br /&gt;
Offset to library randomisation (ET_DYN) : 13 quality bits (guessed)&lt;br /&gt;
Randomization under memory exhaustion @~0: No randomization&lt;br /&gt;
Randomization under memory exhaustion @0 : No randomization&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Restricting access to kernel pointers in the proc filesystem ===&lt;br /&gt;
&lt;br /&gt;
Setting {{ic|kernel.kptr_restrict}} to 1 will hide kernel symbol addresses in {{ic|/proc/kallsyms}} from regular users without {{ic|CAP_SYSLOG}}, making it more difficult for kernel exploits to resolve addresses/symbols dynamically. This will not help that much on a pre-compiled Arch Linux kernel, since a determined attacker could just download the kernel package and get the symbols manually from there, but if you are compiling your own kernel, this can help mitigating local root exploits. This will break some {{Pkg|perf}} commands when used by non-root users (but many {{Pkg|perf}} features require root access anyway). See {{Bug|34323}} for more information.&lt;br /&gt;
&lt;br /&gt;
Setting {{ic|kernel.kptr_restrict}} to 2 will hide kernel symbol addresses in {{ic|/proc/kallsyms}} regardless of privileges.&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/sysctl.d/51-kptr-restrict.conf|2=&lt;br /&gt;
kernel.kptr_restrict = 1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|{{pkg|linux-hardened}} sets {{ic|1=kptr_restrict=2}} by default rather than {{ic|0}}.}}&lt;br /&gt;
&lt;br /&gt;
=== BPF hardening ===&lt;br /&gt;
&lt;br /&gt;
BPF is a system used to load and execute bytecode within the kernel dynamically during runtime. It is used in a number of Linux kernel subsystems such as networking (e.g. XDP, tc), tracing (e.g. kprobes, uprobes, tracepoints) and security (e.g. seccomp). It is also useful for advanced network security, performance profiling and dynamic tracing.&lt;br /&gt;
&lt;br /&gt;
BPF was originally an acronym of [[Wikipedia:Berkeley Packet Filter|Berkeley Packet Filter]] since the original classic BPF was used for packet capture tools for BSD. This eventually evolved into Extended BPF (eBPF), which was shortly afterwards renamed to just BPF (not an acronym). BPF should not be confused with packet filtering tools like iptables or netfilter, although BPF can be used to implement packet filtering tools.&lt;br /&gt;
&lt;br /&gt;
BPF code may be either interpreted or compiled using a [[Wikipedia:Just-in-time compilation|Just-In-Time (JIT) compiler]]. The Arch kernel is built with {{ic|CONFIG_BPF_JIT_ALWAYS_ON}} which disables the BPF interpreter and forces all BPF to use JIT compilation. This makes it harder for an attacker to use BPF to escalate attacks that exploit SPECTRE-style vulnerabilities. See [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=290af86629b25ffd1ed6232c4e9107da031705cb the kernel patch which introduced CONFIG_BPF_JIT_ALWAYS_ON] for more details.&lt;br /&gt;
&lt;br /&gt;
The kernel includes a hardening feature for JIT-compiled BPF which can mitigate some types of JIT spraying attacks at the cost of performance and the ability to trace and debug many BPF programs. It may be enabled by setting {{ic|net.core.bpf_jit_harden}} to {{ic|1}} (to enable hardening of unprivileged code) or {{ic|2}} (to enable hardening of all code).&lt;br /&gt;
&lt;br /&gt;
See the {{ic|net.core.bpf_*}} settings in the [https://docs.kernel.org/admin-guide/sysctl/net.html kernel documentation] for more details.&lt;br /&gt;
&lt;br /&gt;
{{Tip|&lt;br /&gt;
* {{Pkg|linux-hardened}} sets {{ic|1=net.core.bpf_jit_harden=2}} by default rather than {{ic|0}}.&lt;br /&gt;
* By default, BPF programs can be run even by unprivileged users. To change that behaviour set {{ic|1=kernel.unprivileged_bpf_disabled=1}}[https://access.redhat.com/security/cve/cve-2021-33624].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== ptrace scope ===&lt;br /&gt;
&lt;br /&gt;
The {{man|2|ptrace}} syscall provides a means by which one process (the &amp;quot;tracer&amp;quot;) may observe and control the execution of another process (the &amp;quot;tracee&amp;quot;), and examine and change the tracee&#039;s memory and registers. {{ic|ptrace}} is commonly used by debugging tools including &#039;&#039;gdb&#039;&#039;, &#039;&#039;strace&#039;&#039;, &#039;&#039;perf&#039;&#039;, &#039;&#039;reptyr&#039;&#039; and other debuggers. However, it also provides a means by which a malicious process can read data from and take control of other processes.&lt;br /&gt;
&lt;br /&gt;
Arch enables the [https://docs.kernel.org/admin-guide/LSM/Yama.html Yama LSM] by default, which provides a {{ic|kernel.yama.ptrace_scope}} [[kernel parameter]]. This parameter is set to {{ic|1}} (restricted) by default which prevents tracers from performing a {{ic|ptrace}} call on traces outside of a restricted scope unless the tracer is privileged or has the {{ic|CAP_SYS_PTRACE}} [[Capabilities|capability]]. This is a significant improvement in security compared to the classic permissions. Without this module, there is no separation between processes running as the same user (in the absence of additional security layers such as {{man|7|pid_namespaces}}).&lt;br /&gt;
&lt;br /&gt;
{{Note|By default, you can still use tools which require {{ic|ptrace}} by running them as privileged processes, e.g. using [[sudo]].}}&lt;br /&gt;
&lt;br /&gt;
If you do not need to use debugging tools, consider setting {{ic|kernel.yama.ptrace_scope}} to {{ic|2}} (admin-only) or {{ic|3}} (no {{ic|ptrace}} possible) to harden the system.&lt;br /&gt;
&lt;br /&gt;
{{Note|Some anti-cheat and DRM implementations rely on {{ic|ptrace}} to work, including Easy Anti-Cheat and Ubisoft Connect under Wine. Setting this parameter to {{ic|2}} or higher might prevent games using these solutions from launching.}}&lt;br /&gt;
&lt;br /&gt;
=== hidepid ===&lt;br /&gt;
&lt;br /&gt;
{{Expansion|1=[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0fb5ce62c5920b6e0a8a061f2fe80e0403281e10 Linux 5.8 implemented private instances] and new values for {{ic|1=hidepid=}}.}}&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|Enabling {{ic|hidepid}} globally is not a supported way of operation by [[systemd]], nor does it have any practical improvements security-wise when systemd is running as service manager. [https://github.com/systemd/systemd/issues/29893#issuecomment-1798030108]}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|&lt;br /&gt;
* This may cause issues for certain applications like an application running in a sandbox and [[Xorg]] (see workaround).&lt;br /&gt;
* This causes issues with [[D-Bus]], [[Polkit]], [[PulseAudio]] and [[bluetooth]] when using {{Pkg|systemd}} &amp;gt; 237.64-1.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The kernel has the ability to hide other users&#039; processes, normally accessible via {{ic|/proc}}, from unprivileged users by mounting the {{ic|proc}} filesystem with the {{ic|1=hidepid=}} and {{ic|1=gid=}} options documented in https://docs.kernel.org/filesystems/proc.html.&lt;br /&gt;
&lt;br /&gt;
This greatly complicates an intruder&#039;s task of gathering information about running processes, whether some daemon runs with elevated privileges, whether other user runs some sensitive program, whether other users run any program at all, makes it impossible to learn whether any user runs a specific program (given the program does not reveal itself by its behaviour), and, as an additional bonus, poorly written programs passing sensitive information via program arguments are now protected against local eavesdroppers.&lt;br /&gt;
&lt;br /&gt;
The {{ic|proc}} [[Users and groups#System groups|group]], provided by the {{Pkg|filesystem}} package, acts as a whitelist of users authorized to learn other users&#039; process information. If users or services need access to {{ic|/proc/&amp;lt;pid&amp;gt;}} directories beyond their own, [[Users and groups#Group management|add them to the group]].&lt;br /&gt;
&lt;br /&gt;
For example, to hide process information from other users except those in the {{ic|proc}} group:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/fstab|2=&lt;br /&gt;
proc	/proc	proc	nosuid,nodev,noexec,hidepid=2,gid=proc	0	0&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
For user sessions to work correctly, an exception needs to be added for &#039;&#039;systemd-logind&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/systemd/system/systemd-logind.service.d/hidepid.conf|2=&lt;br /&gt;
[Service]&lt;br /&gt;
SupplementaryGroups=proc&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Restricting module loading ===&lt;br /&gt;
&lt;br /&gt;
The default Arch kernel has {{ic|CONFIG_MODULE_SIG_ALL}} enabled, which signs all kernel modules built as part of the {{Pkg|linux}} package. This allows the kernel to only load modules signed with a valid key, i.e. out-of-tree modules compiled locally or provided by packages such as {{Pkg|virtualbox-host-modules-arch}} cannot be loaded. You can use {{ic|1=modinfo}} to verify currently loaded modules have signatures; verifying the signatures by hand is slightly more involved [https://unix.stackexchange.com/a/496800].&lt;br /&gt;
&lt;br /&gt;
Kernel module loading can be restricted by setting the {{ic|1=module.sig_enforce=1}} [[kernel parameter]]. More information can be found in the [https://docs.kernel.org/admin-guide/module-signing.html kernel documentation].&lt;br /&gt;
&lt;br /&gt;
Further, unneeded individual modules can be [[blacklist]]ed, see [https://github.com/secureblue/secureblue/blob/live/files/system/usr/lib/modprobe.d/secureblue.conf secureblue] for examples.&lt;br /&gt;
&lt;br /&gt;
=== Disable kexec ===&lt;br /&gt;
&lt;br /&gt;
Kexec allows replacing the current running kernel.&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/sysctl.d/51-kexec-restrict.conf|2=&lt;br /&gt;
kernel.kexec_load_disabled = 1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|kexec is disabled by default in {{pkg|linux-hardened}}.}}&lt;br /&gt;
&lt;br /&gt;
=== Kernel lockdown mode ===&lt;br /&gt;
&lt;br /&gt;
Linux supports an optional [https://mjg59.dreamwidth.org/55105.html lockdown feature], intended to strengthen the boundary between UID 0 (root) and the kernel. When enabled some applications may cease to work which rely on low-level access to either hardware or the kernel.&lt;br /&gt;
&lt;br /&gt;
To use lockdown, its LSM must be initialized and a lockdown mode must be set.&lt;br /&gt;
&lt;br /&gt;
All [[Kernel#Officially supported kernels|officially supported kernels]] initialize the LSM, but none of them enforce any lockdown mode.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Initialized LSMs can be verified by running {{ic|cat /sys/kernel/security/lsm}}.}}&lt;br /&gt;
&lt;br /&gt;
Lockdown has two modes of operation:&lt;br /&gt;
&lt;br /&gt;
* {{ic|integrity}}: kernel features that allow userland to modify the running kernel are disabled (e.g. kexec, bpf).&lt;br /&gt;
* {{ic|confidentiality}}: kernel features that allow userland to extract confidential information from the kernel are also disabled.&lt;br /&gt;
&lt;br /&gt;
It is recommended to use {{ic|integrity}}, unless your specific threat model dictates otherwise.&lt;br /&gt;
&lt;br /&gt;
To enable kernel lockdown at runtime, run:&lt;br /&gt;
&lt;br /&gt;
 # echo &#039;&#039;mode&#039;&#039; &amp;gt; /sys/kernel/security/lockdown&lt;br /&gt;
&lt;br /&gt;
To enable kernel lockdown on boot, use the [[kernel parameter]] {{ic|1=lockdown=&#039;&#039;mode&#039;&#039;}}.&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* Kernel lockdown cannot be disabled at runtime.&lt;br /&gt;
* Kernel lockdown disables [[hibernation]].&lt;br /&gt;
* Versions &amp;lt;6.17 of the {{man|7|kernel_lockdown}} man page incorrectly state that &amp;quot;lockdown will be automatically enabled if the system boots in EFI Secure Boot mode&amp;quot;. This is not the behaviour of the upstream kernel, nor Arch&#039;s packaged [[kernel]]s.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
See also {{man|7|kernel_lockdown}}.&lt;br /&gt;
&lt;br /&gt;
=== Linux Kernel Runtime Guard (LKRG) ===&lt;br /&gt;
&lt;br /&gt;
[https://www.openwall.com/lkrg/ LKRG] ({{AUR|lkrg-dkms}}) is a kernel module which performs integrity checking of the kernel and detection of exploit attempts.&lt;br /&gt;
&lt;br /&gt;
=== Disable emergency shell ===&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|Masking {{ic|emergency.target}} and {{ic|emergency.service}} will have no effect on those units being added to the initramfs and run in early userspace. Even with them in the initramfs, mkinitcpio&#039;s systemd hook locks the root account[https://gitlab.archlinux.org/archlinux/packaging/packages/systemd/-/commit/292cdf8a2f7dd7c6c7d91d2b59617391935c837c][https://gitlab.archlinux.org/archlinux/packaging/packages/systemd/-/commit/8835b2f5dfbe8663f1a2fd08edbd35f90bf08691] for &amp;quot;security reasons&amp;quot; (see {{Bug|70408}}). The solution for the issue in the linked article, if even needed, would be to prevent {{ic|rescue.target}}, {{ic|rescue.service}}, {{ic|emergency.target}} and {{ic|emergency.service}} from being added to the initramfs image.}}&lt;br /&gt;
&lt;br /&gt;
The emergency shell is used to interactively troubleshoot the machine during the boot process. However, it is also a gadget that an attacker can use to access secure resources such as the TPM. See [https://pulsesecurity.co.nz/advisories/tpm-luks-bypass this article] for a practical example. The difficulty of attacks can be increased by disabling the emergency shell, at the tradeoff of removing a tool to troubleshoot early boot failures.&lt;br /&gt;
&lt;br /&gt;
To disable the emergency shell, See [[systemd#Disable emergency mode on remote machine]].&lt;br /&gt;
&lt;br /&gt;
== Sandboxing applications ==&lt;br /&gt;
&lt;br /&gt;
See also [[Wikipedia:Sandbox (computer security)]].&lt;br /&gt;
&lt;br /&gt;
To improve the security of systemd service units, see [[systemd/Sandboxing]].&lt;br /&gt;
&lt;br /&gt;
{{Warning|Unprivileged user namespace usage is enabled by default in all [[Kernel#Officially supported kernels|officially supported kernels]] except for {{Pkg|linux-hardened}}. Unprivileged user namespaces greatly increase the attack surface for local privilege escalation; see [https://gitlab.com/apparmor/apparmor/-/wikis/unprivileged_userns_restriction AppArmor&#039;s Wiki] and {{Bug|36969}}.}}&lt;br /&gt;
&lt;br /&gt;
To mitigate this, either:&lt;br /&gt;
	&lt;br /&gt;
* use the {{Pkg|linux-hardened}} kernel which has the safe default, or&lt;br /&gt;
* set the {{ic|kernel.unprivileged_userns_clone}} [[sysctl]] to {{ic|0}}.&lt;br /&gt;
	&lt;br /&gt;
Note that this can break applications such as {{pkg|nsjail}}. [[Chromium]] based applications need SUID bit for {{ic|chrome-sandbox}} to work with this setting.&lt;br /&gt;
&lt;br /&gt;
=== Firejail ===&lt;br /&gt;
&lt;br /&gt;
[[Firejail]] is an easy to use tool for sandboxing applications and servers alike. It was originally created for browsers and internet facing applications, but supports a large number of applications by now. To establish a sandboxed environment with a variety of features, it is installed as a suid binary and builds a sandboxed runtime environment for the target application based on black and white lists.&lt;br /&gt;
&lt;br /&gt;
=== bubblewrap ===&lt;br /&gt;
&lt;br /&gt;
[[bubblewrap]] is a sandbox application developed for unprivileged container tools like [[Flatpak]] with a significantly smaller resource footprint and complexity than Firejail. While it lacks certain features such as file path whitelisting, bubblewrap does offer bind mounts as well as the creation of user/IPC/PID/network/cgroup namespaces and can support both simple and complex sandboxes. For the {{Pkg|linux-hardened}} kernel you will need to to use {{Pkg|bubblewrap-suid}}.&lt;br /&gt;
&lt;br /&gt;
[[Bubblejail]] sandbox is based on [[bubblewrap]] and provides a resource oriented permission model with a graphical interface to tweak permissions.&lt;br /&gt;
&lt;br /&gt;
=== Portable ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/Kraftland/portable Portable] is a sandboxing framework which utilizes [[bubblewrap]] and many other tools to lockdown running applications. It is designed to be simple for packagers and efficient for users, yet cuts off security holes and monitors background processes by default.&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/Kraftland/portable-arch portable-arch] for a repository of applications sandboxed by portable.&lt;br /&gt;
&lt;br /&gt;
If a sandboxed application does not utilize the Portal file chooser, portable can pass files to the sandbox (by passing {{ic|--actions share-files}}).&lt;br /&gt;
&lt;br /&gt;
Portable is fully functional on GNOME, while other desktops may lack small amounts of features like advanced background monitoring and ScreenShot portal.&lt;br /&gt;
&lt;br /&gt;
=== chroots ===&lt;br /&gt;
&lt;br /&gt;
Manual [[chroot]] jails can also be constructed to build sandboxed process environments. It is much more limited than other sandboxing technologies; the extent of its sandboxing is file path isolation.&lt;br /&gt;
&lt;br /&gt;
=== Linux containers ===&lt;br /&gt;
&lt;br /&gt;
[[Linux Containers]] are another good option when you need more separation than the other options (short of [[#Full virtualization options|full system virtualization]]) provide. LXC is run on top of the existing kernel in a pseudo-chroot with their own virtual hardware.&lt;br /&gt;
&lt;br /&gt;
=== gVisor ===&lt;br /&gt;
&lt;br /&gt;
The [https://gvisor.dev/ gVisor] project, led by Google, is providing a sandboxing application with a focus on containers following the [https://opencontainers.org/ OCI initiative], such as [[Docker]] and [[Kubernetes]]. It isolates containers and individual applications from the host by intercepting a majority of system calls to the kernel and presenting itself as guest kernel.&lt;br /&gt;
&lt;br /&gt;
A key difference to other intercepting sandboxing projects is that gVisor re-implements system calls in the Go programming language, as described in its [https://gvisor.dev/docs/architecture_guide/intro/ design overview]. Details for the list of [https://gvisor.dev/docs/user_guide/compatibility/linux/amd64/ re-implemented syscalls support] can be seen in [https://github.com/google/gvisor/blob/master/pkg/sentry/syscalls/linux/linux64.go git]. For usage examples, limitations and special features see the project [https://gvisor.dev/docs/ documentation].&lt;br /&gt;
&lt;br /&gt;
The application is available as {{Aur|gvisor-git}} and {{Aur|gvisor-bin}}.&lt;br /&gt;
&lt;br /&gt;
=== Full virtualization options ===&lt;br /&gt;
&lt;br /&gt;
Using full virtualization options such as [[VirtualBox]], [[KVM]], [[Xen]] or [https://www.qubes-os.org/ Qubes OS] (based on Xen) can also improve isolation and security in the event you plan on running risky applications or browsing dangerous websites.&lt;br /&gt;
&lt;br /&gt;
== Network and firewalls ==&lt;br /&gt;
&lt;br /&gt;
=== Firewalls ===&lt;br /&gt;
&lt;br /&gt;
While the stock Arch kernel is capable of using [[Wikipedia:Netfilter|Netfilter]]&#039;s [[iptables]] and [[nftables]], the services are not [[enable]]d by default. It is highly recommended to set up some form of firewall to protect the services running on the system. Many resources (including ArchWiki) do not state explicitly which services are worth protecting, so enabling a firewall is a good precaution.&lt;br /&gt;
&lt;br /&gt;
* See [[iptables]] and [[nftables]] for general information.&lt;br /&gt;
* See [[Simple stateful firewall]] for a guide on setting up an iptables firewall.&lt;br /&gt;
* See [[:Category:Firewalls]] for other ways of setting up netfilter.&lt;br /&gt;
* See [[Ipset]] for blocking lists of ip addresses, such as those from Bluetack.&lt;br /&gt;
* {{Pkg|opensnitch}} is a configurable inbound and outbound firewall with support for configurable rules by application, port, host, etc.&lt;br /&gt;
&lt;br /&gt;
A quick way to setup a basic firewall is to use the tool {{ic|ufw}} (Uncomplicated Fire Wall). Then set {{ic|ufw default deny incoming}} and {{ic|ufw default allow outgoing}} and enabling it with {{ic|ufw enable}} and {{ic|systemctl enable ufw}}.&lt;br /&gt;
&lt;br /&gt;
==== Open ports ====&lt;br /&gt;
&lt;br /&gt;
{{Style|&amp;quot;Open ports&amp;quot; is not a good title since it disregards interfaces and addresses that the application may be bound to. From the firewalls&#039; point of view, ports may be &amp;quot;open&amp;quot; even if no application listens on them at the moment.}}&lt;br /&gt;
&lt;br /&gt;
Some services listen for inbound traffic on open network ports. It is important to only bind these services to the addresses and interfaces that are strictly necessary. It may be possible for a remote attacker to [https://samy.pl/slipstream/ exploit flawed network protocols to access exposed services]. This can even happen with [https://nvd.nist.gov/vuln/detail/CVE-2019-13450 processes bound to localhost].&lt;br /&gt;
&lt;br /&gt;
In general, if a service only needs to be accessible to the local system, bind to a Unix domain socket ({{man|7|unix}}) or a loopback address such as {{ic|localhost}} instead of a non-loopback address like {{ic|0.0.0.0/0}}.&lt;br /&gt;
&lt;br /&gt;
If a service needs to be accessible to other systems via the network, control the access with strict [[firewall]] rules and configure authentication, authorization and encryption whenever possible.&lt;br /&gt;
&lt;br /&gt;
You can list all current open ports with {{ic|ss -l}}. To show all &#039;&#039;&#039;l&#039;&#039;&#039;istening &#039;&#039;&#039;p&#039;&#039;&#039;rocesses and their &#039;&#039;&#039;n&#039;&#039;&#039;umeric &#039;&#039;&#039;t&#039;&#039;&#039;cp and &#039;&#039;&#039;u&#039;&#039;&#039;dp port numbers:&lt;br /&gt;
&lt;br /&gt;
 # ss -lpntu&lt;br /&gt;
&lt;br /&gt;
See {{man|8|ss}} for more options.&lt;br /&gt;
&lt;br /&gt;
=== Kernel parameters ===&lt;br /&gt;
&lt;br /&gt;
Kernel parameters which affect networking can be set using [[Sysctl]]. For how to do this, see [[Sysctl#TCP/IP stack hardening]].&lt;br /&gt;
&lt;br /&gt;
=== SSH ===&lt;br /&gt;
&lt;br /&gt;
To mitigate [[Wikipedia:Brute-force attack|brute-force attacks]] it is recommended to enforce key-based authentication. For OpenSSH see [[OpenSSH#Protection]] for more recommendations. Alternatively [[Fail2ban]] or [[Sshguard]] offer lesser forms of protection by monitoring logs and writing [[firewall]] rules but open up the potential for a denial of service, since an attacker can [[Wikipedia:Spoofing attack#Spoofing and TCP/IP|spoof]] packets as if they came from the administrator after identifying their address. Spoofing IP has lines of defense, such as by [[sysctl#Reverse path filtering|reverse path filtering]] and [[sysctl#Disable ICMP redirects|disabling ICMP redirects]].&lt;br /&gt;
&lt;br /&gt;
You may want to harden authentication even more by using two-factor authentication. [[Google Authenticator]] provides a two-step authentication procedure using one-time passcodes (OTP).&lt;br /&gt;
&lt;br /&gt;
Denying root login is also a good practice, both for tracing intrusions and adding an additional layer of security before root access. For OpenSSH, see [[OpenSSH#Deny]].&lt;br /&gt;
&lt;br /&gt;
Mozilla publishes an [https://infosec.mozilla.org/guidelines/openssh.html OpenSSH configuration guide] which configures more verbose audit logging and restricts ciphers.&lt;br /&gt;
&lt;br /&gt;
=== DNS ===&lt;br /&gt;
&lt;br /&gt;
The default domain name resolution (DNS) configuration is highly compatible but has security weaknesses. See [[Domain name resolution#Privacy and security|DNS privacy and security]] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Proxies ===&lt;br /&gt;
&lt;br /&gt;
Proxies are commonly used as an extra layer between applications and the network, sanitizing data from untrusted sources. The attack surface of a small proxy running with lower privileges is significantly smaller than a complex application running with the end user privileges.&lt;br /&gt;
&lt;br /&gt;
For example the DNS resolver is implemented in {{Pkg|glibc}}, that is linked with the application (that may be running as root), so a bug in the DNS resolver might lead to a remote code execution. This can be prevented by installing a DNS caching server, such as [[dnsmasq]], which acts as a proxy. [https://googleonlinesecurity.blogspot.it/2016/02/cve-2015-7547-glibc-getaddrinfo-stack.html]&lt;br /&gt;
&lt;br /&gt;
=== Managing TLS certificates ===&lt;br /&gt;
&lt;br /&gt;
See [[TLS#Trust management]].&lt;br /&gt;
&lt;br /&gt;
== Physical security ==&lt;br /&gt;
&lt;br /&gt;
Physical access to a computer is root access given enough time and resources. However, a high &#039;&#039;practical&#039;&#039; level of security can be obtained by putting up enough barriers.&lt;br /&gt;
&lt;br /&gt;
An attacker can gain full control of your computer on the next boot by simply attaching a malicious IEEE 1394 (FireWire), Thunderbolt or PCI Express device as they are given full memory access by default.[https://web.archive.org/web/20210312083421/http://breaknenter.org/2014/09/inception-metasploit-integration/] For Thunderbolt, you can restrict the direct memory access completely or to known devices, see [[Thunderbolt#User device authorization|user device authorization]]. For Firewire and PCI Express, there is little you can do from preventing this, or modification of the hardware itself - such as flashing malicious firmware onto a drive. However, the vast majority of attackers will not be this knowledgeable and determined.&lt;br /&gt;
&lt;br /&gt;
[[#Data-at-rest encryption|Data-at-rest encryption]] will prevent access to your data if the computer is stolen, but malicious firmware can be installed to obtain this data upon your next log in by a resourceful attacker.&lt;br /&gt;
&lt;br /&gt;
=== Locking down BIOS ===&lt;br /&gt;
&lt;br /&gt;
Adding a password to the BIOS prevents someone from booting into removable media, which is basically the same as having root access to your computer. You should make sure your drive is first in the boot order and disable the other drives from being bootable if you can.&lt;br /&gt;
&lt;br /&gt;
=== Boot loaders ===&lt;br /&gt;
&lt;br /&gt;
It is highly important to protect your [[boot loader]]. An unprotected boot loader can bypass any login restrictions, e.g. by setting the {{ic|1=init=/bin/sh}} [[kernel parameter]] to boot directly to a shell.&lt;br /&gt;
&lt;br /&gt;
==== Syslinux ====&lt;br /&gt;
&lt;br /&gt;
[[Syslinux]] supports [[Syslinux#Security|password-protecting your boot loader]]. It allows you to set either a per-menu-item password or a global boot loader password.&lt;br /&gt;
&lt;br /&gt;
==== GRUB ====&lt;br /&gt;
&lt;br /&gt;
[[GRUB]] supports boot loader passwords as well. See [[GRUB/Tips and tricks#Password protection of GRUB menu]] for details. It also has support for [[GRUB#Encrypted /boot|encrypted /boot]], which only leaves some parts of the boot loader code unencrypted. GRUB&#039;s configuration, [[kernel]] and [[initramfs]] are encrypted.&lt;br /&gt;
&lt;br /&gt;
==== systemd-boot ====&lt;br /&gt;
&lt;br /&gt;
[[systemd-boot]] disables editing of kernel parameters when [[#Secure Boot|Secure Boot]] is enabled. Alternatively, you can set [[systemd-boot#Kernel parameters editor with password protection|kernel parameters for password protection]] in systemd-boot for a more traditional password-based option.&lt;br /&gt;
&lt;br /&gt;
=== Secure Boot ===&lt;br /&gt;
&lt;br /&gt;
[[Secure Boot]] is a feature of [[UEFI]] that allows authentication of the files your computer boots. This helps preventing some [[Wikipedia:Evil maid attack|evil maid attacks]] such as replacing files inside the boot partition. Normally computers come with keys that are enrolled by vendors (OEM). However these can be removed and allow the computer to enter &#039;&#039;Setup Mode&#039;&#039; which allows the user to enroll and manage their own keys.&lt;br /&gt;
&lt;br /&gt;
The secure boot page guides you through how to set secure boot up by [[Unified Extensible Firmware Interface/Secure Boot#Using your own keys|using your own keys]].&lt;br /&gt;
&lt;br /&gt;
=== Trusted Platform Module (TPM) ===&lt;br /&gt;
&lt;br /&gt;
[[Trusted Platform Module|TPMs]] are hardware microprocessors which have cryptographic keys embedded. This forms the fundamental root of trust of most modern computers and allows end-to-end verification of the boot chain. They can be used as internal smartcards, attest the firmware running on the computer and allow users to insert secrets into a tamper-proof and brute-force resistant store.&lt;br /&gt;
&lt;br /&gt;
=== Boot partition on removable flash drive ===&lt;br /&gt;
&lt;br /&gt;
One popular idea is to place the boot partition on a flash drive in order to render the system unbootable without it. Proponents of this idea often use [[#Data-at-rest encryption|full-disk encryption]] alongside, and some also use [[Dm-crypt/Specialties#Encrypted system using a detached LUKS header|detached encryption headers]] placed on the boot partition.&lt;br /&gt;
&lt;br /&gt;
This method can also be merged with [[Dm-crypt/Specialties#Encrypted /boot and a detached LUKS header on USB|encrypting /boot]].&lt;br /&gt;
&lt;br /&gt;
=== Automatic logout ===&lt;br /&gt;
&lt;br /&gt;
If you are using [[Bash]] or [[Zsh]], you can set {{ic|TMOUT}} for an automatic logout from shells after a timeout.&lt;br /&gt;
&lt;br /&gt;
For example, the following will automatically log out from virtual consoles (but not terminal emulators in X11):&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/profile.d/shell-timeout.sh|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
TMOUT=&amp;quot;$(( 60*10 ))&amp;quot;;&lt;br /&gt;
[ -z &amp;quot;$DISPLAY&amp;quot; ] &amp;amp;&amp;amp; export TMOUT;&lt;br /&gt;
case $( /usr/bin/tty ) in&lt;br /&gt;
	/dev/tty[0-9]*) export TMOUT;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
If you really want EVERY Bash/Zsh prompt (even within X) to timeout, use:&lt;br /&gt;
&lt;br /&gt;
 $ export TMOUT=&amp;quot;$(( 60*10 ))&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
Note that this will not work if there is some command running in the shell (eg.: an SSH session or other shell without {{ic|TMOUT}} support). But if you are using VC mostly for restarting frozen GDM/Xorg as root, then this is very useful.&lt;br /&gt;
&lt;br /&gt;
=== Protect against rogue USB devices ===&lt;br /&gt;
&lt;br /&gt;
The kernel has [https://docs.kernel.org/usb/authorization.html settings to deactivate] USB ports to protect your computer against rogue USB devices (a.k.a. [[Wikipedia:BadUSB|BadUSB]], [https://github.com/samyk/poisontap PoisonTap] or [https://lanturtle.com/ LanTurtle]). They can be set at runtime and automated via [[sysctl]].&lt;br /&gt;
&lt;br /&gt;
For more control install [[USBGuard]], which is a software framework implementing basic whitelisting and blacklisting capabilities based on device attributes.&lt;br /&gt;
&lt;br /&gt;
=== Volatile data collection ===&lt;br /&gt;
&lt;br /&gt;
A computer that is powered on may be vulnerable to [https://web.archive.org/web/20210420075636/https://fedvte.usalearning.gov/courses/CSI/course/videos/pdf/CSI_D01_S05_T01_STEP.pdf volatile data collection]. It is a best practice to turn a computer completely off at times it is not necessary for it to be on, or if the computer&#039;s physical security is temporarily compromised (e.g. when passing through a security checkpoint).&lt;br /&gt;
&lt;br /&gt;
== Packages ==&lt;br /&gt;
&lt;br /&gt;
=== Authentication ===&lt;br /&gt;
&lt;br /&gt;
[https://www2.cs.arizona.edu/stork/packagemanagersecurity/attacks-on-package-managers.html#overview Attacks on package managers] are possible without proper use of package signing, and can affect even package managers with [https://www2.cs.arizona.edu/stork/packagemanagersecurity/faq.html proper signature systems]. Arch uses package signing by default and relies on a web of trust from 5 trusted master keys. See [[Pacman-key]] for details.&lt;br /&gt;
&lt;br /&gt;
=== Upgrades ===&lt;br /&gt;
&lt;br /&gt;
It is important to regularly [[System maintenance#Upgrading the system|upgrade the system]].&lt;br /&gt;
&lt;br /&gt;
=== Follow vulnerability alerts ===&lt;br /&gt;
&lt;br /&gt;
Subscribe to the Common Vulnerabilities and Exposure (CVE) Security Alert updates, made available by National Vulnerability Database, and found on the [https://nvd.nist.gov/download.cfm NVD Download webpage]. &lt;br /&gt;
&lt;br /&gt;
The tool {{Pkg|arch-audit}} can be used to check for vulnerabilities affecting the running system. A graphical system tray, {{Pkg|arch-audit-gtk}}, can also be used. See also [[Arch Security Team]].&lt;br /&gt;
&lt;br /&gt;
You should also consider subscribing to the release notifications for software you use, especially if you install software through means other than the main repositories or AUR. Some software have mailing lists you can subscribe to for security notifications. Source code hosting sites often offer RSS feeds for new releases.&lt;br /&gt;
&lt;br /&gt;
=== Rebuilding packages ===&lt;br /&gt;
&lt;br /&gt;
Packages can be rebuilt and stripped of undesired functions and features as a means to reduce attack surface. For example, {{Pkg|bzip2}} can be rebuilt without {{ic|bzip2recover}} in an attempt to circumvent [https://security.archlinux.org/CVE-2016-3189 CVE-2016-3189]. Custom hardening flags can also be applied either manually or via a wrapper.&lt;br /&gt;
&lt;br /&gt;
{{Merge|Arch package guidelines/Security|Security related build flags have their own article.}}&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|Copy-pasted from a 3 years old blog post. The compiler flags are specific to [[GCC]], some are hardly security related.}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Flag !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| -D_FORTIFY_SOURCE=2 || Run-time buffer overflow detection&lt;br /&gt;
|-&lt;br /&gt;
| -D_GLIBCXX_ASSERTIONS || Run-time bounds checking for C++ strings and containers&lt;br /&gt;
|-&lt;br /&gt;
| -fasynchronous-unwind-tables || Increased reliability of backtraces&lt;br /&gt;
|-&lt;br /&gt;
| -fexceptions || Enable table-based thread cancellation&lt;br /&gt;
|-&lt;br /&gt;
| -fpie -Wl,-pie || Full ASLR for executables&lt;br /&gt;
|-&lt;br /&gt;
| -fpic -shared || No text relocations for shared libraries&lt;br /&gt;
|-&lt;br /&gt;
| -fplugin=annobin || Generate data for hardening quality control&lt;br /&gt;
|-&lt;br /&gt;
| -fstack-clash-protection || Increased reliability of stack overflow detection&lt;br /&gt;
|-&lt;br /&gt;
| -fstack-protector, -fstack-protector-all or -fstack-protector-strong || Stack smashing protector&lt;br /&gt;
|-&lt;br /&gt;
| -grecord-gcc-switches || Store compiler flags in debugging information&lt;br /&gt;
|-&lt;br /&gt;
| -mcet -fcf-protection || Control flow integrity protection&lt;br /&gt;
|-&lt;br /&gt;
| -Werror=format-security || Reject potentially unsafe format string arguments&lt;br /&gt;
|-&lt;br /&gt;
| -Werror=implicit-function-declaration || Reject missing function prototypes&lt;br /&gt;
|-&lt;br /&gt;
| -Wl,-z,defs || Detect and reject underlinking&lt;br /&gt;
|-&lt;br /&gt;
| -Wl,-z,now || Disable lazy binding&lt;br /&gt;
|-&lt;br /&gt;
| -Wl,-z,relro || Read-only segments after relocation&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* [https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/ Flags and info source]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://security.archlinux.org/ Arch Linux Security Tracker]&lt;br /&gt;
* [https://wiki.centos.org/HowTos/OS_Protection CentOS Wiki: OS Protection]&lt;br /&gt;
* [https://web.archive.org/web/20210712001756/https://developer.ibm.com/technologies/linux/articles/l-harden-desktop/ Hardening the Linux desktop]&lt;br /&gt;
* [https://web.archive.org/web/20190701140035/https://www.ibm.com/developerworks/linux/tutorials/l-harden-server/index.html Hardening the Linux server]&lt;br /&gt;
* [https://github.com/lfit/itpol/blob/master/linux-workstation-security.md Linux Foundation: Linux workstation security checklist]&lt;br /&gt;
* [https://www.privacyguides.org/ privacyguides.org Privacy Resources]&lt;br /&gt;
* [https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide/ Red Hat Enterprise Linux 7 Security Guide]&lt;br /&gt;
* [https://www.debian.org/doc/manuals/securing-debian-manual/index.en.html Securing Debian Manual]&lt;br /&gt;
* [https://web.archive.org/web/20140220055801/http://crunchbang.org:80/forums/viewtopic.php?id=24722 The paranoid #! Security Guide]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Isync&amp;diff=873535</id>
		<title>Isync</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Isync&amp;diff=873535"/>
		<updated>2026-05-10T15:43:38Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Configuring */ move note below configuration sample (paragraph unchanged) and reword note according to manual&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Lowercase title}}&lt;br /&gt;
[[Category:Mail retrieval agents]]&lt;br /&gt;
[[Category:OpenPGP]]&lt;br /&gt;
[[ja:Isync]]&lt;br /&gt;
[https://isync.sourceforge.net/ isync] is a command line application to synchronize mailboxes; it supports Maildir and IMAP4 mailboxes. New messages, message deletions and flag changes can be propagated both ways.&lt;br /&gt;
&lt;br /&gt;
Synchronization is based on unique message identifiers (UIDs), so no identification conflicts can occur (as opposed to some other mail synchronizers).&lt;br /&gt;
Synchronization state is kept in one local text file per mailbox pair; multiple replicas of a mailbox can be maintained.&lt;br /&gt;
{{note|isync is the name of the project, mbsync is the name of the executable}}&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
&lt;br /&gt;
[[Install]] the {{Pkg|isync}} package.&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
&lt;br /&gt;
First, a main configuration file needs to be created, either as  {{ic|isyncrc}} in the user&#039;s {{ic|XDG_CONFIG_HOME}} directory, or {{ic|.mbsyncrc}} in the user&#039;s home directory root. The package supplies an example {{ic|/usr/share/doc/isync/examples/mbsyncrc.sample}} file. Another example for a Google-mail account is as follows:&lt;br /&gt;
&lt;br /&gt;
{{Note|&#039;&#039;&#039;Subfolders&#039;&#039;&#039; setting for {{ic|MaildirStore}} is required to be set, but unset per default - see [https://isync.sourceforge.net/mbsync.html iSync Config SubFolders].}}&lt;br /&gt;
&lt;br /&gt;
{{Out of date|The access to Gmail with [https://myaccount.google.com/lesssecureapps lesssecureapps] is no longer possible without two-factor authentication. The example needs to be updated for an [https://myaccount.google.com/apppasswords  an app password], or another provider. For Gmail, [[#Using XOAUTH2]] is another option.}}&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.mbsyncrc|&lt;br /&gt;
IMAPAccount gmail&lt;br /&gt;
# Address to connect to&lt;br /&gt;
Host imap.gmail.com&lt;br /&gt;
User &#039;&#039;username&#039;&#039;@gmail.com&lt;br /&gt;
Pass ***************&lt;br /&gt;
# To store the password in an encrypted file use PassCmd instead of Pass&lt;br /&gt;
# PassCmd &amp;quot;gpg2 -q --for-your-eyes-only --no-tty -d ~/.mailpass.gpg&amp;quot;&lt;br /&gt;
#&lt;br /&gt;
# Use TLS&lt;br /&gt;
TLSType IMAPS&lt;br /&gt;
# The following line should work. If you get certificate errors, uncomment the two following lines and read the &amp;quot;Troubleshooting&amp;quot; section.&lt;br /&gt;
CertificateFile /etc/ssl/certs/ca-certificates.crt&lt;br /&gt;
#CertificateFile ~/.cert/imap.gmail.com.pem&lt;br /&gt;
#CertificateFile ~/.cert/Equifax_Secure_CA.pem&lt;br /&gt;
&lt;br /&gt;
IMAPStore gmail-remote&lt;br /&gt;
Account gmail&lt;br /&gt;
&lt;br /&gt;
MaildirStore gmail-local&lt;br /&gt;
SubFolders Verbatim&lt;br /&gt;
# The trailing &amp;quot;/&amp;quot; is important&lt;br /&gt;
Path ~/.mail/gmail/&lt;br /&gt;
Inbox ~/.mail/gmail/Inbox&lt;br /&gt;
&lt;br /&gt;
Channel gmail&lt;br /&gt;
Far :gmail-remote:&lt;br /&gt;
Near :gmail-local:&lt;br /&gt;
# Exclude everything under the internal [Gmail] folder, except the interesting folders&lt;br /&gt;
Patterns * ![Gmail]* &amp;quot;[Gmail]/Sent Mail&amp;quot; &amp;quot;[Gmail]/Starred&amp;quot; &amp;quot;[Gmail]/All Mail&amp;quot;&lt;br /&gt;
# Or include everything&lt;br /&gt;
#Patterns *&lt;br /&gt;
# Automatically create missing mailboxes, both locally and on the server&lt;br /&gt;
Create Both&lt;br /&gt;
# Sync the movement of messages between folders and deletions, add after making sure the sync works&lt;br /&gt;
Expunge Both&lt;br /&gt;
# Save the synchronization state files in the relevant directory&lt;br /&gt;
SyncState *&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
It is possible to avoid the proprietary {{ic|[Gmail]}} (or {{ic|[Google Mail]}}) folder categorization by using separate channels for each directory, and later merging them to a group:&lt;br /&gt;
{{hc|~/.mbsyncrc|&lt;br /&gt;
Channel sync-googlemail-default&lt;br /&gt;
Far :gmail-remote:&lt;br /&gt;
Near :gmail-local:&lt;br /&gt;
# Select some mailboxes to sync&lt;br /&gt;
Patterns &amp;quot;INBOX&amp;quot; &amp;quot;arch&amp;quot;&lt;br /&gt;
Create Both&lt;br /&gt;
&lt;br /&gt;
Channel sync-googlemail-sent&lt;br /&gt;
Far :gmail-remote:&amp;quot;[Google Mail]/Gesendet&amp;quot;&lt;br /&gt;
Near :gmail-local:sent&lt;br /&gt;
Create Near&lt;br /&gt;
&lt;br /&gt;
Channel sync-googlemail-trash&lt;br /&gt;
Far :gmail-remote:&amp;quot;[Google Mail]/Papierkorb&amp;quot;&lt;br /&gt;
Near :gmail-local:trash&lt;br /&gt;
Create Near&lt;br /&gt;
&lt;br /&gt;
# Get all the channels together into a group.&lt;br /&gt;
Group googlemail&lt;br /&gt;
Channel sync-googlemail-default&lt;br /&gt;
Channel sync-googlemail-sent&lt;br /&gt;
Channel sync-googlemail-trash&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
As you can see, name-translations are possible this way as well.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
First make any folders that were specified as Maildirs:&lt;br /&gt;
&lt;br /&gt;
 $ mkdir -p ~/.mail/gmail&lt;br /&gt;
&lt;br /&gt;
Then to retrieve the mail for a specific channel run:&lt;br /&gt;
&lt;br /&gt;
 $ mbsync gmail&lt;br /&gt;
&lt;br /&gt;
or to retrieve the mail for all channels:&lt;br /&gt;
&lt;br /&gt;
 $ mbsync -a&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Using Path and/or Inbox on NTFS partitions ===&lt;br /&gt;
&lt;br /&gt;
Since NTFS partitions will not accept a semicolon in a filename, you need to change your InfoDelimiter and your FieldDelimiter to something else, you can achieve this by globaly (outside any store or channel configuration) changing the later, like below:&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.mbsyncrc|2=&lt;br /&gt;
FieldDelimiter -&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Importing EML emails ===&lt;br /&gt;
&lt;br /&gt;
Importing emails in the [[Wikipedia:Email#Filename_extensions|EML]] format is achieved by copying the {{ic|.eml}} files under the {{ic|cur}} directory of the desired [[Wikipedia:Maildir|Maildir]] directory.&lt;br /&gt;
For example, using {{ic|mv message.eml ~/.mail/&#039;&#039;myaccount&#039;&#039;/Inbox}}.&lt;br /&gt;
The new emails should be detected during the subsequent run of {{ic|mbsync}}.&lt;br /&gt;
&lt;br /&gt;
=== Calling mbsync automatically ===&lt;br /&gt;
&lt;br /&gt;
==== With a timer ====&lt;br /&gt;
&lt;br /&gt;
If you want to automatically synchronize your mailboxes, isync can be started automatically with a [[systemd/User]] unit. The following service file can start the {{ic|mbsync}} command:&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/systemd/user/mbsync.service|2=&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Mailbox synchronization service&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
Type=oneshot&lt;br /&gt;
ExecStart=/usr/bin/mbsync -Va&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=default.target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The following timer configures {{ic|mbsync}} to be started 2 minutes after boot, and then every 5 minutes:&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/systemd/user/mbsync.timer|2=&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Mailbox synchronization timer&lt;br /&gt;
&lt;br /&gt;
[Timer]&lt;br /&gt;
OnBootSec=2m&lt;br /&gt;
OnUnitActiveSec=5m&lt;br /&gt;
Unit=mbsync.service&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=timers.target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Once those two files are created, [[reload]] systemd, then [[enable]] and [[start]] {{ic|mbsync.timer}}, adding the {{ic|--user}} flag to {{ic|systemctl}}.&lt;br /&gt;
&lt;br /&gt;
{{Tip|The mbsync service now only runs after login. It is also possible to launch the systemd-user instances after boot if you configure [[Systemd/User#Automatic start-up of systemd user instances]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== Integration with notmuch or mu4e =====&lt;br /&gt;
&lt;br /&gt;
If you want to run [[notmuch]] or mu/mu4e after automatically synchronizing your mails, it is preferable to modify the above {{ic|mbsync.service}} by adding a post-start hook, like below:&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/systemd/user/mbsync.service|2=&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Mailbox synchronization service&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
Type=oneshot&lt;br /&gt;
ExecStart=/usr/bin/mbsync -Va&lt;br /&gt;
ExecStartPost=/usr/bin/notmuch new&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can also index {{ic|mu}} by changing the {{ic|ExecStartPost}} line to {{ic|1=ExecStartPost=/usr/bin/mu index}}, or to {{ic|1=ExecStartPost=/usr/bin/emacsclient -e &#039;(mu4e-update-index)&#039;}} if you are running emacsclient and would like to index {{ic|mu4e}}.&lt;br /&gt;
&lt;br /&gt;
This modification assumes that you have already setup notmuch or mu/mu4e for your user. If the ExecStart command does not execute successfully, the ExecStartPost command will not execute, so be aware of this!&lt;br /&gt;
&lt;br /&gt;
Trigger syncing immediately when making local changes (such as marking messages as read) by watching the {{ic|.notmuch}} directory:&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/systemd/user/mbsync.path|2=&lt;br /&gt;
[Path]&lt;br /&gt;
PathChanged=%h/mail/.notmuch&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=default.target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Systemd defaults ensure that the service will not trigger redundantly.&lt;br /&gt;
&lt;br /&gt;
==== With imapnotify ====&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:IMAP IDLE|IMAP IDLE]] is a way to get [[Wikipedia:Push Technology|push notifications]] to download new email, rather than polling the server intermittently. This has the advantage of saving bandwidth and delivering your mail as soon as it is available. Isync does not have native IDLE support, but we can use a program like [https://www.npmjs.com/package/imapnotify imapnotify] to call mbsync when you receive new email. For this example we will use the {{Pkg|goimapnotify}} package which is reported to work better with frequent network interruptions. &lt;br /&gt;
&lt;br /&gt;
Install {{Pkg|goimapnotify}} and create a configuration file for each mail server you want to poll. Note that the file name format, including the &#039;&#039;.yaml&#039;&#039;, is necessary if you want to use the provided systemd service:&lt;br /&gt;
{{hc|~/.config/imapnotify/gmail.yaml|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;host&amp;quot;: &amp;quot;imap.gmail.com&amp;quot;,&lt;br /&gt;
  &amp;quot;port&amp;quot;: 993,&lt;br /&gt;
  &amp;quot;tls&amp;quot;: true,&lt;br /&gt;
  &amp;quot;tlsOptions&amp;quot;: {&lt;br /&gt;
    &amp;quot;rejectUnauthorized&amp;quot;: false&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;username&amp;quot;: &amp;quot;username@gmail.com&amp;quot;,&lt;br /&gt;
  &amp;quot;password&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;passwordCmd&amp;quot;: &amp;quot;pass gmail | head -n1&amp;quot;,&lt;br /&gt;
  &amp;quot;onNewMail&amp;quot;: &amp;quot;mbsync gmail&amp;quot;,&lt;br /&gt;
  &amp;quot;onNewMailPost&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
  &amp;quot;boxes&amp;quot;: [ &amp;quot;INBOX&amp;quot; ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
(You can view the full configuration options in the project&#039;s [https://gitlab.com/shackra/goimapnotify README].)&lt;br /&gt;
&lt;br /&gt;
[[Start/enable]] the  {{ic|goimapnotify@gmail.service}} [[user unit]].&lt;br /&gt;
&lt;br /&gt;
Note that IMAP IDLE only triggers when new mail arrives, not when there is undownloaded mail on the server. For example, if you receive 100 emails with your computer powered off, then turn on your computer, imapnotify will still not download new mail until you receive another email. For this reason you may want to run mbsync [[Autostarting|once when you log in]].&lt;br /&gt;
&lt;br /&gt;
=== Using XOAUTH2 ===&lt;br /&gt;
&lt;br /&gt;
First install an XOAUTH2 SASL plugin, like {{AUR|cyrus-sasl-xoauth2-git}}.&lt;br /&gt;
&lt;br /&gt;
For all OAuth2 helpers listed below, choose either one among them, you need to provide a {{ic|client_id}} and optionally a {{ic|client_secret}} of your own or of a suitable FOSS registered application.&lt;br /&gt;
&lt;br /&gt;
In order to get a {{ic|client_id}} and {{ic|client_secret}}, you will need an app registration with the provider. You should create your own app registration if possible, otherwise, for example due to missing rights, you can use existing app registrations, such as [https://hg.mozilla.org/comm-central/file/tip/mailnews/base/src/OAuth2Providers.sys.mjs Thunderbird&#039;s] (under {{ic|kIssuers}}) or [https://github.com/harishkrupo/oauth2ms/issues/15 Evolution&#039;s], which are publicly available until dynamic client registration is supported.&lt;br /&gt;
&lt;br /&gt;
Another option is to temporarily use an incognito browser window to create a free outlook.com account and use that to create the app registration.&lt;br /&gt;
&lt;br /&gt;
==== oama ====&lt;br /&gt;
&lt;br /&gt;
[https://github.com/pdobsan/oama oama] is a utility which provides IMAP/SMTP clients with renewal capabilities and authorization of OAuth2 credentials. [[install]] {{AUR|oama-bin}} and configure it according to its [https://github.com/pdobsan/oama README].&lt;br /&gt;
You can find configuration templates in {{ic|/usr/share/oama}}.&lt;br /&gt;
&lt;br /&gt;
Before you are able to use oama with your credentials you need to authorize OAuth2 access by running the command below:&lt;br /&gt;
&lt;br /&gt;
 $ oama authorize &#039;&#039;service&#039;&#039; &#039;&#039;email&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;service&#039;&#039; is your email provider (e.g. &#039;&#039;google&#039;&#039;) and &#039;&#039;email&#039;&#039; is your email address.&lt;br /&gt;
&lt;br /&gt;
After the authorization completed add {{ic|AuthMechs XOAUTH2}} and {{ic|PassCmd &amp;quot;oama access &#039;&#039;email&#039;&#039;&amp;quot;}} to the {{ic|IMAPAccount}} section in the {{ic|.mbsyncrc}}.&lt;br /&gt;
&lt;br /&gt;
==== oauth2token ====&lt;br /&gt;
&lt;br /&gt;
Install {{AUR|oauth2token}} and follow its [https://pypi.org/project/oauth2token/ README] to configure the account. It will be responsible for getting the current XOAUTH2 token using the account credentials every time mbsync needs to authenticate.&lt;br /&gt;
&lt;br /&gt;
Finally, add {{ic|AuthMechs XOAUTH2}} and {{ic|PassCmd &amp;quot;oauth2get &#039;&#039;provider&#039;&#039; &#039;&#039;account&#039;&#039;&amp;quot;}}, substituting {{ic|&#039;&#039;provider&#039;&#039;}} and {{ic|&#039;&#039;account&#039;&#039;}} with the values you used for {{ic|oauth2create}}, to the {{ic|IMAPAccount}} section in the {{ic|.mbsyncrc}}.&lt;br /&gt;
&lt;br /&gt;
==== mutt_oauth2.py ====&lt;br /&gt;
&lt;br /&gt;
{{ic|mutt_oauth2.py}} is known to work with Google and Microsoft accounts. Download {{AUR|mutt_oauth2.py}} and follow its [https://gitlab.com/muttmua/mutt/-/blob/master/contrib/mutt_oauth2.py.README README] for background and to configure the account.&lt;br /&gt;
&lt;br /&gt;
In short, you will need to modify the {{ic|ENCRYPTION_PIPE}} and {{ic|DECRYPTION_PIPE}} for your preferred encryption system directly in script&#039;s source or specify them on each subsequent renew invocation using flags. During authorization, add the {{ic|client_id}} and {{ic|client_secret}} from an app registration with the provider (see [[#Using XOAUTH2]]). Then to initialize your tokens, you run and answer the questions in:&lt;br /&gt;
&lt;br /&gt;
 $ mutt_oauth2.py userid@myschool.edu.tokens --verbose --authorize&lt;br /&gt;
&lt;br /&gt;
Note that gmail only supports the {{ic|localhostauthcode}} authflow while MS only supports the {{ic|authcode}} authflow.&lt;br /&gt;
&lt;br /&gt;
To subsequently receive your access token (the script automatically handles renewing of tokens), you can run:&lt;br /&gt;
&lt;br /&gt;
 $ mutt_oauth2.py userid@myschool.edu.tokens&lt;br /&gt;
&lt;br /&gt;
As the {{ic|ENCRYPTION_PIPE}} and {{ic|DECRYPTION_PIPE}} options are not stored within the token file, you have to pass them separately if you do not want to hardcode your gpg key name in script&#039;s source:&lt;br /&gt;
&lt;br /&gt;
 $ mutt_oauth2.py userid@myschool.edu.tokens --encryption-pipe &#039;gpg --encrypt --recipient &amp;lt;gpg-key&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
Finally, add {{ic|AuthMechs XOAUTH2}} and {{ic|PassCmd &amp;quot;mutt_oauth2.py userid@myschool.edu.tokens&amp;quot;}}, with the correct paths if necessary, to the {{ic|IMAPAccount}} section in the {{ic|.mbsyncrc}}.&lt;br /&gt;
&lt;br /&gt;
==== oauth2ms ====&lt;br /&gt;
&lt;br /&gt;
{{ic|oauth2ms}} can be used to fetch oauth2 tokens from the Microsoft identity endpoint. &lt;br /&gt;
Additionally, it can encode the token in the XOAUTH2 format to be used as authentication in IMAP mail servers.&lt;br /&gt;
&lt;br /&gt;
Install {{ic|oauth2ms}} as [https://github.com/harishkrupo/oauth2ms#installation indicated] and create a config file {{ic|$XDG_CONFIG_HOME/oauth2ms/config.json}} [https://github.com/harishkrupo/oauth2ms#usage containing] the {{ic| client_id}}.&lt;br /&gt;
&lt;br /&gt;
Finally, add {{ic|AuthMechs XOAUTH2}} and {{ic|PassCmd &amp;quot;oauth2ms&amp;quot;}}, or the full path to {{ic|oauth2ms}} if necessary, to the {{ic|IMAPAccount}} section in {{ic|.mbsyncrc}}.&lt;br /&gt;
&lt;br /&gt;
=== Integration with ProtonMail ===&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:Proton Mail|Proton Mail]] solution for interfacing with conventional email clients is for the user to run a local IMAP/SMTP server that will communicate with ProtonMail servers -- it is known as ProtonMail Bridge and available in the {{Pkg|protonmail-bridge-core}} package.&lt;br /&gt;
Note that this software requires a running and working software implementing FreeDesktop.org&#039;s [https://specifications.freedesktop.org/secret-service-spec/latest/ Secret Service API] (&#039;&#039;e.g.&#039;&#039;, [[GNOME Keyring]] or [[Wikipedia:KeePassXC|KeePassXC]]) and [[gpg-agent]].&lt;br /&gt;
&lt;br /&gt;
==== Bridge installation and configuration ====&lt;br /&gt;
&lt;br /&gt;
1. Run the bridge and login using ProtonMail credentials:&lt;br /&gt;
&lt;br /&gt;
    $ protonmail-bridge-core --cli&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; login&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; info&lt;br /&gt;
&lt;br /&gt;
2. To let IMAP clients accessing the local Bridge IMAP server, get the ProtonMail self-signed certificate:&lt;br /&gt;
&lt;br /&gt;
    $ openssl s_client -starttls imap -connect 127.0.0.1:1143 -showcerts&lt;br /&gt;
&lt;br /&gt;
3. Manually copy lines between  {{ic|-----BEGIN CERTIFICATE-----}} and {{ic|-----END CERTIFICATE-----}} and put them inside a file, &#039;&#039;e.g.&#039;&#039;, {{ic|~/.config/protonmail/bridge-v3/cert.pem}}.&lt;br /&gt;
&lt;br /&gt;
4. After checking that everything is working, stop the Bridge from the command-line and run it as a service:&lt;br /&gt;
&lt;br /&gt;
    $ systemctl --user enable --now protonmail-bridge.service&lt;br /&gt;
&lt;br /&gt;
==== Isync configuration for interacting with Bridge ====&lt;br /&gt;
&lt;br /&gt;
Configuring Isync to use ProtonMail Bridge as an IMAP server is possible using the following in your {{ic|~/.mbsyncrc}} configuration.&lt;br /&gt;
The following is a working example in a two-way sync between the local machine the ProtonMail account.&lt;br /&gt;
&lt;br /&gt;
{{Note|In the following, only configuration that is special for ProtonMail will be commented.}} &lt;br /&gt;
{{Tip|The port can be obtained from the CLI interface of the ProtonMail Bridge binary.}} &lt;br /&gt;
{{Tip|In {{ic|Patterns}}, we ignore the {{ic|Labels/*}} directories since this is a directory hierarchy used internally by ProtonMail to store the labels/tags user settings.}} &lt;br /&gt;
{{Warning|In {{ic|Patterns}}, we ignore the {{ic|All Mail/*}} directory since this is a virtual view of all emails created by ProtonMail. As such, if not ignored, the IMAP library of Bridge ([https://github.com/ProtonMail/gluon Gluon]) will throw an [https://github.com/ProtonMail/gluon/issues/426 error about an IMAP CLOSE command] that is not allowed during the {{ic|Expunge}} operation of Isync.}} &lt;br /&gt;
&lt;br /&gt;
    IMAPStore proton-remote&lt;br /&gt;
    Port 1143&lt;br /&gt;
    Host 127.0.0.1&lt;br /&gt;
    User &#039;&#039;YOUR_EMAIL&#039;&#039;&lt;br /&gt;
    PassCmd &#039;&#039;YOUR_PASSWORD&#039;&#039;&lt;br /&gt;
    TLSType STARTTLS&lt;br /&gt;
    CertificateFile &#039;&#039;YOUR_CERTIFICATE_PATH&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    MaildirStore proton-local&lt;br /&gt;
    SubFolders Verbatim&lt;br /&gt;
    Path &#039;&#039;~/PATH/TO/MAILBOX/&#039;&#039;&lt;br /&gt;
    Inbox &#039;&#039;~/PATH/TO/MAILBOX/Inbox&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    Channel proton&lt;br /&gt;
    Far :proton-remote:&lt;br /&gt;
    Near :proton-local:&lt;br /&gt;
    Patterns * !Labels* !&amp;quot;All Mail&amp;quot;&lt;br /&gt;
    Create Both&lt;br /&gt;
    Expunge Both&lt;br /&gt;
    SyncState *&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== SSL error ===&lt;br /&gt;
&lt;br /&gt;
If you get the following error:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;SSL error connecting imap.gmail.com (108.177.125.109:993): self signed certificate&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Since google enforce SNI when you use TLS 1.3, ensure to run at least isync v1.3.0&lt;br /&gt;
See https://sourceforge.net/p/isync/isync/merge-requests/2/ for more details&lt;br /&gt;
&lt;br /&gt;
If you get certificate related errors like: &lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;SSL error connecting pop.mail.com (193.222.111.111:143): error:00000012:lib(0):func(0):reason(18)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
you may need to retrieve the server&#039;s certificates manually in order for mbsync to correctly verify it.&lt;br /&gt;
&lt;br /&gt;
==== Step #1: Get the certificates ====&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|This may not always be needed, e.g. for gmail {{ic|CertificateFile /etc/ssl/certs/ca-certificates.crt}} in the config file may be suffcient|section=Step #1: Get the certificates}}&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;$ mkdir ~/.cert&lt;br /&gt;
$ openssl s_client -connect some.imap.server:port -showcerts 2&amp;gt;&amp;amp;1 &amp;lt; /dev/null | sed -ne &#039;/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p&#039; | sed -ne &#039;1,/-END CERTIFICATE-/p&#039; &amp;gt; ~/.cert/some.imap.server.pem&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This will create a certificate file called {{ic|~/.cert/some.imap.server.pem}} (e.g. {{ic|~/.cert/imap.gmail.com.pem}}). Alternatively one can download [https://gist.githubusercontent.com/petRUShka/af96ae25ce8280729b9ea049b929f31d/raw/a79471ce8aee3f6d04049039adf870a53a524f7f/get_certs.sh get_certs.sh] and run it:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;$ mkdir ~/.cert&lt;br /&gt;
$ wget https://gist.githubusercontent.com/petRUShka/af96ae25ce8280729b9ea049b929f31d/raw/a79471ce8aee3f6d04049039adf870a53a524f7f/get_certs.sh&lt;br /&gt;
$ sh get_certs.sh some.imap.server port ~/.cert/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
If you wish to do this manually, you may enter:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;$ openssl s_client -connect some.imap.server:port -showcerts&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
and it will display output something like:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;CONNECTED(00000003)&lt;br /&gt;
depth=1 C = US, O = Google Inc, CN = Google Internet Authority&lt;br /&gt;
verify error:num=20:unable to get local issuer certificate&lt;br /&gt;
verify return:0&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/C=US/ST=California/L=Mountain View/O=Google Inc/CN=imap.gmail.com&lt;br /&gt;
   i:/C=US/O=Google Inc/CN=Google Internet Authority&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIDgDCCAumgAwIBAgIKO3MmiwAAAABopTANBgkqhkiG9w0BAQUFADBGMQswCQYD&lt;br /&gt;
VQQGEwJVUzETMBEGA1UEChMKR29vZ2xlIEluYzEiMCAGA1UEAxMZR29vZ2xlIElu&lt;br /&gt;
dGVybmV0IEF1dGhvcml0eTAeFw0xMjA5MTIxMTU1NDlaFw0xMzA2MDcxOTQzMjda&lt;br /&gt;
MGgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1N&lt;br /&gt;
b3VudGFpbiBWaWV3MRMwEQYDVQQKEwpHb29nbGUgSW5jMRcwFQYDVQQDEw5pbWFw&lt;br /&gt;
LmdtYWlsLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2OmU9DjI+DFQ&lt;br /&gt;
ThqIN4vL6EqZbzH0ejLKcc+zhxsq9BU5hXohSJ1sS5FUU2vReDKk8fd+ZR3cWtpf&lt;br /&gt;
CTYAUSvdnz1ZFjESSzyUBmGRqByhoc0yqdfb61NosA4CDaO+z7DtAgKyecqnAJad&lt;br /&gt;
TPYYf9aLk/UgJuc6GseitjzFYonXi6ECAwEAAaOCAVEwggFNMB0GA1UdJQQWMBQG&lt;br /&gt;
CCsGAQUFBwMBBggrBgEFBQcDAjAdBgNVHQ4EFgQUFuLyTg2NcsyaEESytZbLbQan&lt;br /&gt;
YIowHwYDVR0jBBgwFoAUv8Aw6/VDET5nup6R+/xq2uNrEiQwWwYDVR0fBFQwUjBQ&lt;br /&gt;
oE6gTIZKaHR0cDovL3d3dy5nc3RhdGljLmNvbS9Hb29nbGVJbnRlcm5ldEF1dGhv&lt;br /&gt;
cml0eS9Hb29nbGVJbnRlcm5ldEF1dGhvcml0eS5jcmwwZgYIKwYBBQUHAQEEWjBY&lt;br /&gt;
MFYGCCsGAQUFBzAChkpodHRwOi8vd3d3LmdzdGF0aWMuY29tL0dvb2dsZUludGVy&lt;br /&gt;
bmV0QXV0aG9yaXR5L0dvb2dsZUludGVybmV0QXV0aG9yaXR5LmNydDAMBgNVHRMB&lt;br /&gt;
Af8EAjAAMBkGA1UdEQQSMBCCDmltYXAuZ21haWwuY29tMA0GCSqGSIb3DQEBBQUA&lt;br /&gt;
A4GBAC1LV7tM6pcyVJLcwdPml4DomtowsjTrqvy5ZFa3SMKANK0iZBgFu74O0THX&lt;br /&gt;
8SxP/vn4eAs0yRQxcT1ZuoishLGQl5NoimLaQ4BGQnzFQHDJendfaVKDl21GenJp&lt;br /&gt;
is72sIrAeprsVU8PbNsllUamWsIjKr3DH5xQdH54hDtzQojY&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
 1 s:/C=US/O=Google Inc/CN=Google Internet Authority&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIICsDCCAhmgAwIBAgIDC2dxMA0GCSqGSIb3DQEBBQUAME4xCzAJBgNVBAYTAlVT&lt;br /&gt;
MRAwDgYDVQQKEwdFcXVpZmF4MS0wKwYDVQQLEyRFcXVpZmF4IFNlY3VyZSBDZXJ0&lt;br /&gt;
aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDkwNjA4MjA0MzI3WhcNMTMwNjA3MTk0MzI3&lt;br /&gt;
WjBGMQswCQYDVQQGEwJVUzETMBEGA1UEChMKR29vZ2xlIEluYzEiMCAGA1UEAxMZ&lt;br /&gt;
R29vZ2xlIEludGVybmV0IEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw&lt;br /&gt;
gYkCgYEAye23pIucV+eEPkB9hPSP0XFjU5nneXQUr0SZMyCSjXvlKAy6rWxJfoNf&lt;br /&gt;
NFlOCnowzdDXxFdF7dWq1nMmzq0yE7jXDx07393cCDaob1FEm8rWIFJztyaHNWrb&lt;br /&gt;
qeXUWaUr/GcZOfqTGBhs3t0lig4zFEfC7wFQeeT9adGnwKziV28CAwEAAaOBozCB&lt;br /&gt;
oDAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFL/AMOv1QxE+Z7qekfv8atrjaxIk&lt;br /&gt;
MB8GA1UdIwQYMBaAFEjmaPkr0rKV10fYIyAQTzOYkJ/UMBIGA1UdEwEB/wQIMAYB&lt;br /&gt;
Af8CAQAwOgYDVR0fBDMwMTAvoC2gK4YpaHR0cDovL2NybC5nZW90cnVzdC5jb20v&lt;br /&gt;
Y3Jscy9zZWN1cmVjYS5jcmwwDQYJKoZIhvcNAQEFBQADgYEAuIojxkiWsRF8YHde&lt;br /&gt;
BZqrocb6ghwYB8TrgbCoZutJqOkM0ymt9e8kTP3kS8p/XmOrmSfLnzYhLLkQYGfN&lt;br /&gt;
0rTw8Ktx5YtaiScRhKqOv5nwnQkhClIZmloJ0pC3+gz4fniisIWvXEyZ2VxVKfml&lt;br /&gt;
UUIuOss4jHg7y/j7lYe8vJD5UDI=&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
subject=/C=US/ST=California/L=Mountain View/O=Google Inc/CN=imap.gmail.com&lt;br /&gt;
issuer=/C=US/O=Google Inc/CN=Google Internet Authority&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 2108 bytes and written 350 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-RC4-SHA&lt;br /&gt;
Server public key is 1024 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: NONE&lt;br /&gt;
Expansion: NONE&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1.1&lt;br /&gt;
    Cipher    : ECDHE-RSA-RC4-SHA&lt;br /&gt;
    Session-ID: 77136647F42633D82DEDFBB9EB62AB516547A3697D83BD1884726034613C1C09&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: 635957FBA0762B10694560488905F73BDD2DB674C41970542ED079446F27234E2CA51CF26938B8CA56DF5BBC71E429A7&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    SRP username: None&lt;br /&gt;
    TLS session ticket lifetime hint: 100800 (seconds)&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - d6 5b a0 a7 10 0e 64 04-72 93 7c 9f 94 fa 07 57   .[....d.r.|....W&lt;br /&gt;
    0010 - f1 8b 9d 24 8b 9d 1b f3-a8 b1 4d 2c a9 00 e1 82   ...$......M,....&lt;br /&gt;
    0020 - 00 83 1e 3f e5 f2 b2 2c-d2 a8 87 83 16 02 0d 1e   ...?...,........&lt;br /&gt;
    0030 - bf b6 c1 d6 75 21 04 e6-63 6b ab 5b ed 94 7a 30   ....u!..ck.[..z0&lt;br /&gt;
    0040 - 1a d0 aa 44 c2 04 9b 10-06 28 b5 7b a0 43 a6 0d   ...D.....(.{.C..&lt;br /&gt;
    0050 - 3b 4a 85 1f 2e 07 0a e1-32 9b bd 5d 65 41 4c e2   ;J......2..]eAL.&lt;br /&gt;
    0060 - 7c d7 43 ec c4 18 77 53-b5 d4 84 b4 c9 bd 51 d6   |.C...wS......Q.&lt;br /&gt;
    0070 - 2d 4f 2e 10 a6 ed 38 c5-8e 9d f8 8b 8a 63 3f 7b   -O....8......c?{&lt;br /&gt;
    0080 - ee e6 b8 bf 7a f8 b8 e8-47 92 84 f1 9b 0c 63 30   ....z...G.....c0&lt;br /&gt;
    0090 - 76 d8 e1 44                                       v..D&lt;br /&gt;
&lt;br /&gt;
    Start Time: 1352632558&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 20 (unable to get local issuer certificate)&lt;br /&gt;
---&lt;br /&gt;
* OK Gimap ready for requests from 108.78.162.240 o67if11168976yhc.67&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Simply copy the first block that begins with {{ic|-----BEGIN CERTIFICATE-----}} and ends with {{ic|-----END CERTIFICATE-----}}, paste into a file, and save with a .pem extension (this is necessary for the next step). Older instructions state that, with Gmail, both certificate blocks must be saved but on testing this was found to be unnecessary.&lt;br /&gt;
&lt;br /&gt;
Now, copy the root issuer certificate to your local certificate folder. In this example (Gmail), the root issuer is Equifax Secure Certificate Authority. This certificate is included in the {{pkg|ca-certificates}} package.&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;$ cp /usr/share/ca-certificates/mozilla/Equifax_Secure_CA.crt ~/.cert/Equifax_Secure_CA.pem&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Step #2: Setup mbsync ====&lt;br /&gt;
&lt;br /&gt;
Configure mbsync to use that certificate:&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.mbsyncrc|2=&lt;br /&gt;
&amp;lt;nowiki&amp;gt;IMAPAccount gmail&lt;br /&gt;
Host imap.gmail.com&lt;br /&gt;
# ...&lt;br /&gt;
CertificateFile ~/.cert/imap.gmail.com.pem&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== BAD Command with Exchange 2003 ===&lt;br /&gt;
&lt;br /&gt;
When connecting to an MS Exchange 2003 server, there could be problems when using pipelining (i.e. executing multiple imap commands concurrently).  Such an issue could look as follows:&lt;br /&gt;
&lt;br /&gt;
{{hc|mbsync -V exchange|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;gt;&amp;gt;&amp;gt; 9 SELECT &amp;quot;arch&amp;quot;^M&lt;br /&gt;
* 250 EXISTS&lt;br /&gt;
* 0 RECENT&lt;br /&gt;
* FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)&lt;br /&gt;
* OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags&lt;br /&gt;
* OK [UNSEEN 241] Is the first unseen message&lt;br /&gt;
* OK [UIDVALIDITY 4352] UIDVALIDITY value&lt;br /&gt;
9 OK [READ-WRITE] SELECT completed.&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; 10 UID FETCH 1:1000000000 (UID FLAGS)^M&lt;br /&gt;
* 1 FETCH (UID 1 FLAGS (\Seen \Answered))&lt;br /&gt;
* 2 FETCH (UID 2 FLAGS (\Seen \Answered))&lt;br /&gt;
...&lt;br /&gt;
* 249 FETCH (UID 696 FLAGS ())&lt;br /&gt;
* 250 FETCH (UID 697 FLAGS (\Seen))&lt;br /&gt;
10 OK FETCH completed.&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; 11 APPEND &amp;quot;arch&amp;quot; (\Seen) {4878+}^M&lt;br /&gt;
(1 in progress) &amp;gt;&amp;gt;&amp;gt; 12 UID FETCH 697 (BODY.PEEK[])^M&lt;br /&gt;
(2 in progress) &amp;gt;&amp;gt;&amp;gt; 13 UID STORE 696 +FLAGS.SILENT (\Deleted)^M&lt;br /&gt;
12 BAD Command is not valid in this state.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
So command 9 is to select a new folder, command 10 checks the mail and commands 11, 12 and 13 run in parallel, writing/getting/flagging a mail.  In this case, the Exchange server would terminate the connection after the BAD return value and go on to the next channel.  (And if all went well in this channel, mbsync would return with 0.)  After setting&lt;br /&gt;
&lt;br /&gt;
 PipelineDepth 1&lt;br /&gt;
&lt;br /&gt;
in the IMAPStore config part of the Exchange, this problem did not occur any more.&lt;br /&gt;
&lt;br /&gt;
=== Emails on remote server have the wrong date ===&lt;br /&gt;
&lt;br /&gt;
This fix works when syncing with fastmail, but it likely applies to other services as well.&lt;br /&gt;
&lt;br /&gt;
If you move an email to a new folder using an email client, and mbsync causes the email to appear with the wrong date on the server, add this to your configuration file: &lt;br /&gt;
&lt;br /&gt;
 CopyArrivalDate yes&lt;br /&gt;
&lt;br /&gt;
For example, without this setting, moving an old email from Inbox to Archive using mu4e and then&lt;br /&gt;
syncing to fastmail with mbsync will cause the email to appear in Archive but with the date of&lt;br /&gt;
the sync.&lt;br /&gt;
&lt;br /&gt;
mbsync uses mtime of email message when uploading from maildir to imap server. You can use [https://gist.github.com/artizirk/877ce9d30159323aac037e2a2af74509 fix_maildir_mail_mtime.py] script to set mtime from email header.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
*[https://isync.sourceforge.net/ Home page]&lt;br /&gt;
*[https://sourceforge.net/projects/isync/ Sourceforge page]&lt;br /&gt;
*[https://web.archive.org/web/20230830054154/https://kevin.deldycke.com/2012/08/gmail-backup-mbsync/ backing up gmail with mbsync]&lt;br /&gt;
*[https://www.cyberciti.biz/faq/test-ssl-certificates-diagnosis-ssl-certificate/ How To Verify SSL Certificate From A Shell Prompt]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Isync&amp;diff=873534</id>
		<title>Isync</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Isync&amp;diff=873534"/>
		<updated>2026-05-10T15:35:51Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Configuring */ remove outdated note bullet about gmail, move out of date template to example with respective info added from the bullet&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Lowercase title}}&lt;br /&gt;
[[Category:Mail retrieval agents]]&lt;br /&gt;
[[Category:OpenPGP]]&lt;br /&gt;
[[ja:Isync]]&lt;br /&gt;
[https://isync.sourceforge.net/ isync] is a command line application to synchronize mailboxes; it supports Maildir and IMAP4 mailboxes. New messages, message deletions and flag changes can be propagated both ways.&lt;br /&gt;
&lt;br /&gt;
Synchronization is based on unique message identifiers (UIDs), so no identification conflicts can occur (as opposed to some other mail synchronizers).&lt;br /&gt;
Synchronization state is kept in one local text file per mailbox pair; multiple replicas of a mailbox can be maintained.&lt;br /&gt;
{{note|isync is the name of the project, mbsync is the name of the executable}}&lt;br /&gt;
&lt;br /&gt;
== Installing ==&lt;br /&gt;
&lt;br /&gt;
[[Install]] the {{Pkg|isync}} package.&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
&#039;&#039;&#039;Subfolders&#039;&#039;&#039; setting in MaildirStore now seems to be required to be set:   [https://isync.sourceforge.net/mbsync.html iSync Config SubFolders] &#039;&#039;&#039;SubFolders Legacy&#039;&#039;&#039; worked as previous unset - Oct 2017&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
First, a main configuration file needs to be created, either as  {{ic|isyncrc}} in the user&#039;s {{ic|XDG_CONFIG_HOME}} directory, or {{ic|.mbsyncrc}} in the user&#039;s home directory root. The package supplies an example {{ic|/usr/share/doc/isync/examples/mbsyncrc.sample}} file. Another example for a Google-mail account is as follows:&lt;br /&gt;
&lt;br /&gt;
{{Out of date|The access to Gmail with [https://myaccount.google.com/lesssecureapps lesssecureapps] is no longer possible without two-factor authentication. The example needs to be updated for an [https://myaccount.google.com/apppasswords  an app password], or another provider. For Gmail, [[#Using XOAUTH2]] is another option.}}&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.mbsyncrc|&lt;br /&gt;
IMAPAccount gmail&lt;br /&gt;
# Address to connect to&lt;br /&gt;
Host imap.gmail.com&lt;br /&gt;
User &#039;&#039;username&#039;&#039;@gmail.com&lt;br /&gt;
Pass ***************&lt;br /&gt;
# To store the password in an encrypted file use PassCmd instead of Pass&lt;br /&gt;
# PassCmd &amp;quot;gpg2 -q --for-your-eyes-only --no-tty -d ~/.mailpass.gpg&amp;quot;&lt;br /&gt;
#&lt;br /&gt;
# Use TLS&lt;br /&gt;
TLSType IMAPS&lt;br /&gt;
# The following line should work. If you get certificate errors, uncomment the two following lines and read the &amp;quot;Troubleshooting&amp;quot; section.&lt;br /&gt;
CertificateFile /etc/ssl/certs/ca-certificates.crt&lt;br /&gt;
#CertificateFile ~/.cert/imap.gmail.com.pem&lt;br /&gt;
#CertificateFile ~/.cert/Equifax_Secure_CA.pem&lt;br /&gt;
&lt;br /&gt;
IMAPStore gmail-remote&lt;br /&gt;
Account gmail&lt;br /&gt;
&lt;br /&gt;
MaildirStore gmail-local&lt;br /&gt;
SubFolders Verbatim&lt;br /&gt;
# The trailing &amp;quot;/&amp;quot; is important&lt;br /&gt;
Path ~/.mail/gmail/&lt;br /&gt;
Inbox ~/.mail/gmail/Inbox&lt;br /&gt;
&lt;br /&gt;
Channel gmail&lt;br /&gt;
Far :gmail-remote:&lt;br /&gt;
Near :gmail-local:&lt;br /&gt;
# Exclude everything under the internal [Gmail] folder, except the interesting folders&lt;br /&gt;
Patterns * ![Gmail]* &amp;quot;[Gmail]/Sent Mail&amp;quot; &amp;quot;[Gmail]/Starred&amp;quot; &amp;quot;[Gmail]/All Mail&amp;quot;&lt;br /&gt;
# Or include everything&lt;br /&gt;
#Patterns *&lt;br /&gt;
# Automatically create missing mailboxes, both locally and on the server&lt;br /&gt;
Create Both&lt;br /&gt;
# Sync the movement of messages between folders and deletions, add after making sure the sync works&lt;br /&gt;
Expunge Both&lt;br /&gt;
# Save the synchronization state files in the relevant directory&lt;br /&gt;
SyncState *&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
It is possible to avoid the proprietary {{ic|[Gmail]}} (or {{ic|[Google Mail]}}) folder categorization by using separate channels for each directory, and later merging them to a group:&lt;br /&gt;
{{hc|~/.mbsyncrc|&lt;br /&gt;
Channel sync-googlemail-default&lt;br /&gt;
Far :gmail-remote:&lt;br /&gt;
Near :gmail-local:&lt;br /&gt;
# Select some mailboxes to sync&lt;br /&gt;
Patterns &amp;quot;INBOX&amp;quot; &amp;quot;arch&amp;quot;&lt;br /&gt;
Create Both&lt;br /&gt;
&lt;br /&gt;
Channel sync-googlemail-sent&lt;br /&gt;
Far :gmail-remote:&amp;quot;[Google Mail]/Gesendet&amp;quot;&lt;br /&gt;
Near :gmail-local:sent&lt;br /&gt;
Create Near&lt;br /&gt;
&lt;br /&gt;
Channel sync-googlemail-trash&lt;br /&gt;
Far :gmail-remote:&amp;quot;[Google Mail]/Papierkorb&amp;quot;&lt;br /&gt;
Near :gmail-local:trash&lt;br /&gt;
Create Near&lt;br /&gt;
&lt;br /&gt;
# Get all the channels together into a group.&lt;br /&gt;
Group googlemail&lt;br /&gt;
Channel sync-googlemail-default&lt;br /&gt;
Channel sync-googlemail-sent&lt;br /&gt;
Channel sync-googlemail-trash&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
As you can see, name-translations are possible this way as well.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
First make any folders that were specified as Maildirs:&lt;br /&gt;
&lt;br /&gt;
 $ mkdir -p ~/.mail/gmail&lt;br /&gt;
&lt;br /&gt;
Then to retrieve the mail for a specific channel run:&lt;br /&gt;
&lt;br /&gt;
 $ mbsync gmail&lt;br /&gt;
&lt;br /&gt;
or to retrieve the mail for all channels:&lt;br /&gt;
&lt;br /&gt;
 $ mbsync -a&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Using Path and/or Inbox on NTFS partitions ===&lt;br /&gt;
&lt;br /&gt;
Since NTFS partitions will not accept a semicolon in a filename, you need to change your InfoDelimiter and your FieldDelimiter to something else, you can achieve this by globaly (outside any store or channel configuration) changing the later, like below:&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.mbsyncrc|2=&lt;br /&gt;
FieldDelimiter -&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Importing EML emails ===&lt;br /&gt;
&lt;br /&gt;
Importing emails in the [[Wikipedia:Email#Filename_extensions|EML]] format is achieved by copying the {{ic|.eml}} files under the {{ic|cur}} directory of the desired [[Wikipedia:Maildir|Maildir]] directory.&lt;br /&gt;
For example, using {{ic|mv message.eml ~/.mail/&#039;&#039;myaccount&#039;&#039;/Inbox}}.&lt;br /&gt;
The new emails should be detected during the subsequent run of {{ic|mbsync}}.&lt;br /&gt;
&lt;br /&gt;
=== Calling mbsync automatically ===&lt;br /&gt;
&lt;br /&gt;
==== With a timer ====&lt;br /&gt;
&lt;br /&gt;
If you want to automatically synchronize your mailboxes, isync can be started automatically with a [[systemd/User]] unit. The following service file can start the {{ic|mbsync}} command:&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/systemd/user/mbsync.service|2=&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Mailbox synchronization service&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
Type=oneshot&lt;br /&gt;
ExecStart=/usr/bin/mbsync -Va&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=default.target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The following timer configures {{ic|mbsync}} to be started 2 minutes after boot, and then every 5 minutes:&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/systemd/user/mbsync.timer|2=&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Mailbox synchronization timer&lt;br /&gt;
&lt;br /&gt;
[Timer]&lt;br /&gt;
OnBootSec=2m&lt;br /&gt;
OnUnitActiveSec=5m&lt;br /&gt;
Unit=mbsync.service&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=timers.target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Once those two files are created, [[reload]] systemd, then [[enable]] and [[start]] {{ic|mbsync.timer}}, adding the {{ic|--user}} flag to {{ic|systemctl}}.&lt;br /&gt;
&lt;br /&gt;
{{Tip|The mbsync service now only runs after login. It is also possible to launch the systemd-user instances after boot if you configure [[Systemd/User#Automatic start-up of systemd user instances]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== Integration with notmuch or mu4e =====&lt;br /&gt;
&lt;br /&gt;
If you want to run [[notmuch]] or mu/mu4e after automatically synchronizing your mails, it is preferable to modify the above {{ic|mbsync.service}} by adding a post-start hook, like below:&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/systemd/user/mbsync.service|2=&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Mailbox synchronization service&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
Type=oneshot&lt;br /&gt;
ExecStart=/usr/bin/mbsync -Va&lt;br /&gt;
ExecStartPost=/usr/bin/notmuch new&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can also index {{ic|mu}} by changing the {{ic|ExecStartPost}} line to {{ic|1=ExecStartPost=/usr/bin/mu index}}, or to {{ic|1=ExecStartPost=/usr/bin/emacsclient -e &#039;(mu4e-update-index)&#039;}} if you are running emacsclient and would like to index {{ic|mu4e}}.&lt;br /&gt;
&lt;br /&gt;
This modification assumes that you have already setup notmuch or mu/mu4e for your user. If the ExecStart command does not execute successfully, the ExecStartPost command will not execute, so be aware of this!&lt;br /&gt;
&lt;br /&gt;
Trigger syncing immediately when making local changes (such as marking messages as read) by watching the {{ic|.notmuch}} directory:&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/systemd/user/mbsync.path|2=&lt;br /&gt;
[Path]&lt;br /&gt;
PathChanged=%h/mail/.notmuch&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=default.target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Systemd defaults ensure that the service will not trigger redundantly.&lt;br /&gt;
&lt;br /&gt;
==== With imapnotify ====&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:IMAP IDLE|IMAP IDLE]] is a way to get [[Wikipedia:Push Technology|push notifications]] to download new email, rather than polling the server intermittently. This has the advantage of saving bandwidth and delivering your mail as soon as it is available. Isync does not have native IDLE support, but we can use a program like [https://www.npmjs.com/package/imapnotify imapnotify] to call mbsync when you receive new email. For this example we will use the {{Pkg|goimapnotify}} package which is reported to work better with frequent network interruptions. &lt;br /&gt;
&lt;br /&gt;
Install {{Pkg|goimapnotify}} and create a configuration file for each mail server you want to poll. Note that the file name format, including the &#039;&#039;.yaml&#039;&#039;, is necessary if you want to use the provided systemd service:&lt;br /&gt;
{{hc|~/.config/imapnotify/gmail.yaml|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;host&amp;quot;: &amp;quot;imap.gmail.com&amp;quot;,&lt;br /&gt;
  &amp;quot;port&amp;quot;: 993,&lt;br /&gt;
  &amp;quot;tls&amp;quot;: true,&lt;br /&gt;
  &amp;quot;tlsOptions&amp;quot;: {&lt;br /&gt;
    &amp;quot;rejectUnauthorized&amp;quot;: false&lt;br /&gt;
  },&lt;br /&gt;
  &amp;quot;username&amp;quot;: &amp;quot;username@gmail.com&amp;quot;,&lt;br /&gt;
  &amp;quot;password&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;passwordCmd&amp;quot;: &amp;quot;pass gmail | head -n1&amp;quot;,&lt;br /&gt;
  &amp;quot;onNewMail&amp;quot;: &amp;quot;mbsync gmail&amp;quot;,&lt;br /&gt;
  &amp;quot;onNewMailPost&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
  &amp;quot;boxes&amp;quot;: [ &amp;quot;INBOX&amp;quot; ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
(You can view the full configuration options in the project&#039;s [https://gitlab.com/shackra/goimapnotify README].)&lt;br /&gt;
&lt;br /&gt;
[[Start/enable]] the  {{ic|goimapnotify@gmail.service}} [[user unit]].&lt;br /&gt;
&lt;br /&gt;
Note that IMAP IDLE only triggers when new mail arrives, not when there is undownloaded mail on the server. For example, if you receive 100 emails with your computer powered off, then turn on your computer, imapnotify will still not download new mail until you receive another email. For this reason you may want to run mbsync [[Autostarting|once when you log in]].&lt;br /&gt;
&lt;br /&gt;
=== Using XOAUTH2 ===&lt;br /&gt;
&lt;br /&gt;
First install an XOAUTH2 SASL plugin, like {{AUR|cyrus-sasl-xoauth2-git}}.&lt;br /&gt;
&lt;br /&gt;
For all OAuth2 helpers listed below, choose either one among them, you need to provide a {{ic|client_id}} and optionally a {{ic|client_secret}} of your own or of a suitable FOSS registered application.&lt;br /&gt;
&lt;br /&gt;
In order to get a {{ic|client_id}} and {{ic|client_secret}}, you will need an app registration with the provider. You should create your own app registration if possible, otherwise, for example due to missing rights, you can use existing app registrations, such as [https://hg.mozilla.org/comm-central/file/tip/mailnews/base/src/OAuth2Providers.sys.mjs Thunderbird&#039;s] (under {{ic|kIssuers}}) or [https://github.com/harishkrupo/oauth2ms/issues/15 Evolution&#039;s], which are publicly available until dynamic client registration is supported.&lt;br /&gt;
&lt;br /&gt;
Another option is to temporarily use an incognito browser window to create a free outlook.com account and use that to create the app registration.&lt;br /&gt;
&lt;br /&gt;
==== oama ====&lt;br /&gt;
&lt;br /&gt;
[https://github.com/pdobsan/oama oama] is a utility which provides IMAP/SMTP clients with renewal capabilities and authorization of OAuth2 credentials. [[install]] {{AUR|oama-bin}} and configure it according to its [https://github.com/pdobsan/oama README].&lt;br /&gt;
You can find configuration templates in {{ic|/usr/share/oama}}.&lt;br /&gt;
&lt;br /&gt;
Before you are able to use oama with your credentials you need to authorize OAuth2 access by running the command below:&lt;br /&gt;
&lt;br /&gt;
 $ oama authorize &#039;&#039;service&#039;&#039; &#039;&#039;email&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;service&#039;&#039; is your email provider (e.g. &#039;&#039;google&#039;&#039;) and &#039;&#039;email&#039;&#039; is your email address.&lt;br /&gt;
&lt;br /&gt;
After the authorization completed add {{ic|AuthMechs XOAUTH2}} and {{ic|PassCmd &amp;quot;oama access &#039;&#039;email&#039;&#039;&amp;quot;}} to the {{ic|IMAPAccount}} section in the {{ic|.mbsyncrc}}.&lt;br /&gt;
&lt;br /&gt;
==== oauth2token ====&lt;br /&gt;
&lt;br /&gt;
Install {{AUR|oauth2token}} and follow its [https://pypi.org/project/oauth2token/ README] to configure the account. It will be responsible for getting the current XOAUTH2 token using the account credentials every time mbsync needs to authenticate.&lt;br /&gt;
&lt;br /&gt;
Finally, add {{ic|AuthMechs XOAUTH2}} and {{ic|PassCmd &amp;quot;oauth2get &#039;&#039;provider&#039;&#039; &#039;&#039;account&#039;&#039;&amp;quot;}}, substituting {{ic|&#039;&#039;provider&#039;&#039;}} and {{ic|&#039;&#039;account&#039;&#039;}} with the values you used for {{ic|oauth2create}}, to the {{ic|IMAPAccount}} section in the {{ic|.mbsyncrc}}.&lt;br /&gt;
&lt;br /&gt;
==== mutt_oauth2.py ====&lt;br /&gt;
&lt;br /&gt;
{{ic|mutt_oauth2.py}} is known to work with Google and Microsoft accounts. Download {{AUR|mutt_oauth2.py}} and follow its [https://gitlab.com/muttmua/mutt/-/blob/master/contrib/mutt_oauth2.py.README README] for background and to configure the account.&lt;br /&gt;
&lt;br /&gt;
In short, you will need to modify the {{ic|ENCRYPTION_PIPE}} and {{ic|DECRYPTION_PIPE}} for your preferred encryption system directly in script&#039;s source or specify them on each subsequent renew invocation using flags. During authorization, add the {{ic|client_id}} and {{ic|client_secret}} from an app registration with the provider (see [[#Using XOAUTH2]]). Then to initialize your tokens, you run and answer the questions in:&lt;br /&gt;
&lt;br /&gt;
 $ mutt_oauth2.py userid@myschool.edu.tokens --verbose --authorize&lt;br /&gt;
&lt;br /&gt;
Note that gmail only supports the {{ic|localhostauthcode}} authflow while MS only supports the {{ic|authcode}} authflow.&lt;br /&gt;
&lt;br /&gt;
To subsequently receive your access token (the script automatically handles renewing of tokens), you can run:&lt;br /&gt;
&lt;br /&gt;
 $ mutt_oauth2.py userid@myschool.edu.tokens&lt;br /&gt;
&lt;br /&gt;
As the {{ic|ENCRYPTION_PIPE}} and {{ic|DECRYPTION_PIPE}} options are not stored within the token file, you have to pass them separately if you do not want to hardcode your gpg key name in script&#039;s source:&lt;br /&gt;
&lt;br /&gt;
 $ mutt_oauth2.py userid@myschool.edu.tokens --encryption-pipe &#039;gpg --encrypt --recipient &amp;lt;gpg-key&amp;gt;&#039;&lt;br /&gt;
&lt;br /&gt;
Finally, add {{ic|AuthMechs XOAUTH2}} and {{ic|PassCmd &amp;quot;mutt_oauth2.py userid@myschool.edu.tokens&amp;quot;}}, with the correct paths if necessary, to the {{ic|IMAPAccount}} section in the {{ic|.mbsyncrc}}.&lt;br /&gt;
&lt;br /&gt;
==== oauth2ms ====&lt;br /&gt;
&lt;br /&gt;
{{ic|oauth2ms}} can be used to fetch oauth2 tokens from the Microsoft identity endpoint. &lt;br /&gt;
Additionally, it can encode the token in the XOAUTH2 format to be used as authentication in IMAP mail servers.&lt;br /&gt;
&lt;br /&gt;
Install {{ic|oauth2ms}} as [https://github.com/harishkrupo/oauth2ms#installation indicated] and create a config file {{ic|$XDG_CONFIG_HOME/oauth2ms/config.json}} [https://github.com/harishkrupo/oauth2ms#usage containing] the {{ic| client_id}}.&lt;br /&gt;
&lt;br /&gt;
Finally, add {{ic|AuthMechs XOAUTH2}} and {{ic|PassCmd &amp;quot;oauth2ms&amp;quot;}}, or the full path to {{ic|oauth2ms}} if necessary, to the {{ic|IMAPAccount}} section in {{ic|.mbsyncrc}}.&lt;br /&gt;
&lt;br /&gt;
=== Integration with ProtonMail ===&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:Proton Mail|Proton Mail]] solution for interfacing with conventional email clients is for the user to run a local IMAP/SMTP server that will communicate with ProtonMail servers -- it is known as ProtonMail Bridge and available in the {{Pkg|protonmail-bridge-core}} package.&lt;br /&gt;
Note that this software requires a running and working software implementing FreeDesktop.org&#039;s [https://specifications.freedesktop.org/secret-service-spec/latest/ Secret Service API] (&#039;&#039;e.g.&#039;&#039;, [[GNOME Keyring]] or [[Wikipedia:KeePassXC|KeePassXC]]) and [[gpg-agent]].&lt;br /&gt;
&lt;br /&gt;
==== Bridge installation and configuration ====&lt;br /&gt;
&lt;br /&gt;
1. Run the bridge and login using ProtonMail credentials:&lt;br /&gt;
&lt;br /&gt;
    $ protonmail-bridge-core --cli&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; login&lt;br /&gt;
    &amp;gt;&amp;gt;&amp;gt; info&lt;br /&gt;
&lt;br /&gt;
2. To let IMAP clients accessing the local Bridge IMAP server, get the ProtonMail self-signed certificate:&lt;br /&gt;
&lt;br /&gt;
    $ openssl s_client -starttls imap -connect 127.0.0.1:1143 -showcerts&lt;br /&gt;
&lt;br /&gt;
3. Manually copy lines between  {{ic|-----BEGIN CERTIFICATE-----}} and {{ic|-----END CERTIFICATE-----}} and put them inside a file, &#039;&#039;e.g.&#039;&#039;, {{ic|~/.config/protonmail/bridge-v3/cert.pem}}.&lt;br /&gt;
&lt;br /&gt;
4. After checking that everything is working, stop the Bridge from the command-line and run it as a service:&lt;br /&gt;
&lt;br /&gt;
    $ systemctl --user enable --now protonmail-bridge.service&lt;br /&gt;
&lt;br /&gt;
==== Isync configuration for interacting with Bridge ====&lt;br /&gt;
&lt;br /&gt;
Configuring Isync to use ProtonMail Bridge as an IMAP server is possible using the following in your {{ic|~/.mbsyncrc}} configuration.&lt;br /&gt;
The following is a working example in a two-way sync between the local machine the ProtonMail account.&lt;br /&gt;
&lt;br /&gt;
{{Note|In the following, only configuration that is special for ProtonMail will be commented.}} &lt;br /&gt;
{{Tip|The port can be obtained from the CLI interface of the ProtonMail Bridge binary.}} &lt;br /&gt;
{{Tip|In {{ic|Patterns}}, we ignore the {{ic|Labels/*}} directories since this is a directory hierarchy used internally by ProtonMail to store the labels/tags user settings.}} &lt;br /&gt;
{{Warning|In {{ic|Patterns}}, we ignore the {{ic|All Mail/*}} directory since this is a virtual view of all emails created by ProtonMail. As such, if not ignored, the IMAP library of Bridge ([https://github.com/ProtonMail/gluon Gluon]) will throw an [https://github.com/ProtonMail/gluon/issues/426 error about an IMAP CLOSE command] that is not allowed during the {{ic|Expunge}} operation of Isync.}} &lt;br /&gt;
&lt;br /&gt;
    IMAPStore proton-remote&lt;br /&gt;
    Port 1143&lt;br /&gt;
    Host 127.0.0.1&lt;br /&gt;
    User &#039;&#039;YOUR_EMAIL&#039;&#039;&lt;br /&gt;
    PassCmd &#039;&#039;YOUR_PASSWORD&#039;&#039;&lt;br /&gt;
    TLSType STARTTLS&lt;br /&gt;
    CertificateFile &#039;&#039;YOUR_CERTIFICATE_PATH&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    MaildirStore proton-local&lt;br /&gt;
    SubFolders Verbatim&lt;br /&gt;
    Path &#039;&#039;~/PATH/TO/MAILBOX/&#039;&#039;&lt;br /&gt;
    Inbox &#039;&#039;~/PATH/TO/MAILBOX/Inbox&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
    Channel proton&lt;br /&gt;
    Far :proton-remote:&lt;br /&gt;
    Near :proton-local:&lt;br /&gt;
    Patterns * !Labels* !&amp;quot;All Mail&amp;quot;&lt;br /&gt;
    Create Both&lt;br /&gt;
    Expunge Both&lt;br /&gt;
    SyncState *&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== SSL error ===&lt;br /&gt;
&lt;br /&gt;
If you get the following error:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;SSL error connecting imap.gmail.com (108.177.125.109:993): self signed certificate&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Since google enforce SNI when you use TLS 1.3, ensure to run at least isync v1.3.0&lt;br /&gt;
See https://sourceforge.net/p/isync/isync/merge-requests/2/ for more details&lt;br /&gt;
&lt;br /&gt;
If you get certificate related errors like: &lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;SSL error connecting pop.mail.com (193.222.111.111:143): error:00000012:lib(0):func(0):reason(18)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
you may need to retrieve the server&#039;s certificates manually in order for mbsync to correctly verify it.&lt;br /&gt;
&lt;br /&gt;
==== Step #1: Get the certificates ====&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|This may not always be needed, e.g. for gmail {{ic|CertificateFile /etc/ssl/certs/ca-certificates.crt}} in the config file may be suffcient|section=Step #1: Get the certificates}}&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;$ mkdir ~/.cert&lt;br /&gt;
$ openssl s_client -connect some.imap.server:port -showcerts 2&amp;gt;&amp;amp;1 &amp;lt; /dev/null | sed -ne &#039;/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p&#039; | sed -ne &#039;1,/-END CERTIFICATE-/p&#039; &amp;gt; ~/.cert/some.imap.server.pem&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This will create a certificate file called {{ic|~/.cert/some.imap.server.pem}} (e.g. {{ic|~/.cert/imap.gmail.com.pem}}). Alternatively one can download [https://gist.githubusercontent.com/petRUShka/af96ae25ce8280729b9ea049b929f31d/raw/a79471ce8aee3f6d04049039adf870a53a524f7f/get_certs.sh get_certs.sh] and run it:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;$ mkdir ~/.cert&lt;br /&gt;
$ wget https://gist.githubusercontent.com/petRUShka/af96ae25ce8280729b9ea049b929f31d/raw/a79471ce8aee3f6d04049039adf870a53a524f7f/get_certs.sh&lt;br /&gt;
$ sh get_certs.sh some.imap.server port ~/.cert/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
If you wish to do this manually, you may enter:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;$ openssl s_client -connect some.imap.server:port -showcerts&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
and it will display output something like:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;CONNECTED(00000003)&lt;br /&gt;
depth=1 C = US, O = Google Inc, CN = Google Internet Authority&lt;br /&gt;
verify error:num=20:unable to get local issuer certificate&lt;br /&gt;
verify return:0&lt;br /&gt;
---&lt;br /&gt;
Certificate chain&lt;br /&gt;
 0 s:/C=US/ST=California/L=Mountain View/O=Google Inc/CN=imap.gmail.com&lt;br /&gt;
   i:/C=US/O=Google Inc/CN=Google Internet Authority&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIIDgDCCAumgAwIBAgIKO3MmiwAAAABopTANBgkqhkiG9w0BAQUFADBGMQswCQYD&lt;br /&gt;
VQQGEwJVUzETMBEGA1UEChMKR29vZ2xlIEluYzEiMCAGA1UEAxMZR29vZ2xlIElu&lt;br /&gt;
dGVybmV0IEF1dGhvcml0eTAeFw0xMjA5MTIxMTU1NDlaFw0xMzA2MDcxOTQzMjda&lt;br /&gt;
MGgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1N&lt;br /&gt;
b3VudGFpbiBWaWV3MRMwEQYDVQQKEwpHb29nbGUgSW5jMRcwFQYDVQQDEw5pbWFw&lt;br /&gt;
LmdtYWlsLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2OmU9DjI+DFQ&lt;br /&gt;
ThqIN4vL6EqZbzH0ejLKcc+zhxsq9BU5hXohSJ1sS5FUU2vReDKk8fd+ZR3cWtpf&lt;br /&gt;
CTYAUSvdnz1ZFjESSzyUBmGRqByhoc0yqdfb61NosA4CDaO+z7DtAgKyecqnAJad&lt;br /&gt;
TPYYf9aLk/UgJuc6GseitjzFYonXi6ECAwEAAaOCAVEwggFNMB0GA1UdJQQWMBQG&lt;br /&gt;
CCsGAQUFBwMBBggrBgEFBQcDAjAdBgNVHQ4EFgQUFuLyTg2NcsyaEESytZbLbQan&lt;br /&gt;
YIowHwYDVR0jBBgwFoAUv8Aw6/VDET5nup6R+/xq2uNrEiQwWwYDVR0fBFQwUjBQ&lt;br /&gt;
oE6gTIZKaHR0cDovL3d3dy5nc3RhdGljLmNvbS9Hb29nbGVJbnRlcm5ldEF1dGhv&lt;br /&gt;
cml0eS9Hb29nbGVJbnRlcm5ldEF1dGhvcml0eS5jcmwwZgYIKwYBBQUHAQEEWjBY&lt;br /&gt;
MFYGCCsGAQUFBzAChkpodHRwOi8vd3d3LmdzdGF0aWMuY29tL0dvb2dsZUludGVy&lt;br /&gt;
bmV0QXV0aG9yaXR5L0dvb2dsZUludGVybmV0QXV0aG9yaXR5LmNydDAMBgNVHRMB&lt;br /&gt;
Af8EAjAAMBkGA1UdEQQSMBCCDmltYXAuZ21haWwuY29tMA0GCSqGSIb3DQEBBQUA&lt;br /&gt;
A4GBAC1LV7tM6pcyVJLcwdPml4DomtowsjTrqvy5ZFa3SMKANK0iZBgFu74O0THX&lt;br /&gt;
8SxP/vn4eAs0yRQxcT1ZuoishLGQl5NoimLaQ4BGQnzFQHDJendfaVKDl21GenJp&lt;br /&gt;
is72sIrAeprsVU8PbNsllUamWsIjKr3DH5xQdH54hDtzQojY&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
 1 s:/C=US/O=Google Inc/CN=Google Internet Authority&lt;br /&gt;
   i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
-----BEGIN CERTIFICATE-----&lt;br /&gt;
MIICsDCCAhmgAwIBAgIDC2dxMA0GCSqGSIb3DQEBBQUAME4xCzAJBgNVBAYTAlVT&lt;br /&gt;
MRAwDgYDVQQKEwdFcXVpZmF4MS0wKwYDVQQLEyRFcXVpZmF4IFNlY3VyZSBDZXJ0&lt;br /&gt;
aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDkwNjA4MjA0MzI3WhcNMTMwNjA3MTk0MzI3&lt;br /&gt;
WjBGMQswCQYDVQQGEwJVUzETMBEGA1UEChMKR29vZ2xlIEluYzEiMCAGA1UEAxMZ&lt;br /&gt;
R29vZ2xlIEludGVybmV0IEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw&lt;br /&gt;
gYkCgYEAye23pIucV+eEPkB9hPSP0XFjU5nneXQUr0SZMyCSjXvlKAy6rWxJfoNf&lt;br /&gt;
NFlOCnowzdDXxFdF7dWq1nMmzq0yE7jXDx07393cCDaob1FEm8rWIFJztyaHNWrb&lt;br /&gt;
qeXUWaUr/GcZOfqTGBhs3t0lig4zFEfC7wFQeeT9adGnwKziV28CAwEAAaOBozCB&lt;br /&gt;
oDAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFL/AMOv1QxE+Z7qekfv8atrjaxIk&lt;br /&gt;
MB8GA1UdIwQYMBaAFEjmaPkr0rKV10fYIyAQTzOYkJ/UMBIGA1UdEwEB/wQIMAYB&lt;br /&gt;
Af8CAQAwOgYDVR0fBDMwMTAvoC2gK4YpaHR0cDovL2NybC5nZW90cnVzdC5jb20v&lt;br /&gt;
Y3Jscy9zZWN1cmVjYS5jcmwwDQYJKoZIhvcNAQEFBQADgYEAuIojxkiWsRF8YHde&lt;br /&gt;
BZqrocb6ghwYB8TrgbCoZutJqOkM0ymt9e8kTP3kS8p/XmOrmSfLnzYhLLkQYGfN&lt;br /&gt;
0rTw8Ktx5YtaiScRhKqOv5nwnQkhClIZmloJ0pC3+gz4fniisIWvXEyZ2VxVKfml&lt;br /&gt;
UUIuOss4jHg7y/j7lYe8vJD5UDI=&lt;br /&gt;
-----END CERTIFICATE-----&lt;br /&gt;
---&lt;br /&gt;
Server certificate&lt;br /&gt;
subject=/C=US/ST=California/L=Mountain View/O=Google Inc/CN=imap.gmail.com&lt;br /&gt;
issuer=/C=US/O=Google Inc/CN=Google Internet Authority&lt;br /&gt;
---&lt;br /&gt;
No client certificate CA names sent&lt;br /&gt;
---&lt;br /&gt;
SSL handshake has read 2108 bytes and written 350 bytes&lt;br /&gt;
---&lt;br /&gt;
New, TLSv1/SSLv3, Cipher is ECDHE-RSA-RC4-SHA&lt;br /&gt;
Server public key is 1024 bit&lt;br /&gt;
Secure Renegotiation IS supported&lt;br /&gt;
Compression: NONE&lt;br /&gt;
Expansion: NONE&lt;br /&gt;
SSL-Session:&lt;br /&gt;
    Protocol  : TLSv1.1&lt;br /&gt;
    Cipher    : ECDHE-RSA-RC4-SHA&lt;br /&gt;
    Session-ID: 77136647F42633D82DEDFBB9EB62AB516547A3697D83BD1884726034613C1C09&lt;br /&gt;
    Session-ID-ctx: &lt;br /&gt;
    Master-Key: 635957FBA0762B10694560488905F73BDD2DB674C41970542ED079446F27234E2CA51CF26938B8CA56DF5BBC71E429A7&lt;br /&gt;
    Key-Arg   : None&lt;br /&gt;
    PSK identity: None&lt;br /&gt;
    PSK identity hint: None&lt;br /&gt;
    SRP username: None&lt;br /&gt;
    TLS session ticket lifetime hint: 100800 (seconds)&lt;br /&gt;
    TLS session ticket:&lt;br /&gt;
    0000 - d6 5b a0 a7 10 0e 64 04-72 93 7c 9f 94 fa 07 57   .[....d.r.|....W&lt;br /&gt;
    0010 - f1 8b 9d 24 8b 9d 1b f3-a8 b1 4d 2c a9 00 e1 82   ...$......M,....&lt;br /&gt;
    0020 - 00 83 1e 3f e5 f2 b2 2c-d2 a8 87 83 16 02 0d 1e   ...?...,........&lt;br /&gt;
    0030 - bf b6 c1 d6 75 21 04 e6-63 6b ab 5b ed 94 7a 30   ....u!..ck.[..z0&lt;br /&gt;
    0040 - 1a d0 aa 44 c2 04 9b 10-06 28 b5 7b a0 43 a6 0d   ...D.....(.{.C..&lt;br /&gt;
    0050 - 3b 4a 85 1f 2e 07 0a e1-32 9b bd 5d 65 41 4c e2   ;J......2..]eAL.&lt;br /&gt;
    0060 - 7c d7 43 ec c4 18 77 53-b5 d4 84 b4 c9 bd 51 d6   |.C...wS......Q.&lt;br /&gt;
    0070 - 2d 4f 2e 10 a6 ed 38 c5-8e 9d f8 8b 8a 63 3f 7b   -O....8......c?{&lt;br /&gt;
    0080 - ee e6 b8 bf 7a f8 b8 e8-47 92 84 f1 9b 0c 63 30   ....z...G.....c0&lt;br /&gt;
    0090 - 76 d8 e1 44                                       v..D&lt;br /&gt;
&lt;br /&gt;
    Start Time: 1352632558&lt;br /&gt;
    Timeout   : 300 (sec)&lt;br /&gt;
    Verify return code: 20 (unable to get local issuer certificate)&lt;br /&gt;
---&lt;br /&gt;
* OK Gimap ready for requests from 108.78.162.240 o67if11168976yhc.67&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Simply copy the first block that begins with {{ic|-----BEGIN CERTIFICATE-----}} and ends with {{ic|-----END CERTIFICATE-----}}, paste into a file, and save with a .pem extension (this is necessary for the next step). Older instructions state that, with Gmail, both certificate blocks must be saved but on testing this was found to be unnecessary.&lt;br /&gt;
&lt;br /&gt;
Now, copy the root issuer certificate to your local certificate folder. In this example (Gmail), the root issuer is Equifax Secure Certificate Authority. This certificate is included in the {{pkg|ca-certificates}} package.&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;$ cp /usr/share/ca-certificates/mozilla/Equifax_Secure_CA.crt ~/.cert/Equifax_Secure_CA.pem&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Step #2: Setup mbsync ====&lt;br /&gt;
&lt;br /&gt;
Configure mbsync to use that certificate:&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.mbsyncrc|2=&lt;br /&gt;
&amp;lt;nowiki&amp;gt;IMAPAccount gmail&lt;br /&gt;
Host imap.gmail.com&lt;br /&gt;
# ...&lt;br /&gt;
CertificateFile ~/.cert/imap.gmail.com.pem&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== BAD Command with Exchange 2003 ===&lt;br /&gt;
&lt;br /&gt;
When connecting to an MS Exchange 2003 server, there could be problems when using pipelining (i.e. executing multiple imap commands concurrently).  Such an issue could look as follows:&lt;br /&gt;
&lt;br /&gt;
{{hc|mbsync -V exchange|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;gt;&amp;gt;&amp;gt; 9 SELECT &amp;quot;arch&amp;quot;^M&lt;br /&gt;
* 250 EXISTS&lt;br /&gt;
* 0 RECENT&lt;br /&gt;
* FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)&lt;br /&gt;
* OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags&lt;br /&gt;
* OK [UNSEEN 241] Is the first unseen message&lt;br /&gt;
* OK [UIDVALIDITY 4352] UIDVALIDITY value&lt;br /&gt;
9 OK [READ-WRITE] SELECT completed.&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; 10 UID FETCH 1:1000000000 (UID FLAGS)^M&lt;br /&gt;
* 1 FETCH (UID 1 FLAGS (\Seen \Answered))&lt;br /&gt;
* 2 FETCH (UID 2 FLAGS (\Seen \Answered))&lt;br /&gt;
...&lt;br /&gt;
* 249 FETCH (UID 696 FLAGS ())&lt;br /&gt;
* 250 FETCH (UID 697 FLAGS (\Seen))&lt;br /&gt;
10 OK FETCH completed.&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; 11 APPEND &amp;quot;arch&amp;quot; (\Seen) {4878+}^M&lt;br /&gt;
(1 in progress) &amp;gt;&amp;gt;&amp;gt; 12 UID FETCH 697 (BODY.PEEK[])^M&lt;br /&gt;
(2 in progress) &amp;gt;&amp;gt;&amp;gt; 13 UID STORE 696 +FLAGS.SILENT (\Deleted)^M&lt;br /&gt;
12 BAD Command is not valid in this state.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
So command 9 is to select a new folder, command 10 checks the mail and commands 11, 12 and 13 run in parallel, writing/getting/flagging a mail.  In this case, the Exchange server would terminate the connection after the BAD return value and go on to the next channel.  (And if all went well in this channel, mbsync would return with 0.)  After setting&lt;br /&gt;
&lt;br /&gt;
 PipelineDepth 1&lt;br /&gt;
&lt;br /&gt;
in the IMAPStore config part of the Exchange, this problem did not occur any more.&lt;br /&gt;
&lt;br /&gt;
=== Emails on remote server have the wrong date ===&lt;br /&gt;
&lt;br /&gt;
This fix works when syncing with fastmail, but it likely applies to other services as well.&lt;br /&gt;
&lt;br /&gt;
If you move an email to a new folder using an email client, and mbsync causes the email to appear with the wrong date on the server, add this to your configuration file: &lt;br /&gt;
&lt;br /&gt;
 CopyArrivalDate yes&lt;br /&gt;
&lt;br /&gt;
For example, without this setting, moving an old email from Inbox to Archive using mu4e and then&lt;br /&gt;
syncing to fastmail with mbsync will cause the email to appear in Archive but with the date of&lt;br /&gt;
the sync.&lt;br /&gt;
&lt;br /&gt;
mbsync uses mtime of email message when uploading from maildir to imap server. You can use [https://gist.github.com/artizirk/877ce9d30159323aac037e2a2af74509 fix_maildir_mail_mtime.py] script to set mtime from email header.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
*[https://isync.sourceforge.net/ Home page]&lt;br /&gt;
*[https://sourceforge.net/projects/isync/ Sourceforge page]&lt;br /&gt;
*[https://web.archive.org/web/20230830054154/https://kevin.deldycke.com/2012/08/gmail-backup-mbsync/ backing up gmail with mbsync]&lt;br /&gt;
*[https://www.cyberciti.biz/faq/test-ssl-certificates-diagnosis-ssl-certificate/ How To Verify SSL Certificate From A Shell Prompt]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Pass&amp;diff=873531</id>
		<title>Pass</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Pass&amp;diff=873531"/>
		<updated>2026-05-10T14:58:08Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Basic usage */ style fix, add crosslink on first mention&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Lowercase title}}&lt;br /&gt;
[[Category:Password managers]]&lt;br /&gt;
[[Category:Console applications]]&lt;br /&gt;
[[Category:OpenPGP]]&lt;br /&gt;
[[ja:Pass]]&lt;br /&gt;
[[zh-hans:Pass]]&lt;br /&gt;
From [https://www.passwordstore.org/ the official website]:&lt;br /&gt;
&lt;br /&gt;
:Password management should be simple and follow Unix philosophy. With pass, each password lives inside of a gpg encrypted file whose filename is the title of the website or resource that requires the password. These encrypted files may be organized into meaningful folder hierarchies, copied from computer to computer, and, in general, manipulated using standard command line file management utilities.&lt;br /&gt;
&lt;br /&gt;
pass is a simple password manager for the command line. pass is a shell script that makes use of existing tools like [[GnuPG]], {{Pkg|tree}} and [[Git]].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
[[Install]] the {{Pkg|pass}} package.&lt;br /&gt;
&lt;br /&gt;
An optional [[Qt]] GUI is available via the {{Pkg|qtpass}} package.&lt;br /&gt;
&lt;br /&gt;
== Basic usage ==&lt;br /&gt;
&lt;br /&gt;
{{Note|To be able to use &#039;&#039;pass&#039;&#039;, set up [[GnuPG]]. The trust level of the key used for pass must be &amp;quot;ultimate&amp;quot;.}}&lt;br /&gt;
&lt;br /&gt;
To initialize the password store:&lt;br /&gt;
&lt;br /&gt;
 $ pass init &#039;&#039;gpg-id_or_email&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To create a new password, first provide a descriptive hierarchical name. In this example, this is &#039;&#039;archlinux.org/wiki/username&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
 $ pass insert archlinux.org/wiki/username&lt;br /&gt;
&lt;br /&gt;
To get a view of the password store do the following. Note the example output which shows the hierarchy we just created: &lt;br /&gt;
&lt;br /&gt;
{{hc|$ pass|&lt;br /&gt;
Password Store&lt;br /&gt;
└── archlinux.org&lt;br /&gt;
    └── wiki&lt;br /&gt;
        └── username&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To generate a new random password for the above example, do the following, where {{ic|&#039;&#039;n&#039;&#039;}} is the desired password length as a number:&lt;br /&gt;
&lt;br /&gt;
 $ pass generate archlinux.org/wiki/username &#039;&#039;n&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To retrieve a password, enter the gpg passphrase at the following prompt, again using the example name from above:&lt;br /&gt;
&lt;br /&gt;
 $ pass archlinux.org/wiki/username&lt;br /&gt;
&lt;br /&gt;
Users of Xorg with {{Pkg|xclip}} installed can retrieve the password directly onto the clipboard temporarily (e.g., to paste into web forms). In a Wayland session, should use {{Pkg|wl-clipboard}} instead. To do so, do the following (again with the same example hierarchical name from above):&lt;br /&gt;
&lt;br /&gt;
 $ pass -c archlinux.org/wiki/username&lt;br /&gt;
&lt;br /&gt;
{{Note|Users preferring the classical middle-click/paste can add the following to their respective ~/.shellrc for this behavior: {{ic|1=export PASSWORD_STORE_X_SELECTION=primary}}}}&lt;br /&gt;
&lt;br /&gt;
pass comes with a [[dmenu]] wrapper to enable easy searching/copying. To use it, install the optional dependency {{Pkg|dmenu}} and run:&lt;br /&gt;
&lt;br /&gt;
 $ passmenu&lt;br /&gt;
&lt;br /&gt;
Then selecting an entry will copy its password to the clipboard. See {{man|1|dmenu}} for customization options such as case-insensitivity. You may want to set this to a systemwide keybinding in order to easily access passwords from any application.&lt;br /&gt;
&lt;br /&gt;
== Data organization ==&lt;br /&gt;
&lt;br /&gt;
By default, the credential file created with {{ic|pass insert}} will only contain your password. However, it may not be enough since several applications ask for detail data like username, url, etc.&lt;br /&gt;
You can edit an existing file the way you want with command {{ic|pass edit &#039;&#039;password_name&#039;&#039;}}.&lt;br /&gt;
Below is the preferred organizational scheme provided by [https://www.passwordstore.org/ pass-project page]. When using the option {{ic|-c}} or {{ic|--clip}} with this scheme, only the password will be copied.&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
YwrZSNH35z164ym9pI&lt;br /&gt;
URL: *.amazon.com/*&lt;br /&gt;
Username: AmazonianChicken@example.com&lt;br /&gt;
Secret Question 1: What is your childhood best friend&#039;s most bizarre superhero fantasy? Oh god, Amazon, it&#039;s too awful to say...&lt;br /&gt;
Phone Support PIN #: 84719&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Migrating to pass ==&lt;br /&gt;
&lt;br /&gt;
There are multiple scripts listed on the [https://www.zx2c4.com/projects/password-store/ pass-project page] to import passwords from other programs&lt;br /&gt;
&lt;br /&gt;
== Extensions ==&lt;br /&gt;
&lt;br /&gt;
Since version 1.7, pass supports extensions developed by the community. These extensions extend the features of pass with the support of new commands.&lt;br /&gt;
&lt;br /&gt;
* {{App|pass-audit|An extension for auditing a password repository.|https://github.com/roddhjav/pass-audit|{{AUR|pass-audit}}}}&lt;br /&gt;
* {{App|pass-coffin|A password store extension to hide data inside a signed and encrypted coffin|https://github.com/ayushnix/pass-coffin|{{AUR|pass-coffin}}}}&lt;br /&gt;
* {{App|pass-import|A generic importer tool from other password managers.|https://github.com/roddhjav/pass-import|{{AUR|pass-import}}}}&lt;br /&gt;
* {{App|pass-otp|Support for one-time-password (OTP) tokens.|https://github.com/tadfisher/pass-otp|{{Pkg|pass-otp}}}}&lt;br /&gt;
* {{App|pass-phrase|An extension for generating passphrases.|https://github.com/programadoroccidental/pass-phrase|{{AUR|pass-phrase}}}}&lt;br /&gt;
* {{App|pass-tessen|An Xorg/Wayland compatible command line fuzzy selection tool with copy and paste.|https://github.com/ayushnix/pass-tessen|{{AUR|pass-tessen}}}}&lt;br /&gt;
* {{App|pass-tomb|Manage the whole tree of your password store encrypted inside a [[tomb]].|https://github.com/roddhjav/pass-tomb|{{AUR|pass-tomb}}}}&lt;br /&gt;
* {{App|pass-update|An easy flow for updating passwords.|https://github.com/roddhjav/pass-update|{{AUR|pass-update}}}}&lt;br /&gt;
* {{App|passless|A FIDO2 authenticator backend ([[WebAuthn]], CTAP); store and use passkeys with your web browser.|https://github.com/pando85/passless|{{AUR|passless}}}}&lt;br /&gt;
* {{App|tessen|A bash script for Wayland extending compatibility to dmenu type applications such as rofi and fuzzel.|https://github.com/ayushnix/tessen|{{AUR|tessen}}}}&lt;br /&gt;
&lt;br /&gt;
== Advanced usage ==&lt;br /&gt;
&lt;br /&gt;
[[Environment variables]] can be used to alter where &#039;&#039;pass&#039;&#039; looks to do store and git operations via:&lt;br /&gt;
 PASSWORD_STORE_DIR=/path/to/store&lt;br /&gt;
&lt;br /&gt;
For more information on how this can be used to support multiple pass repositories see [https://lists.zx2c4.com/pipermail/password-store/2016-November/002463.html this link].&lt;br /&gt;
The following {{ic|pw()}} example alias sends the second line of the named database to the clipboard before sending the first line five seconds thereafter and finally an OTP code five seconds after that. Assuming that a password occupies the first line and a username the second line and an [https://github.com/google/google-authenticator/wiki/Key-Uri-Format OTP URI] exists anywhere in the named database, the net effect is passing &#039;&#039;username &amp;gt; password &amp;gt; otp code&#039;&#039; for consecutive primary pasting into available (e.g. browser) entry fields:&lt;br /&gt;
 &lt;br /&gt;
 pw() {&lt;br /&gt;
 export PASSWORD_STORE_CLIP_TIME=8&lt;br /&gt;
 export PASSWORD_STORE_X_SELECTION=primary&lt;br /&gt;
 pass -c2 $1; sleep 5; pass -c $1; sleep 5; pass otp -c $1; exit&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Multiple pass contexts (e.g. teaming) ==&lt;br /&gt;
&lt;br /&gt;
One can use aliases to set up different pass contexts, which helps when collaborating with different teams. We have gotten this working in bash as follows:&lt;br /&gt;
&lt;br /&gt;
Add aliases to your [[Command-line shell#Configuration files|shell configuration file]]:&lt;br /&gt;
&lt;br /&gt;
 alias passred=&amp;quot;PASSWORD_STORE_DIR=~/.pass/red pass&amp;quot;&lt;br /&gt;
 alias passblue=&amp;quot;PASSWORD_STORE_DIR=~/.pass/blue pass&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If using bash, add these for bash-completion to your {{ic|~/.bash_completion}} and make sure {{Pkg|bash-completion}} is installed:&lt;br /&gt;
&lt;br /&gt;
 source /usr/share/bash-completion/completions/pass&lt;br /&gt;
 _passred(){&lt;br /&gt;
     PASSWORD_STORE_DIR=~/.pass/red/ _pass&lt;br /&gt;
 }&lt;br /&gt;
 complete -o filenames -o nospace -F _passred passred&lt;br /&gt;
 _passblue(){&lt;br /&gt;
     PASSWORD_STORE_DIR=~/.pass/blue/ _pass&lt;br /&gt;
 }&lt;br /&gt;
 complete -o filenames -o nospace -F _passblue passblue&lt;br /&gt;
&lt;br /&gt;
Or for zsh (source: {{ic|/usr/share/zsh/site-functions/_pass}})&lt;br /&gt;
&lt;br /&gt;
 compdef _pass passred&lt;br /&gt;
 zstyle &#039;:completion::complete:passred::&#039; prefix &amp;quot;$HOME/.pass/red&amp;quot;&lt;br /&gt;
 passred() {&lt;br /&gt;
   PASSWORD_STORE_DIR=$HOME/.pass/red pass $@&lt;br /&gt;
 }&lt;br /&gt;
 compdef _pass passblue&lt;br /&gt;
 zstyle &#039;:completion::complete:passblue::&#039; prefix &amp;quot;$HOME/.pass/blue&amp;quot;&lt;br /&gt;
 passblue() {&lt;br /&gt;
   PASSWORD_STORE_DIR=$HOME/.pass/blue pass $@&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Now you can initialize into {{ic|&#039;&#039;~/.pass/red&#039;&#039;}} and {{ic|&#039;&#039;~/.pass/blue&#039;&#039;}} and have two pass contexts with the {{ic|&#039;&#039;passred&#039;&#039;}} and {{ic|&#039;&#039;passblue&#039;&#039;}} aliases. You can generalize this further into as many contexts as you like.&lt;br /&gt;
&lt;br /&gt;
== Git integration ==&lt;br /&gt;
&lt;br /&gt;
=== Git helper usage ===&lt;br /&gt;
&lt;br /&gt;
You can use {{ic|pass}} as a credentials helper for {{ic|git}}. [[Install]] the {{Aur|pass-git-helper}}.&lt;br /&gt;
Details are described in the [https://github.com/languitar/pass-git-helper github README file].&lt;br /&gt;
&lt;br /&gt;
==== git configuration ====&lt;br /&gt;
&lt;br /&gt;
Configure {{ic|pass-git-helper}} as a git credentials helper by calling:&lt;br /&gt;
 $ git config --global credential.helper /usr/bin/pass-git-helper&lt;br /&gt;
&lt;br /&gt;
==== Mapping file ====&lt;br /&gt;
&lt;br /&gt;
Create the file {{ic|~/.config/pass-git-helper/git-pass-mapping.ini}}. It is used to map git remote hosts to your {{ic|pass}} database. The format is something like this:&lt;br /&gt;
&lt;br /&gt;
{{bc|code=[github.com]&lt;br /&gt;
target=dev/github&lt;br /&gt;
&lt;br /&gt;
[*.fooo-bar.*]&lt;br /&gt;
target=dev/fooo-bar&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can use wildcards in the host part, as shown in the example.&lt;br /&gt;
&lt;br /&gt;
==== Password store layout ====&lt;br /&gt;
&lt;br /&gt;
As usual with pass, the helper assumes that the password is contained in the first line of the passwordstore entry.&lt;br /&gt;
Additionally, if a second line is present, this line is interpreted as the username.&lt;br /&gt;
&lt;br /&gt;
For this to work, you have to use {{ic|pass insert --multiline}} to create a multi line password store entry.&lt;br /&gt;
&lt;br /&gt;
=== Central Git server for pass in combination with GnuPG (SSH example) ===&lt;br /&gt;
&lt;br /&gt;
You are able to setup a password management system by setting up a central Git server for pass. This allows you to synchronize your central password repository through multiple client environments.&lt;br /&gt;
&lt;br /&gt;
==== Install a bare Git repository for pass on the server ====&lt;br /&gt;
&lt;br /&gt;
On the server run {{ic|git init --bare ~/.password-store}} to create a bare repository you can push to.&lt;br /&gt;
&lt;br /&gt;
==== Import authorized public SSH keys ====&lt;br /&gt;
&lt;br /&gt;
See [[SSH keys#Copying the public key to the remote server]]&lt;br /&gt;
&lt;br /&gt;
==== On the client ====&lt;br /&gt;
&lt;br /&gt;
This section assumes you have configured GnuPG and have a key pair to encrypt passwords. &lt;br /&gt;
On your local client ensure you have a local password store on the client, then enable management of local changes through Git, add your remote Git repository, and push your local pass history.&lt;br /&gt;
&lt;br /&gt;
Create a local password store: &lt;br /&gt;
&lt;br /&gt;
 $ pass init &#039;&#039;gpg_key_id&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Enable management of local changes through Git: &lt;br /&gt;
&lt;br /&gt;
 $ pass git init&lt;br /&gt;
&lt;br /&gt;
Add the remote git repository as &#039;origin&#039;: &lt;br /&gt;
&lt;br /&gt;
 $ pass git remote add origin user@server:~/.password-store&lt;br /&gt;
&lt;br /&gt;
Push your local pass history: &lt;br /&gt;
&lt;br /&gt;
 $ pass git push -u --all&lt;br /&gt;
&lt;br /&gt;
Now you can use the standard Git commands, prefixed by {{ic|pass}}. For example: {{ic|pass git push}}, or {{ic|pass git pull}}. pass will automatically create commits when you use it to modify your password store.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== Encryption failed: Unusable public key ===&lt;br /&gt;
&lt;br /&gt;
The following error can occur when attempting to insert a new entry:&lt;br /&gt;
&lt;br /&gt;
{{hc|$ pass insert archlinux.org/wiki/username|&lt;br /&gt;
Enter password for archlinux.org/wiki/username:&lt;br /&gt;
Retype password for archlinux.org/wiki/username:&lt;br /&gt;
gpg: XXXXXXXXX: There is no assurance this key belongs to the named user&lt;br /&gt;
gpg: [stdin]: encryption failed: Unusable public key&lt;br /&gt;
Password encryption aborted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This occurs if the trust level of the GnuPG key is set to anything other than &amp;quot;ultimate&amp;quot;. Edit the key used for {{ic|pass}} to set its trust level to &amp;quot;ultimate&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
{{hc|$ gpg --edit-key &#039;&#039;your_key_id&#039;&#039;|&lt;br /&gt;
&amp;gt; trust&lt;br /&gt;
&amp;gt; 5&lt;br /&gt;
}}&lt;br /&gt;
=== Secret key expired ===&lt;br /&gt;
&lt;br /&gt;
The following error can occur when your GPG key expires (e.g., after a year) and you try to add a new password:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
gpg: Note: secret key 0xAAAABBBBCCCCDDEE expired at Thu 09 Jan 2020 01:15:15 PM UTC&lt;br /&gt;
gpg: AAAABBBBCCCCDDEE: skipped: Unusable public key&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To fix this, either [[GnuPG#Extending expiration date|extend the current GPG key&#039;s expiration date]] or switch to a new one (i.e., key rotation).&lt;br /&gt;
&lt;br /&gt;
To switch to a new key and re-encrypt the store:&lt;br /&gt;
&lt;br /&gt;
 $ pass init &#039;&#039;new_gpg-id_or_email&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://web.archive.org/web/20230527122558/https://blog.sanctum.geek.nz/gnu-linux-crypto-passwords/ A more comprehensive pass tutorial]&lt;br /&gt;
* [https://www.passwordstore.org/ pass home page]&lt;br /&gt;
* [https://www.passwordstore.org/#other List of Compatible clients and possibilities for migration to pass]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Electron_package_guidelines&amp;diff=873530</id>
		<title>Electron package guidelines</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Electron_package_guidelines&amp;diff=873530"/>
		<updated>2026-05-10T14:41:31Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Using electron-builder with system electron */ move disjunct accuracy template up over command, add question and link to talk item (I suppose both are discussing the same topic)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Arch package guidelines]]&lt;br /&gt;
[[ja:Electron パッケージガイドライン]]&lt;br /&gt;
[[pt:Electron package guidelines]]&lt;br /&gt;
{{Package guidelines}}&lt;br /&gt;
&lt;br /&gt;
This document covers standards and guidelines on writing [[PKGBUILD]]s for [[Electron]].&lt;br /&gt;
&lt;br /&gt;
== Using the system electron ==&lt;br /&gt;
&lt;br /&gt;
Arch Linux provides versioned [https://archlinux.org/packages/?q=electron electron*] packages and an {{Pkg|electron}} metapackage for the latest version. They can be used to run an electron application via a shell script wrapper:&lt;br /&gt;
&lt;br /&gt;
{{bc|#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
exec /usr/bin/electron34 /path/to/&#039;&#039;appname&#039;&#039;/ &amp;quot;$@&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
The {{ic|&#039;&#039;appname&#039;&#039;/}} directory, or alternatively a file bundle called {{ic|&#039;&#039;appname&#039;&#039;.asar}}, can be found in a prebuilt electron application as the {{ic|resources/app/}} folder (or {{ic|resources/app.asar}}). Everything else is just a copy of the electron runtime and can be removed from the final package.&lt;br /&gt;
&lt;br /&gt;
{{Note|Applications that require {{ic|1=ELECTRON_RUN_AS_NODE=1}}, e.g. [[Visual Studio Code]], cannot use {{ic|/usr/bin/electron*}}. See [https://gitlab.archlinux.org/archlinux/packaging/packages/code code.sh].}}&lt;br /&gt;
&lt;br /&gt;
=== Editing version on package.json ===&lt;br /&gt;
&lt;br /&gt;
It is dangerous to edit version of Electron in {{ic|package.json}} or {{ic|package-lock.json}} using {{ic|sed}}. You can use {{ic|1=npm pkg set devDependencies.electron=$(cat /usr/lib/electron*/version)}} instead.&lt;br /&gt;
{{Accuracy|Editing package.json may not needed and unrelated to building modules correctly.}}&lt;br /&gt;
&lt;br /&gt;
=== Building compiled extensions against the system electron ===&lt;br /&gt;
&lt;br /&gt;
Some electron applications have compiled native extensions which link to the electron runtime, and must be built using the correct electron version. Since npm/yarn will always build against a private prebuilt copy of electron, patch the electron dependency from {{ic|package.json}} to reference the same version as the system electron dependency. The build system will download the prebuilt copy it requires, compile the native extensions, and package everything into a final distribution, but this can be pruned during the {{ic|package()}} step as usual.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can remove the electron dependency from {{ic|package.json}} and set the correct environment variables before running npm:&lt;br /&gt;
&lt;br /&gt;
 export npm_config_target=$(tail /usr/lib/electron/version)&lt;br /&gt;
 export npm_config_arch=x64&lt;br /&gt;
 export npm_config_target_arch=x64&lt;br /&gt;
 export npm_config_disturl=https://electronjs.org/headers{{Dead link|2023|10|29|status=404}}&lt;br /&gt;
 export npm_config_runtime=electron&lt;br /&gt;
 export npm_config_build_from_source=true&lt;br /&gt;
 HOME=&amp;quot;$srcdir/.electron-gyp&amp;quot; npm install&lt;br /&gt;
&lt;br /&gt;
Set {{ic|HOME}} to a path inside the {{ic|$srcdir}} so the build process does not place any files in your real {{ic|HOME}} directory. Make sure to adjust the path for all further commands that make use of the {{ic|.electron-gyp}} cache.&lt;br /&gt;
&lt;br /&gt;
(more details [https://www.electronjs.org/docs/latest/tutorial/using-native-node-modules#using-npm in Electron docs]).&lt;br /&gt;
&lt;br /&gt;
=== Using electron-builder with system electron ===&lt;br /&gt;
&lt;br /&gt;
Many projects use &#039;&#039;&#039;electron-builder&#039;&#039;&#039; to build and package the Javascript file and Electron binaries. By default electron-builder downloads the entire electron version that is defined in the package management file (e.g. {{ic|package.json}}). This might not be desired if you want to use the system electron and save the bandwidth since you are going to throw away the electron binaries anyway. The electron-builder provides the configurations {{ic|electronDist}} and {{ic|electronVersion}}, to specify a custom path of Electron and the version the application is packaged for respectively.&lt;br /&gt;
&lt;br /&gt;
Find the electron-builder configuration file (e.g. {{ic|electron-builder.json}}) and add the following settings:&lt;br /&gt;
&lt;br /&gt;
* {{ic|electronDist}} to　{{ic|/usr/lib/electron34}} for {{Pkg|electron34}}&lt;br /&gt;
* {{ic|electronVersion}} to the contents of {{ic|/usr/lib/electron34/version}} (without the leading {{ic|v}} if exists)&lt;br /&gt;
&lt;br /&gt;
Packages that apply this: {{AUR|rocketchat-desktop}} {{AUR|ubports-installer-git}}&lt;br /&gt;
&lt;br /&gt;
[https://www.electron.build/configuration#electrondist electron-builder configuration]&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|Current setting still copies Electron from $electronDist. It is expired to add the method to stop it. Does the command work?|section=Using electron-builder with system electron}}&lt;br /&gt;
&lt;br /&gt;
Alternatively you can use the CLI to change/add these settings like this:&lt;br /&gt;
&lt;br /&gt;
 ./node_modules/.bin/electron-builder --linux --x64 --dir $dist -c.electronDist=$electronDist -c.electronVersion=$electronVer&lt;br /&gt;
&lt;br /&gt;
Note that you have to specify all these options or it will not work.&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|Packaging with Arch&#039;s Electron discards fuses bits [https://www.electronjs.org/docs/latest/tutorial/fuses] flipped by electron-builder. Some bits should be emulated by including environment variables to launcher.}}&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
See [[PKGBUILD#arch]].&lt;br /&gt;
&lt;br /&gt;
An Electron package that contains compiled native extensions is architecture-dependent. Otherwise it is most likely architecture-independent.&lt;br /&gt;
&lt;br /&gt;
If the package contains a prebuilt copy of electron, it is always architecture-dependent.&lt;br /&gt;
&lt;br /&gt;
== Directory structure ==&lt;br /&gt;
&lt;br /&gt;
If the package is architecture-dependent, install the {{ic|resources/app/}} directory to {{ic|/usr/lib/&#039;&#039;appname&#039;&#039;/}}. Otherwise use {{ic|/usr/share/&#039;&#039;appname&#039;&#039;/}}.&lt;br /&gt;
&lt;br /&gt;
If the package contains a prebuilt copy of electron, copy the final distribution in its entirety to {{ic|/opt/&#039;&#039;appname&#039;&#039;}}.&lt;br /&gt;
&lt;br /&gt;
== Getting version of Electron ==&lt;br /&gt;
&lt;br /&gt;
Version of Electron could be given by {{ic|npm pkg get devDependencies.electron}} in the directory containing {{ic|package.json}} or {{ic|package-lock.json}}.&lt;br /&gt;
&lt;br /&gt;
Prebuild or [[Nonfree applications package guidelines|Nonfree]] application hides version of electron from {{ic|package.json}}, {{ic|package-lock.json}}, and {{ic|version}} files. In such case, you may get version by replacing {{ic|app}} or {{ic|app.asar}} with {{ic|/usr/lib/electron/resources/default_app.asar}} and running {{ic|&#039;&#039;pathto/electron-binary&#039;&#039; --version}}.&lt;br /&gt;
{{Note|Avoid doing it at PKGBUILD. This should be last resort to make packages with system-wide electron.}}&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Talk:Pacman/Tips_and_tricks&amp;diff=873437</id>
		<title>Talk:Pacman/Tips and tricks</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Talk:Pacman/Tips_and_tricks&amp;diff=873437"/>
		<updated>2026-05-09T15:16:25Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* pacman cache */ re, close&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Leading slash ==&lt;br /&gt;
&lt;br /&gt;
[[Pacman/Tips_and_tricks#aria2]] doesn&#039;t work without leading slash, i.e. {{ic|-d /}} turning file names to {{ic|//var/cache/...}}. The article mentions this, but it doesn&#039;t mention why. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 05:28, 16 October 2015 (UTC)&lt;br /&gt;
&lt;br /&gt;
:You would have to go [https://wiki.archlinux.org/index.php?title=Improve_pacman_performance&amp;amp;diff=32104&amp;amp;oldid=30674 way] [https://wiki.archlinux.org/index.php?title=Improve_pacman_performance&amp;amp;diff=next&amp;amp;oldid=115292 back] to track this. It seems to have worked without {{ic|-d /}} even in 2006: [https://wiki.archlinux.org/index.php?title=Faster_Pacman_Downloads&amp;amp;oldid=15627], [https://wiki.archlinux.org/index.php?title=Improve_pacman_performance&amp;amp;oldid=17759]. &amp;lt;s&amp;gt;I guess that simply nobody asked the right question...&amp;lt;/s&amp;gt; -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 12:30, 16 October 2015 (UTC)&lt;br /&gt;
:Oops, it does &#039;&#039;not&#039;&#039; work without {{ic|-d /}}. Then the problem must be on aria&#039;s side, which expects a file name for the {{ic|-o}} option, which is then catenated with {{ic|-d}} into the full path. Assuming that {{ic|-d}} defaults to the cwd, {{ic|/var/cache/}} would appear twice in the result. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 12:43, 16 October 2015 (UTC)&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;s&amp;gt;pacman cache&amp;lt;/s&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
I still think we should warn people not to symlink /var or anything under it. It leaves the whole system unusable because if the cache disappears during a pacman transaction, you&#039;re left with missing /usr/lib libraries, and nothing works, including pacman itself. This is a serious enough problem that it can take hours to figure out how to recover. If the wiki had mentioned this problem it would have saved me a lot of time and effort, and I&#039;m not the only one who has run in to this. It is not, however, considered a bug. See https://bugs.archlinux.org/task/50298. [[User:JimRees|JimRees]] ([[User talk:JimRees|talk]]) 23:15, 29 April 2017 (UTC)&lt;br /&gt;
&lt;br /&gt;
:This revisions says that: [https://wiki.archlinux.org/index.php?title=Pacman%2FTips_and_tricks&amp;amp;type=revision&amp;amp;diff=475454&amp;amp;oldid=475438]. But to make it more clear: [https://wiki.archlinux.org/index.php?title=Pacman%2FTips_and_tricks&amp;amp;type=revision&amp;amp;diff=475492&amp;amp;oldid=475482]  -- [[User:Rdeckard|Rdeckard]] ([[User_talk:Rdeckard|talk]]) 00:13, 30 April 2017 (UTC)&lt;br /&gt;
&lt;br /&gt;
::Actually, I undid my change since I think that first change is more accurate (mentioning {{ic|/var/cache/pacman/pkg}} and ancestors), so I went back to that but explicitly mentioned {{ic|/var}} as an example.  -- [[User:Rdeckard|Rdeckard]] ([[User_talk:Rdeckard|talk]]) 01:11, 30 April 2017 (UTC)&lt;br /&gt;
&lt;br /&gt;
: Thanks for the background information. I was not aware of the bug report and now clearly understand why you altered the section the way you did. I hope the [https://wiki.archlinux.org/index.php?title=Pacman/Tips_and_tricks&amp;amp;diff=475548&amp;amp;oldid=475495 recent change] is sufficient for you. Since every misbehaving program might leave a system unbootable if it plays a role in the boot process, it should be unnecessary to add this redundant information. However the problem you described is still severe and I hope you agree that the recent edits made to the article do the topic justice. Thanks for clarifying the topic and adding this to the article and sorry for reverting your edits at first. -- [[User:Edh|Edh]] ([[User talk:Edh|talk]]) 21:07, 30 April 2017 (UTC)&lt;br /&gt;
&lt;br /&gt;
:: The section was moved to [[Package proxy cache]]. Recently the bug was closed. I adjusted above with [https://wiki.archlinux.org/index.php?title=Package_proxy_cache&amp;amp;diff=873435&amp;amp;oldid=871111] and close this item. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 15:15, 9 May 2026 (UTC)&lt;br /&gt;
&lt;br /&gt;
== local repository database extension/compression recomendation ==&lt;br /&gt;
&lt;br /&gt;
If you opt to not compress a pacman database, the files database can become very large, 10x larger than a gzipped one in my case, which cause issues when trying to update the local pacman files db (pacman -Fy) since apparently there is a max (expected) size. Should we include a warning about uncompressed databases?&lt;br /&gt;
&lt;br /&gt;
{{unsigned|00:35, 29 January 2019‎|JoshH100}}&lt;br /&gt;
&lt;br /&gt;
== Use a new nginx.conf for [[Pacman/Tips_and_tricks#Dynamic_reverse_proxy_cache_using_nginx|Dynamic reverse proxy cache using nginx]] ==&lt;br /&gt;
&lt;br /&gt;
I propose to replace the [https://gist.github.com/anonymous/97ec4148f643de925e433bed3dc7ee7d current nginx.conf] with an [https://github.com/nastasie-octavian/nginx_pacman_cache_config/blob/master/nginx.conf improved nginx.conf] and update the section. The new config doesn&#039;t make the upstream servers directly available on the network and it allows having mirrors with different relative paths to package files. It also removes directives that are not needed and has some other minor cleanups. I&#039;ve been using a similar config for a few months now without any problems, so I believe it should be fine. [[User:Noctavian|Noctavian]] ([[User talk:Noctavian|talk]]) 16:05, 28 February 2019 (UTC)&lt;br /&gt;
&lt;br /&gt;
:What do you mean by &amp;quot;The new config doesn&#039;t make the upstream servers directly available on the network&amp;quot;? -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 20:54, 28 February 2019 (UTC)&lt;br /&gt;
&lt;br /&gt;
:: In the new config the server blocks for the upstream mirrors are set to listen to 127.0.0.1:800X. Only the computer that is running the nginx cache can send requests to 127.0.0.1. Other computers on the network can&#039;t. The current config exposes the upstream mirrors to the network, a nmap scan will show the 8080 port of the cache as open and the ports 8001, 8002, 8003 of the upstream mirrors as open. One can browse to cache.domain.example:8002 and have direct access to whatever package mirror website is used by the cache bypassing the cache config order and locations. The upstream mirrors don&#039;t need to be available to the entire network for the cache to work; they only need to be available to the computer that is hosting the nginx cache. I believe ports should not be left open on the network if they don&#039;t have to be open. [[User:Noctavian|Noctavian]] ([[User talk:Noctavian|talk]]) 08:37, 1 March 2019 (UTC)&lt;br /&gt;
&lt;br /&gt;
: I have written a draft for the section update on my [[User:Noctavian|user page]]. I made some small changes to the config file since last week, added comments and mirror examples and turned off IPv6 address resolution to prevent some errors that can happen sometimes. Suggestions.are welcome. I haven&#039;t seen objections to my proposal, so I&#039;m going to wait a few more days for feedback and then update the section on the main page with my draft and the new nginx.conf file if that&#039;s ok. [[User:Noctavian|Noctavian]] ([[User talk:Noctavian|talk]]) 11:43, 8 March 2019 (UTC)&lt;br /&gt;
&lt;br /&gt;
::Feel free to go ahead. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 17:11, 16 March 2019 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Remove uninstalled packages from the cache with paccache ==&lt;br /&gt;
&lt;br /&gt;
Just figured the following out, noting here since I&#039;m not sure it&#039;s worth noting in the page itself: {{ic|paccache}} won&#039;t remove uninstalled packages, even with {{ic|-u}}, unless {{ic|-k}} is given a value lower than the number of instances in cache. In particular, oneshot AUR experiments won&#039;t be removed without {{ic|-k0}}.&lt;br /&gt;
[[User:Gesh|Gesh]] ([[User talk:Gesh|talk]]) 01:23, 1 November 2021 (UTC)&lt;br /&gt;
&lt;br /&gt;
:The {{ic|-u}} flag just adds all installed packages to the blacklist. So to remove uninstalled packages from the cache and nothing else, use {{ic|-uk0}}. — [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 06:28, 1 November 2021 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Additional options needed for mounting overlay of remote pacman pkg cache ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;The factual accuracy of this article or section is disputed. Reason: Why is -o index=off -o metacopy=off needed? Is -o redirect_dir=off needed only for this use-case? If not, it should be explained on the overlay filesystem page too.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
My reply:  I&#039;m not an expert on use of sshfs for mounting remote filesystems.  To me, using sshfs is much simpler than going to all the trouble of setting up the chosen box to serve up {{ic|/var/cache/pacman/pkg}} over, e.g., NFS.  I wonder if using fuse.sshfs leads to this problem?  That being said, my setup is bog standard, all boxes using &#039;&#039;linux&#039;&#039; kernel from Arch, connected to the same LAN switch with normal IPv4 addressing, e.g., 192.168.1.100, and so on.&lt;br /&gt;
&lt;br /&gt;
Without using any additional options the problem I encounter is an unusual but familiar one, namely:&lt;br /&gt;
 $ ls /tmp/pacman_pkg/ &amp;gt; /dev/null&lt;br /&gt;
 ls: reading directory &#039;/tmp/pacman_pkg/&#039;: Stale file handle&lt;br /&gt;
&lt;br /&gt;
This is obviously unworkable.  The minimal options I am able to succeed with are: {{ic|1=-o redirect_dir=off -o index=off}}.  Prior to the 5.17 kernel series, I needed {{ic|1=-o index=off -o metacopy=off}} but in my use something then changed which requires {{ic|1=-o redirect_dir=off}} (and {{ic|1=-o metacopy=off}} now comes along for free).  Without these options... &amp;quot;Stale file handle&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
I am eliminating additional options from the generic commands even though I expect that anyone who tries to run them as listed will fail due to the file handle reporting as stale.  I will add a tip note suggesting these options if problems are encountered.  HTH :) [[User:Cmsigler|Cmsigler]] ([[User talk:Cmsigler|talk]]) 16:21, 27 April 2022 (UTC)&lt;br /&gt;
&lt;br /&gt;
:I&#039;m not super familiar with sshfs, but this looks good to me! Thanks for addressing the accuracy template ^^ [[User:CodingKoopa|CodingKoopa]] ([[User talk:CodingKoopa|talk]]) 06:48, 2 May 2022 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Is PackageKit still not recommended to use in 2022? ==&lt;br /&gt;
&lt;br /&gt;
In [[Pacman/Tips_and_tricks#Graphical]], a warning says that PackageKit opens up system permissions by default and thus is not recommended to use. However, that warning was added back in 2018 and it links bug reports from 2016. I&#039;m wondering if it&#039;s still valid in 2022? Also, as far as I know, PackageKit only allowed users from the wheel group to perform updates (kind of similar to what sudo does).&lt;br /&gt;
&lt;br /&gt;
Is this still the case nowadays? If so, are there any other warnings one should know of before using PackageKit? I&#039;m thinking partial upgrades, but I&#039;m not sure. [[User:Cont999|Cont999]] ([[User talk:Cont999|talk]]) 03:54, 3 September 2022 (UTC)&lt;br /&gt;
&lt;br /&gt;
: sudo pacman requires a password, whereas PackageKit doesn&#039;t, so they are really not equivalent. I believe PackageKit can also update the system even if the user is not in the wheel group. I haven&#039;t looked upstream, but this is how the software is designed to work because it fits the way other distributions configure things. In Fedora, for example, you do not need to authenticate to install updates to the system. Updates can also run without user intervention. These practices are dangerous on Arch. Unattended updates aren&#039;t supported and attended ones require you to read the output and the News. So the problems using PackageKit on Arch are not going to be resolved unless changes are made locally, but there&#039;s not much motivation to do that as Arch users are expected to be able to use pacman. That is, the bugs on Arch aren&#039;t bugs elsewhere, so upstream is unlikely to fix them (and break how stuff works elsewhere); the bugs are more easily avoided on Arch by not using PackageKit. At least, that would be my understanding. --[[User:Margali|cfr]] ([[User talk:Margali|talk]]) 01:11, 13 December 2022 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Why do I have this package? ==&lt;br /&gt;
&lt;br /&gt;
I occasionally wonder why a certain &amp;lt;code&amp;gt;PACKAGE&amp;lt;/code&amp;gt; is installed. I used to browse &amp;lt;code&amp;gt;pactree -r PACKAGE&amp;lt;/code&amp;gt; to answer this question, but I recently figured that you can just do &amp;lt;code&amp;gt;pacman -Qe `pactree -ruo PACKAGE`&amp;lt;/code&amp;gt; to list all explicitly installed packages that directly or indirectly depend on &amp;lt;code&amp;gt;PACKAGE&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
I would&#039;ve added a section to the article but I&#039;m not sure if this is useful for anyone but me. [[User:Rumsbums|Rumsbums]] ([[User talk:Rumsbums|talk]]) 07:58, 21 January 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;blockquote&amp;gt;to list all explicitly installed packages that directly or indirectly depend on &amp;lt;code&amp;gt;PACKAGE&amp;lt;/code&amp;gt;.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
:The question is, why do you want to know that in the first place? What purpose such information can serve?&lt;br /&gt;
:If you have some &#039;&#039;&#039;explicit&#039;&#039;&#039; package you don&#039;t need, just uninstall it. If it is required by something else, pacman won&#039;t let you uninstall it anyway. In which case you can simply mark it as non-explicit ({{ic|pacman -D --asdeps PACKAGE}}).&lt;br /&gt;
:Also this maybe a bit obvious, but you should &#039;&#039;&#039;not&#039;&#039;&#039; uninstall {{Pkg|base}} metapackage of course. It is a special case and core of the proper Arch installation.&lt;br /&gt;
:[[User:Hanabishi|Hanabishi]] ([[User talk:Hanabishi|talk]]) 08:17, 21 January 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
::To add to this, you can run {{ic|pacman -Rsc --print &#039;&#039;package&#039;&#039;}} to see what would have been removed. — [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 14:07, 21 January 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
== A CacheServer which is using the database files ==&lt;br /&gt;
&lt;br /&gt;
In the past, there was a tip about [[Special:Diff/810046|a CacheServer that does use the database files]]. I find it useful, for example when the admin would like to have all his machines refers to exactly the same database files. My edit to get it back [[Special:Diff/818026|was rejected]]. A solution might be to divide [[Pacman/Tips and tricks#Network shared pacman cache]] into two sections. One section will discuss a CacheServer which is using the database files. The other section will discuss a CacheServer which does not use database files. Any opinions? [[User:Regid|Regid]] ([[User talk:Regid|talk]]) 07:59, 10 October 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
:A {{ic|CacheServer}} in pacman &#039;&#039;does not&#039;&#039; use database files, please don&#039;t call your solution like that. — [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 06:54, 12 October 2024 (UTC)&lt;br /&gt;
::In the context of the suggestion for the clients to have a {{ic|CacheServer}} statement in their {{ic|/etc/pacman.conf}}, is the following acceptable?&lt;br /&gt;
{{Note|if you want to force the clients to use only packages from the cache server, you can &lt;br /&gt;
 # ln -s /var/lib/pacman/sync/*.db /var/cache/pacman/pkg/&lt;br /&gt;
in the server, and use the common&lt;br /&gt;
{{hc|/etc/pacman.conf|2=&lt;br /&gt;
Server = http://&#039;&#039;server-ip&#039;&#039;:&#039;&#039;port&#039;&#039;}}&lt;br /&gt;
statement for each client.}} [[User:Regid|Regid]] ([[User talk:Regid|talk]]) 12:25, 12 October 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
:::No, if you use {{ic|Server}}, it is not a &#039;&#039;cache&#039;&#039; server. In your use case, the clients will not be able to download packages missing on the cache server and if you add another {{ic|Server}} directive for that purpose, you won&#039;t get exactly the same packages served by both servers (if your &amp;quot;cache&amp;quot; server becomes outdated, the other mirror will purge its old packages in the mean time).&lt;br /&gt;
:::I really doubt that this tip is worth mentioning on the page.&lt;br /&gt;
:::— [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 12:50, 12 October 2024 (UTC)&lt;br /&gt;
::::It would be a cache for the packages the cache server has. The intention is the client will not be able to download packages that the cache server admin has not approved. He will not add another {{ic|Server}} directive to the clients. Quoting [[Package proxy cache]]:&lt;br /&gt;
:::::If you want to install the same Arch packages over and over - e.g. for testing purposes - it could help if you would not have to get the packages every time from the internet.&lt;br /&gt;
::::Or someone might want to have a group of machines with exactly the same set of packages. And the [[Special:Diff/810046|original tip]] was here for a long time. I find that tip useful.&lt;br /&gt;
::::{{unsigned|17:26, 12 October 2024 (UTC)|Regid}}&lt;br /&gt;
:::::The original intention was not to forbid downloading packages that are not already in the cache. It said to &#039;&#039;add&#039;&#039; {{ic|Server}} at the top of the mirrorlist, not to use it as the only entry. This solution had the exact issue that I described, which is solved by using {{ic|CacheServer}} since pacman 6.1.0. Your quote from [[Package proxy cache]] is just a definition of a &#039;&#039;cache server&#039;&#039; and the {{ic|CacheServer}} also does exactly that. — [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 17:35, 12 October 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Is PackageKit warning and bugs still relevant? ==&lt;br /&gt;
&lt;br /&gt;
Bugs seem to be closed, while unresolved, and from comments it seems that they are no longer relevant [[User:Karakurt|Karakurt]] ([[User talk:Karakurt|talk]]) 14:24, 26 July 2025 (UTC)&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Package_proxy_cache&amp;diff=873435</id>
		<title>Package proxy cache</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Package_proxy_cache&amp;diff=873435"/>
		<updated>2026-05-09T15:13:14Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Read-write cache */ update, bug was closed; re Talk:Pacman/Tips and tricks#pacman cache&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Package management]]&lt;br /&gt;
[[hu:Package proxy cache]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|pacman}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
&lt;br /&gt;
If you want to install the same Arch packages over and over —e.g. for testing purposes— it could help if you would not have to get the packages every time from the internet. This article shows you how to share packages so that you can greatly decrease your download times.&lt;br /&gt;
&lt;br /&gt;
Which solution is best depends on your individual use-case. The methods can be grouped into [[#Package cache sharing]] of the machines, or deploying a [[#Proxy server]] for extra caching on one machine and configuring the machines to use it accordingly.&lt;br /&gt;
&lt;br /&gt;
== Package cache sharing ==&lt;br /&gt;
&lt;br /&gt;
For all solutions to share the package cache, keep in mind that, by default, {{ic|pacman -Sc}} removes package tarballs from the cache that correspond to packages that are not installed on the machine the command was issued on. Because &#039;&#039;pacman&#039;&#039; cannot predict what packages are installed on all machines that share the cache, it will end up deleting files that should not be.&lt;br /&gt;
&lt;br /&gt;
To clean up the cache so that only &#039;&#039;outdated&#039;&#039; tarballs are deleted:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/pacman.conf|2=&lt;br /&gt;
[options]&lt;br /&gt;
CleanMethod = KeepCurrent&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Read-only cache ===&lt;br /&gt;
&lt;br /&gt;
Pacman supports cache servers directly. Cache servers will be tried before any non-cache servers, will not be removed from the server pool because of HTTP 404 download errors, and will not be used for database files.&lt;br /&gt;
&lt;br /&gt;
If you are looking for a quick solution, you can simply run a [https://gist.github.com/willurd/5720255 basic temporary webserver] which other computers can use as their cache server.&lt;br /&gt;
&lt;br /&gt;
Start serving this directory. For example, with [[Python]] [https://docs.python.org/3/library/http.server.html#http-server-cli http.server] module:&lt;br /&gt;
&lt;br /&gt;
 $ python -m http.server -d /var/cache/pacman/pkg/&lt;br /&gt;
&lt;br /&gt;
{{Tip|By default, Python {{ic|http.server}} listens on port {{ic|8000}} of any interface. To use another port, or bind only to specific address, simply add a parameter and an argument:&lt;br /&gt;
&lt;br /&gt;
 $ python -m http.server -d /var/cache/pacman/pkg/ --bind 127.0.0.1 8080&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Then [[textedit|edit]] {{ic|/etc/pacman.d/mirrorlist}} on each client machine to add this server:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/pacman.d/mirrorlist|2=&lt;br /&gt;
CacheServer = http://&#039;&#039;server-ip&#039;&#039;:&#039;&#039;port&#039;&#039;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|Do &#039;&#039;&#039;not&#039;&#039;&#039; append {{ic|/repos/$repo/os/$arch}} to this custom server like for other entries, as this hierarchy does not exist and therefore queries will fail.}}&lt;br /&gt;
&lt;br /&gt;
If looking for a more standalone solution, {{Pkg|darkhttpd}} offers a very minimal webserver. Replace the previous {{ic|python}} command with e.g.:&lt;br /&gt;
&lt;br /&gt;
 [http]$ darkhttpd /var/cache/pacman/pkg --no-server-id&lt;br /&gt;
&lt;br /&gt;
You could also run darkhttpd as a &#039;&#039;systemd&#039;&#039; service for convenience: see [[Systemd#Writing unit files]].&lt;br /&gt;
&lt;br /&gt;
[[miniserve]], a small web server written in Rust, can also be used:&lt;br /&gt;
&lt;br /&gt;
 $ miniserve /var/cache/pacman/pkg&lt;br /&gt;
&lt;br /&gt;
Then edit {{ic|/etc/pacman.d/mirrorlist}} as above with the first url miniserve is available at.&lt;br /&gt;
&lt;br /&gt;
If you are already running a web server for some other purpose, you might wish to reuse that as your local repository server instead. For example, if you already serve a site with [[nginx]], you can add an &#039;&#039;nginx&#039;&#039; server block listening on port 8080:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/nginx/nginx.conf|&lt;br /&gt;
server {&lt;br /&gt;
    listen 8080;&lt;br /&gt;
    root /var/cache/pacman/pkg;&lt;br /&gt;
    server_name myarchrepo.localdomain;&lt;br /&gt;
    try_files $uri $uri/;&lt;br /&gt;
}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Remember to [[restart]] {{ic|nginx.service}} after making this change.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Whichever web server you use, make sure the firewall configuration (if any) allows the configured port to be reached by the desired traffic, and disallows any undesired traffic. See [[Security#Network and firewalls]].}}&lt;br /&gt;
&lt;br /&gt;
=== Overlay mount of read-only cache ===&lt;br /&gt;
&lt;br /&gt;
It is possible to use one machine on a local network as a read-only package cache by [[Overlay filesystem|overlay mounting]] its {{ic|/var/cache/pacman/pkg}} directory. Such a configuration is advantageous if this server has installed on it a reasonably comprehensive selection of up-to-date packages which are also used by other boxes. This is useful for maintaining a number of machines at the end of a low bandwidth upstream connection.&lt;br /&gt;
&lt;br /&gt;
As an example, to use this method:&lt;br /&gt;
&lt;br /&gt;
 # mkdir /tmp/remote_pkg /mnt/workdir_pkg /tmp/pacman_pkg&lt;br /&gt;
 # sshfs &#039;&#039;remote_username&#039;&#039;@&#039;&#039;remote_pkgcache_addr&#039;&#039;:/var/cache/pacman/pkg /tmp/remote_pkg -C&lt;br /&gt;
 # mount -t overlay overlay -o lowerdir=/tmp/remote_pkg,upperdir=/var/cache/pacman/pkg,workdir=/mnt/workdir_pkg /tmp/pacman_pkg&lt;br /&gt;
&lt;br /&gt;
{{Note|The working directory must be an empty directory on the same mounted device as the upper directory. See [[Overlay filesystem#Usage]].}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|1=If listing the {{ic|/tmp/pacman_pkg}} overlay directory gives errors, e.g., &amp;quot;Stale file handle&amp;quot;, try overlay mounting with options {{ic|1=-o redirect_dir=off -o index=off}}. }}&lt;br /&gt;
&lt;br /&gt;
After this, run &#039;&#039;pacman&#039;&#039; using the option {{ic|--cachedir /tmp/pacman_pkg}}, e.g.:&lt;br /&gt;
&lt;br /&gt;
 # pacman -Syu --cachedir /tmp/pacman_pkg&lt;br /&gt;
&lt;br /&gt;
=== Distributed read-only cache ===&lt;br /&gt;
&lt;br /&gt;
There are Arch-specific tools for automatically discovering other computers on your network offering a package cache. Try {{Pkg|pacredir}}, [[pacserve]], {{AUR|pkgdistcache}}, or {{AUR|paclan}}. pkgdistcache uses Avahi instead of plain UDP which may work better in certain home networks that route instead of bridge between Wi-Fi and Ethernet.&lt;br /&gt;
&lt;br /&gt;
Historically, there was [https://bbs.archlinux.org/viewtopic.php?id=64391 PkgD] and [https://github.com/toofishes/multipkg multipkg], but they are no longer maintained.&lt;br /&gt;
&lt;br /&gt;
=== Read-write cache ===&lt;br /&gt;
&lt;br /&gt;
In order to share packages between multiple computers, simply share {{ic|/var/cache/pacman/}} using any network-based mount protocol. This section shows how to use [[SSHFS]] to share a package cache plus the related library-directories between multiple computers on the same local network. Keep in mind that a network shared cache can be slow depending on the file-system choice, among other factors.&lt;br /&gt;
&lt;br /&gt;
First, install any network-supporting filesystem packages: {{Pkg|sshfs}}, {{Pkg|curlftpfs}}, {{Pkg|samba}} or {{Pkg|nfs-utils}}.&lt;br /&gt;
&lt;br /&gt;
{{Tip|&lt;br /&gt;
* To use &#039;&#039;sshfs&#039;&#039;, consider reading [[Using SSH Keys]].&lt;br /&gt;
* By default, &#039;&#039;smbfs&#039;&#039; does not serve filenames that contain colons, which results in the client downloading the offending package afresh. To prevent this, use the {{ic|mapchars}} mount option on the client.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Then, to share the actual packages, mount {{ic|/var/cache/pacman/pkg}} from the server to {{ic|/var/cache/pacman/pkg}} on every client machine.&lt;br /&gt;
&lt;br /&gt;
{{Warning|Do not make {{ic|/var/cache/pacman/pkg}} or any of its ancestors (e.g., {{ic|/var}}) a symlink. Pacman expects these to be directories. When &#039;&#039;pacman&#039;&#039; re-installs or upgrades itself, it will remove the symlinks and create empty directories instead. See the issue {{Issue|pacman/pacman|5}} for details.}}&lt;br /&gt;
&lt;br /&gt;
=== Two-way with rsync or FTP ===&lt;br /&gt;
&lt;br /&gt;
Another approach in a local environment is [[rsync]]. Choose a server for caching and enable the [[Rsync#As a daemon|rsync daemon]]. On clients synchronize two-way with this share via the rsync protocol. Filenames that contain colons are no problem for the rsync protocol.&lt;br /&gt;
&lt;br /&gt;
Draft example for a client, using {{ic|uname -m}} within the share name ensures an architecture-dependent sync:&lt;br /&gt;
&lt;br /&gt;
 # rsync ... rsync://server/share_$(uname -m)/ /var/cache/pacman/pkg/ &lt;br /&gt;
 # pacman -Syu&lt;br /&gt;
 # paccache --remove --keep 3&lt;br /&gt;
 # rsync --delete ... /var/cache/pacman/pkg/ rsync://server/share_$(uname -m)/&lt;br /&gt;
&lt;br /&gt;
Instead of relying on unencrypted [[Rsync#As a daemon|rsync daemon]] a more secure security option is rsync over ssh, &lt;br /&gt;
[[Rsync#Automated backup with SSH]] gives an overview.&lt;br /&gt;
&lt;br /&gt;
In case rsync is not available in your local environment, a simple ftp service is suitable for the two-way sync as well. {{Pkg|lftp}} provides a {{ic|--mirror}} and a {{ic|--delete}} option to sync a local with a remote storage.&lt;br /&gt;
&lt;br /&gt;
=== Synchronize pacman package cache using synchronization programs ===&lt;br /&gt;
&lt;br /&gt;
Use [[Syncthing]] or [[Resilio Sync]] to synchronize the &#039;&#039;pacman&#039;&#039; cache directories (i.e. {{ic|/var/cache/pacman/pkg}}).&lt;br /&gt;
&lt;br /&gt;
== Proxy server ==&lt;br /&gt;
&lt;br /&gt;
For proxy server solutions, keep in mind the machines should only use HTTP mirrors, because a proxy server cannot introspect [[HTTPS]] connections by default.&lt;br /&gt;
&lt;br /&gt;
=== Dynamic reverse proxy cache using nginx ===&lt;br /&gt;
&lt;br /&gt;
[[nginx]] can be used to proxy package requests to official upstream mirrors and cache the results to the local disk. All subsequent requests for that package will be served directly from the local cache, minimizing the amount of internet traffic needed to update a large number of computers. &lt;br /&gt;
&lt;br /&gt;
In this example, the cache server will run at {{ic|&amp;lt;nowiki&amp;gt;http://cache.domain.example:8080/&amp;lt;/nowiki&amp;gt;}} and store the packages in {{ic|/srv/http/pacman-cache/}}. &lt;br /&gt;
&lt;br /&gt;
Install [[nginx]] on the computer that is going to host the cache. Create the directory for the cache and adjust the permissions so nginx can write files to it:&lt;br /&gt;
&lt;br /&gt;
 # mkdir /srv/http/pacman-cache&lt;br /&gt;
 # chown http:http /srv/http/pacman-cache&lt;br /&gt;
&lt;br /&gt;
Use the [https://github.com/nastasie-octavian/nginx_pacman_cache_config/blob/c54eca4776ff162ab492117b80be4df95880d0e2/nginx.conf nginx pacman cache config] as a starting point for {{ic|/etc/nginx/nginx.conf}}. Check that the {{ic|resolver}} directive works for your needs. In the upstream server blocks, configure the {{ic|proxy_pass}} directives with addresses of official mirrors, see examples in the configuration file about the expected format. Once you are satisfied with the configuration file [[Nginx#Running|start and enable nginx]].&lt;br /&gt;
&lt;br /&gt;
In order to use the cache each Arch Linux computer (including the one hosting the cache) must have the following line at the top of the {{ic|mirrorlist}} file:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/pacman.d/mirrorlist|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Server = http://cache.domain.example:8080/$repo/os/$arch&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Note| You will need to create a method to clear old packages, as the cache directory will continue to grow over time. {{ic|paccache}} (which is provided by {{Pkg|pacman-contrib}}) can be used to automate this using retention criteria of your choosing. For example, {{ic|find /srv/http/pacman-cache/ -type d -exec paccache -v -r -k 2 -c {} \;}} will keep the last 2 versions of packages in your cache directory.}}&lt;br /&gt;
&lt;br /&gt;
=== Squid ===&lt;br /&gt;
&lt;br /&gt;
[[Squid]] proxy can be setup to only cache arch packages and can be used with aif/pacman/wget/etc with minimal configuration on the client system.&lt;br /&gt;
&lt;br /&gt;
==== Install Squid ====&lt;br /&gt;
&lt;br /&gt;
Install {{Pkg|squid}}.&lt;br /&gt;
&lt;br /&gt;
==== Configure Squid ====&lt;br /&gt;
&lt;br /&gt;
This is the minimum configuration to get squid cache arch packages.&lt;br /&gt;
&lt;br /&gt;
===== Cache Rules =====&lt;br /&gt;
&lt;br /&gt;
Before defining these rules, remove/comment (if you do not need them) all the default refresh_patterns&lt;br /&gt;
{{hc|/etc/squid/squid.conf |refresh_pattern \.pkg\.tar\.   0       20%     4320      reload-into-ims&lt;br /&gt;
refresh_pattern .              0       0%      0}}&lt;br /&gt;
That should define that *.pkg.tar.* gets cached, and anything else should not.&lt;br /&gt;
{{Tip|https://www.squid-cache.org/Doc/config/refresh_pattern}}&lt;br /&gt;
&lt;br /&gt;
===== Maximum Filesize =====&lt;br /&gt;
&lt;br /&gt;
Objects larger than this size will NOT be saved on disk:&lt;br /&gt;
{{hc|/etc/squid/squid.conf |maximum_object_size 256 MB}}&lt;br /&gt;
{{Tip|https://www.squid-cache.org/Doc/config/maximum_object_size}}&lt;br /&gt;
&lt;br /&gt;
===== Cache Directory =====&lt;br /&gt;
&lt;br /&gt;
Set the cache dir and its maximum size and subdirs:&lt;br /&gt;
{{hc|/etc/squid/squid.conf |cache_dir aufs /var/cache/squid 10000 16 256}}&lt;br /&gt;
{{Tip|https://www.squid-cache.org/Doc/config/cache_dir}}&lt;br /&gt;
&lt;br /&gt;
===== Shutdown Lifetime =====&lt;br /&gt;
&lt;br /&gt;
Time to wait until all active client sockets are closed:&lt;br /&gt;
{{hc|/etc/squid/squid.conf |shutdown_lifetime 1 seconds }}&lt;br /&gt;
{{Tip|https://www.squid-cache.org/Doc/config/shutdown_lifetime}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
Every time you change the cache_dir path (and after fresh install), you need to (re)create this directory:&lt;br /&gt;
{{bc|# squid -z}}&lt;br /&gt;
and it could be helpful to check the configuration file before running squid:&lt;br /&gt;
{{bc|# squid -k parse}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Start Squid ====&lt;br /&gt;
&lt;br /&gt;
Just [[start]] {{ic|squid.service}} or if squid is already running [[restart]] it. &lt;br /&gt;
{{Note|&lt;br /&gt;
It could be helpful to check the configuration file before running:&lt;br /&gt;
{{bc|# squid -k check}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Follow Squid access log ====&lt;br /&gt;
&lt;br /&gt;
To see the access to squid:&lt;br /&gt;
{{bc|# tail -f /var/log/squid/access.log}}&lt;br /&gt;
You should see this for packages that are directed to original host:&lt;br /&gt;
{{bc|...TCP_MISS/200...DIRECT...}}&lt;br /&gt;
and for packages that are delivered from the cache:&lt;br /&gt;
{{bc|...TCP_HIT/200...NONE...}}&lt;br /&gt;
&lt;br /&gt;
==== Manual Arch Install ====&lt;br /&gt;
&lt;br /&gt;
On the individual machines, add [[environment variables]] for your proxy. To do so for testing:&lt;br /&gt;
&lt;br /&gt;
 # export http_proxy=&#039;http://&#039;&#039;your_squid_machine_ip&#039;&#039;:3128/&#039;&lt;br /&gt;
 # export ftp_proxy=&#039;ftp://&#039;&#039;your_squid_machine_ip&#039;&#039;:3128/&#039;&lt;br /&gt;
&lt;br /&gt;
Now it should use your proxy. Watch the squid logs to verify this. Once it works, add the {{ic|http_proxy}} and/or {{ic|ftp_proxy}} variables in an appropriate place on the installed system, e.g. in {{ic|/etc/profile.d/proxy.sh}}.&lt;br /&gt;
&lt;br /&gt;
==== Intercepting local requests ====&lt;br /&gt;
&lt;br /&gt;
If you want all HTTP requests on local machine &#039;&#039;automagically&#039;&#039; go through squid, we first need to add an intercepting port for squid:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/squid/squid.conf |http_port 3127 intercept}}&lt;br /&gt;
&lt;br /&gt;
and iptables rules to redirect all (except the ones from squid) port 80 requests to squid:&lt;br /&gt;
&lt;br /&gt;
{{bc|# iptables -t nat -A OUTPUT -p tcp --dport 80 -m owner --uid-owner proxy -j ACCEPT&lt;br /&gt;
# iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 3127}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|https://wiki.squid-cache.org/ConfigExamples/Intercept/LinuxLocalhost}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
if you get random slow download speeds in vagrant/packer/virtualbox, try using {{ic|virtio}} network device type.}}&lt;br /&gt;
&lt;br /&gt;
=== Pacoloco proxy cache server ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/anatol/pacoloco Pacoloco] is an easy-to-use proxy cache server for &#039;&#039;pacman&#039;&#039; repositories. It also allows [https://github.com/anatol/pacoloco/commit/048b09956b0d8ef71c0ed1f804fd332d9ab5e3c8 automatic prefetching] of the cached packages.&lt;br /&gt;
&lt;br /&gt;
It can be installed as {{Pkg|pacoloco}}. Open the configuration file and add &#039;&#039;pacman&#039;&#039; mirrors:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/pacoloco.yaml|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
port: 9129&lt;br /&gt;
repos:&lt;br /&gt;
  mycopy:&lt;br /&gt;
    urls:&lt;br /&gt;
      - http://mirror.lty.me/archlinux&lt;br /&gt;
      - http://mirrors.kernel.org/archlinux&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
[[Restart]] {{ic|pacoloco.service}} and the proxy repository will be available at {{ic|http://&#039;&#039;myserver&#039;&#039;:9129/repo/mycopy}}.&lt;br /&gt;
&lt;br /&gt;
=== Flexo proxy cache server ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/nroi/flexo Flexo] is yet another proxy cache server for &#039;&#039;pacman&#039;&#039; repositories. Flexo is available as {{AUR|flexo-git}}. Once installed, [[start]] the {{ic|flexo.service}} unit.&lt;br /&gt;
&lt;br /&gt;
Flexo runs on port {{ic|7878}} by default. Enter {{ic|1=Server = http://&#039;&#039;myserver&#039;&#039;:7878/$repo/os/$arch}} to the top of your {{ic|/etc/pacman.d/mirrorlist}} so that &#039;&#039;pacman&#039;&#039; downloads packages via Flexo.&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Pacman/Tips_and_tricks&amp;diff=873425</id>
		<title>Pacman/Tips and tricks</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Pacman/Tips_and_tricks&amp;diff=873425"/>
		<updated>2026-05-09T14:18:44Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Custom local repository */ grammar fix; expand filepath and shorten a sentence&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Lowercase title}}&lt;br /&gt;
[[Category:Package manager]]&lt;br /&gt;
[[de:Pacman-Tipps]]&lt;br /&gt;
[[es:Pacman (Español)/Tips and tricks]]&lt;br /&gt;
[[fr:Pacman (Français)/Tips and tricks]]&lt;br /&gt;
[[hu:Pacman (Magyar)/Tips and tricks]]&lt;br /&gt;
[[ja:Pacman ヒント]]&lt;br /&gt;
[[pt:Pacman (Português)/Tips and tricks]]&lt;br /&gt;
[[uk:Pacman (Українська)/Tips and tricks]]&lt;br /&gt;
[[ru:Pacman (Русский)/Tips and tricks]]&lt;br /&gt;
[[zh-hans:Pacman/Tips and tricks]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|Mirrors}}&lt;br /&gt;
{{Related|Creating packages}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
&lt;br /&gt;
For general methods to improve the flexibility of the provided tips or &#039;&#039;pacman&#039;&#039; itself, see [[Core utilities]] and [[Bash]].&lt;br /&gt;
&lt;br /&gt;
== Maintenance ==&lt;br /&gt;
&lt;br /&gt;
{{Note|Instead of using &#039;&#039;comm&#039;&#039; (which requires sorted input with &#039;&#039;sort&#039;&#039;) in the sections below, you may also use {{ic|grep -Fxf}} or {{ic|grep -Fxvf}}.}}&lt;br /&gt;
&lt;br /&gt;
See also [[System maintenance]].&lt;br /&gt;
&lt;br /&gt;
=== Listing packages ===&lt;br /&gt;
&lt;br /&gt;
==== In unused repositories ====&lt;br /&gt;
&lt;br /&gt;
By default, repositories listed in {{ic|pacman.conf}} are used for syncing, searching, installing and upgrading from them. This can be changed for more versatility, for example by using some repositories only for searching in them[http://allanmcrae.com/2014/12/pacman-4-2-released/]:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/pacman.conf|2=&lt;br /&gt;
...&lt;br /&gt;
[multilib]&lt;br /&gt;
Usage = Sync Search&lt;br /&gt;
...&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
See {{man|5|pacman.conf|REPOSITORY SECTIONS}}.&lt;br /&gt;
&lt;br /&gt;
==== With version ====&lt;br /&gt;
&lt;br /&gt;
You may want to get the list of installed packages with their version, which is useful when reporting bugs or discussing installed packages.&lt;br /&gt;
&lt;br /&gt;
* List all explicitly installed packages: {{ic|pacman -Qe}}&lt;br /&gt;
* List all packages in the [[package group]] named {{ic|&#039;&#039;group&#039;&#039;}}: {{ic|pacman -Sg &#039;&#039;group&#039;&#039;}}&lt;br /&gt;
* List all foreign packages (typically manually downloaded and installed or packages removed from the repositories): {{ic|pacman -Qm}}&lt;br /&gt;
* List all native packages (installed from the sync database): {{ic|pacman -Qn}}&lt;br /&gt;
* List all explicitly installed native packages (i.e. present in the sync database) that are not direct or optional dependencies: {{ic|pacman -Qent}}&lt;br /&gt;
* List packages by regex: {{ic|pacman -Qs &#039;&#039;regex&#039;&#039;}}&lt;br /&gt;
* List packages by regex with custom output format (needs {{Pkg|expac}}): {{ic|expac -s &amp;quot;%-30n %v&amp;quot; &#039;&#039;regex&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
==== With size ====&lt;br /&gt;
&lt;br /&gt;
Figuring out which packages are largest can be useful when trying to free space on your hard drive. There are two options here: get the size of individual packages, or get the size of packages and their dependencies.&lt;br /&gt;
&lt;br /&gt;
===== Individual packages =====&lt;br /&gt;
&lt;br /&gt;
The following command will list all installed packages and their individual sizes:&lt;br /&gt;
&lt;br /&gt;
 $ LC_ALL=C.UTF-8 pacman -Qi | awk &#039;/^Name/{name=$3} /^Installed Size/{print $4$5, name}&#039; | LC_ALL=C.UTF-8 sort -h&lt;br /&gt;
&lt;br /&gt;
===== Packages and dependencies =====&lt;br /&gt;
&lt;br /&gt;
To list package sizes with their dependencies,&lt;br /&gt;
&lt;br /&gt;
* Install {{Pkg|expac}} and run {{ic|expac -H M &#039;%m\t%n&#039; {{!}} sort -h}}.&lt;br /&gt;
* Run {{AUR|pacgraph}} with the {{ic|-c}} option.&lt;br /&gt;
&lt;br /&gt;
To list the download size of several packages (leave {{ic|&#039;&#039;packages&#039;&#039;}} blank to list all packages):&lt;br /&gt;
&lt;br /&gt;
 $ expac -S -H M &#039;%k\t%n&#039; &#039;&#039;packages&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To list explicitly installed packages not in the [[meta package]] {{Pkg|base}} nor [[package group]] {{Grp|xorg}} with size and description:&lt;br /&gt;
&lt;br /&gt;
 $ expac -H M &amp;quot;%011m\t%-20n\t%10d&amp;quot; $(comm -23 &amp;lt;(pacman -Qqen | sort) &amp;lt;({ pacman -Qqg xorg; expac -l &#039;\n&#039; &#039;%E&#039; base; } | sort -u)) | sort -n&lt;br /&gt;
&lt;br /&gt;
To list the packages marked for upgrade with their download size:&lt;br /&gt;
&lt;br /&gt;
 $ expac -S -H M &#039;%k\t%n&#039; $(pacman -Qqu) | sort -sh&lt;br /&gt;
&lt;br /&gt;
To list optional dependencies only:&lt;br /&gt;
&lt;br /&gt;
 $ expac -S &amp;quot;%o&amp;quot; &#039;&#039;package&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== By date ====&lt;br /&gt;
&lt;br /&gt;
To list the 20 last installed packages with {{Pkg|expac}}, run:&lt;br /&gt;
&lt;br /&gt;
 $ expac --timefmt=&#039;%Y-%m-%d %T&#039; &#039;%l\t%n&#039; | sort | tail -n 20&lt;br /&gt;
&lt;br /&gt;
or, with seconds since the epoch (1970-01-01 UTC):&lt;br /&gt;
&lt;br /&gt;
 $ expac --timefmt=%s &#039;%l\t%n&#039; | sort -n | tail -n 20&lt;br /&gt;
&lt;br /&gt;
==== Not in a specified group, repository or meta package ====&lt;br /&gt;
&lt;br /&gt;
{{Note|To get a list of packages installed as dependencies but no longer required by any installed package, see [[#Removing unused packages (orphans)]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
List explicitly installed packages not in the {{Pkg|base}} [[meta package]]:&lt;br /&gt;
&lt;br /&gt;
 $ comm -23 &amp;lt;(pacman -Qqe | sort) &amp;lt;(expac -l &#039;\n&#039; &#039;%E&#039; base | sort)&lt;br /&gt;
&lt;br /&gt;
List explicitly installed packages not in the {{Pkg|base}} meta package or {{Grp|xorg}} [[package group]]:&lt;br /&gt;
&lt;br /&gt;
 $ comm -23 &amp;lt;(pacman -Qqe | sort) &amp;lt;({ pacman -Qqg xorg; expac -l &#039;\n&#039; &#039;%E&#039; base; } | sort -u)&lt;br /&gt;
&lt;br /&gt;
List all installed packages unrequired by other packages, and which are not in the {{Pkg|base}} meta package or {{Grp|xorg}} package group:&lt;br /&gt;
&lt;br /&gt;
 $ comm -23 &amp;lt;(pacman -Qqt | sort) &amp;lt;({ pacman -Qqg xorg; echo base; } | sort -u)&lt;br /&gt;
&lt;br /&gt;
As above, but with descriptions:&lt;br /&gt;
&lt;br /&gt;
 $ expac -H M &#039;%-20n\t%10d&#039; $(comm -23 &amp;lt;(pacman -Qqt | sort) &amp;lt;({ pacman -Qqg xorg; echo base; } | sort -u))&lt;br /&gt;
&lt;br /&gt;
List all installed packages that are &#039;&#039;not&#039;&#039; in the specified repository &#039;&#039;repo_name&#039;&#039; (multiple repositories can be checked at once):&lt;br /&gt;
&lt;br /&gt;
 $ comm -23 &amp;lt;(pacman -Qq | sort) &amp;lt;(pacman -Sql &#039;&#039;repo_name&#039;&#039; | sort)&lt;br /&gt;
&lt;br /&gt;
List all installed packages that are in the &#039;&#039;repo_name&#039;&#039; repository (multiple repositories can be checked at once):&lt;br /&gt;
&lt;br /&gt;
 $ comm -12 &amp;lt;(pacman -Qq | sort) &amp;lt;(pacman -Sql &#039;&#039;repo_name&#039;&#039; | sort)&lt;br /&gt;
&lt;br /&gt;
List all packages on the Arch Linux ISO that are not in the {{Pkg|base}} meta package:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ comm -23 &amp;lt;(curl https://gitlab.archlinux.org/archlinux/archiso/-/raw/master/configs/releng/packages.x86_64) &amp;lt;(expac -l &#039;\n&#039; &#039;%E&#039; base | sort)&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Tip|Alternatively, use {{ic|combine}} (instead of {{ic|comm}}) from the {{Pkg|moreutils}} package which has a syntax that is easier to remember. See {{man|1|combine}}.}}&lt;br /&gt;
&lt;br /&gt;
==== Development packages ====&lt;br /&gt;
&lt;br /&gt;
To list all development/unstable packages, run:&lt;br /&gt;
&lt;br /&gt;
 $ pacman -Qq | grep -Ee &#039;-(bzr|cvs|darcs|git|hg|svn)$&#039;&lt;br /&gt;
&lt;br /&gt;
==== Dependencies of a package ====&lt;br /&gt;
&lt;br /&gt;
To obtain the list of the dependencies of a package, the simplest solution is reading the output of:&lt;br /&gt;
&lt;br /&gt;
 $ pacman -Qi &#039;&#039;package&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For automation, instead of the error-prone method of parsing pacman output, use {{Pkg|expac}}:&lt;br /&gt;
&lt;br /&gt;
 $ expac -S &#039;%D&#039; &#039;&#039;package&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== With optional dependencies ====&lt;br /&gt;
&lt;br /&gt;
To list explicitly-installed packages with their optional dependencies, run:&lt;br /&gt;
&lt;br /&gt;
 $ LC_ALL=C.UTF-8 pacman -Qei | sed &#039;/^[^NO ]/d;/None$/d&#039; | awk &#039;BEGIN{RS=ORS=&amp;quot;\n\n&amp;quot;;FS=OFS=&amp;quot;\n\\S&amp;quot;} /Optional Deps/ {print $1&amp;quot;\nO&amp;quot;$2}&#039;&lt;br /&gt;
&lt;br /&gt;
Alternatively, with {{Pkg|expac}}:&lt;br /&gt;
&lt;br /&gt;
 $ expac -d &#039;\n\n&#039; -l &#039;\n\t&#039; -Q &#039;%n\n\t%O&#039; $(pacman -Qeq)&lt;br /&gt;
&lt;br /&gt;
To list them while omitting optional dependencies you have already installed, run:&lt;br /&gt;
&lt;br /&gt;
 $ LC_ALL=C.UTF-8 pacman -Qei | sed &#039;/^[^NO ]/d;/None$/d&#039; | awk &#039;BEGIN{RS=ORS=&amp;quot;\n\n&amp;quot;;FS=OFS=&amp;quot;\n\\S&amp;quot;} /Optional Deps/ {print $1&amp;quot;\nO&amp;quot;$2}&#039; | sed &#039;s/^Optional Deps   ://;/\[installed\]$/d;s/\s\+/ /&#039;&lt;br /&gt;
&lt;br /&gt;
=== Browsing packages ===&lt;br /&gt;
&lt;br /&gt;
To browse all installed packages with an instant preview of each package:&lt;br /&gt;
&lt;br /&gt;
 $ pacman -Qq | fzf --preview &#039;pacman -Qil {}&#039; --layout=reverse --bind &#039;enter:execute(pacman -Qil {} | less)&#039;&lt;br /&gt;
&lt;br /&gt;
This uses [[fzf]] to present a two-pane view listing all packages with package info shown on the right.&lt;br /&gt;
&lt;br /&gt;
Enter letters to filter the list of packages; use arrow keys (or {{ic|Ctrl-j}}/{{ic|Ctrl-k}}) to navigate; press {{ic|Enter}} to see package info under &#039;&#039;less&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
To browse all packages currently known to &#039;&#039;pacman&#039;&#039; (both installed and not yet installed) in a similar way, using fzf, use:&lt;br /&gt;
&lt;br /&gt;
 $ pacman -Slq | fzf --preview &#039;pacman -Si {}&#039; --layout=reverse&lt;br /&gt;
&lt;br /&gt;
The navigational keybindings are the same, although {{ic|Enter}} will not work in the same way.&lt;br /&gt;
&lt;br /&gt;
=== Listing files owned by a package with size ===&lt;br /&gt;
&lt;br /&gt;
This one might come in handy if you have found that a specific package uses a huge amount of space and you want to find out which files make up the most of that.&lt;br /&gt;
&lt;br /&gt;
 $ pacman -Qlq &#039;&#039;package&#039;&#039; | grep -v &#039;/$&#039; | xargs -r du -h | sort -h&lt;br /&gt;
&lt;br /&gt;
=== Identify files not owned by any package ===&lt;br /&gt;
&lt;br /&gt;
If your system has stray files not owned by any package (a common case if you do not [[Enhance system stability#Use the package manager to install software|use the package manager to install software]]), you may want to find such files in order to clean them up.&lt;br /&gt;
&lt;br /&gt;
One method is to list all files of interest and check them against &#039;&#039;pacman&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 # (export LC_ALL=C.UTF-8; comm -13 &amp;lt;(pacman -Qlq | sed &#039;s,/$,,&#039; | sort) &amp;lt;(find /etc /usr /opt -path /usr/lib/modules -prune -o -print | sort))&lt;br /&gt;
&lt;br /&gt;
{{Tip|The {{Pkg|lostfiles}} script performs similar steps, but also includes an extensive blacklist to remove common false positives from the output.}}&lt;br /&gt;
&lt;br /&gt;
=== Tracking unowned files created by packages ===&lt;br /&gt;
&lt;br /&gt;
Most systems will slowly collect several [http://ftp.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html#S3-RPM-INSIDE-FLIST-GHOST-DIRECTIVE ghost] files such as state files, logs, indexes, etc. through the course of usual operation.&lt;br /&gt;
&lt;br /&gt;
{{ic|pacreport}} from {{Pkg|pacutils}} can be used to track these files and their associations via {{ic|/etc/pacreport.conf}} (see {{man|1|pacreport|FILES}}).&lt;br /&gt;
&lt;br /&gt;
An example may look something like this (abridged):&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/pacreport.conf|2=&lt;br /&gt;
[Options]&lt;br /&gt;
IgnoreUnowned = usr/share/applications/mimeinfo.cache&lt;br /&gt;
&lt;br /&gt;
[PkgIgnoreUnowned]&lt;br /&gt;
alsa-utils = var/lib/alsa/asound.state&lt;br /&gt;
bluez = var/lib/bluetooth&lt;br /&gt;
ca-certificates = etc/ca-certificates/trust-source/*&lt;br /&gt;
dbus = var/lib/dbus/machine-id&lt;br /&gt;
glibc = etc/ld.so.cache&lt;br /&gt;
grub = boot/grub/*&lt;br /&gt;
linux = boot/initramfs-linux.img&lt;br /&gt;
pacman = var/lib/pacman/local&lt;br /&gt;
update-mime-database = usr/share/mime/magic&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Then, when using {{ic|pacreport --unowned-files}} as the root user, any unowned files will be listed if the associated package is no longer installed (or if any new files have been created).&lt;br /&gt;
&lt;br /&gt;
Additionally, [https://github.com/CyberShadow/aconfmgr aconfmgr] ({{AUR|aconfmgr-git}}) allows tracking modified and orphaned files using a configuration script.&lt;br /&gt;
&lt;br /&gt;
=== Removing unused packages (orphans) ===&lt;br /&gt;
&lt;br /&gt;
Orphans are packages that were installed as a dependency and are no longer required by any package.&lt;br /&gt;
&lt;br /&gt;
They can accumulate on your system over time either due to uninstalling packages using {{ic|pacman -R &#039;&#039;package&#039;&#039;}} instead of {{ic|pacman -Rs &#039;&#039;package&#039;&#039;}}, installing packages as [[makedepends]], or packages removing dependencies in newer versions.&lt;br /&gt;
&lt;br /&gt;
For recursively removing orphans and their configuration files:&lt;br /&gt;
&lt;br /&gt;
 # pacman -Qdtq | pacman -Rns -&lt;br /&gt;
&lt;br /&gt;
If no orphans were found, the output is {{ic|error: argument &#039;-&#039; specified with empty stdin}}. This is expected as no arguments were passed to {{ic|pacman -Rns}}. The error can be avoided by prefixing the second command with {{man|1|ifne}} from the {{Pkg|moreutils}} package.&lt;br /&gt;
&lt;br /&gt;
If there is a package listed that you do not want to remove, it can be excluded from the list of orphans by marking it as explicitly installed:&lt;br /&gt;
&lt;br /&gt;
 # pacman -D --asexplicit &#039;&#039;package&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{Note|The arguments {{ic|-Qdt}} list only true orphans. To include packages which are &#039;&#039;optionally&#039;&#039; required by another package, pass the {{ic|-t}} flag twice (&#039;&#039;i.e.&#039;&#039;, {{ic|-Qdtt}}).}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|Add the {{ic|pacman -Qdt}} command to a &#039;&#039;pacman&#039;&#039; post-transaction [[Pacman#Hooks|hook]] to be notified if a transaction orphaned a package. This can be useful for being notified when a package has been dropped from a repository, since any dropped package will also be orphaned on a local installation (unless it was explicitly installed). To avoid any {{ic|failed to execute command}} errors when no orphans are found, use the following command for {{ic|Exec}} in your hook: {{ic|&amp;lt;nowiki&amp;gt;/usr/bin/bash -c &amp;quot;/usr/bin/pacman -Qdt || /usr/bin/echo &#039;=&amp;gt; None found.&#039;&amp;quot;&amp;lt;/nowiki&amp;gt;}} The package {{AUR|pacman-log-orphans-hook}} provides such hook with a more verbose instructions.}}&lt;br /&gt;
&lt;br /&gt;
=== Detecting more unneeded packages ===&lt;br /&gt;
&lt;br /&gt;
In some cases the method above will not detect all possible unneeded packages. E.g. dependency cycles (also known as &amp;quot;circular dependencies&amp;quot;), excessive dependencies (fulfilled more than once), some non-explicit optionals etc.&lt;br /&gt;
&lt;br /&gt;
To detect such packages:&lt;br /&gt;
&lt;br /&gt;
 $ pacman -Qqd | pacman -Rsu --print -&lt;br /&gt;
&lt;br /&gt;
If you want to remove all packages in the list at once, run the command without {{ic|--print}} argument.&lt;br /&gt;
&lt;br /&gt;
Sometimes there may be multiple packages providing the same item. For example, there may be multiple packages which provide ttf-font. You may not want all such packages depending on your preference.&lt;br /&gt;
&lt;br /&gt;
To detect packages which provide same item:&lt;br /&gt;
&lt;br /&gt;
 $ awk &#039;/%(NAME|PROVIDES)%/{flag=1;next}/^$/{flag=0}flag{ printf &amp;quot;%s\t%s\n&amp;quot;, FILENAME, $0}&#039; /var/lib/pacman/local/*/desc  | sed &#039;s%/var/lib/pacman/local/\(.*\)/desc%\1%g&#039; | sort -k2 | uniq -Df1 | column -etN Package,Provides&lt;br /&gt;
&lt;br /&gt;
Check the output and [[Pacman#Removing packages|carefully remove]] redundant package which you do not require.&lt;br /&gt;
&lt;br /&gt;
=== Removing everything but essential packages ===&lt;br /&gt;
&lt;br /&gt;
If it is ever necessary to remove all packages except the essentials packages, one method is to set the installation reason of the non-essential ones as dependency and then remove all unnecessary dependencies.&lt;br /&gt;
&lt;br /&gt;
First, for all the packages &amp;quot;explicitly installed&amp;quot;, change their installation reason to &amp;quot;installed as a dependency&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 # pacman -D --asdeps $(pacman -Qqe)&lt;br /&gt;
&lt;br /&gt;
Then, change the installation reason to &amp;quot;explicitly installed&amp;quot; of only the essential packages, those you &#039;&#039;&#039;do not&#039;&#039;&#039; want to remove, in order to avoid targeting them:&lt;br /&gt;
&lt;br /&gt;
 # pacman -D --asexplicit base linux linux-firmware&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* Additional packages can be added to the above command in order to avoid being removed. See [[Installation guide#Install essential packages]] for more info on other packages that may be necessary for a fully functional base system.&lt;br /&gt;
* This will also select the [[boot loader]] package for removal. The system should still be bootable, but the boot parameters might not be changeable without it.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Finally, follow the instructions in [[#Removing unused packages (orphans)]] to remove all packages that are &amp;quot;installed as a dependency&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Getting the dependencies list of several packages ===&lt;br /&gt;
&lt;br /&gt;
Dependencies are alphabetically sorted and doubles are removed.&lt;br /&gt;
&lt;br /&gt;
{{Note|To only show the tree of local installed packages, use {{ic|pacman -Qi}}.}}&lt;br /&gt;
&lt;br /&gt;
 $ LC_ALL=C.UTF-8 pacman -Si &#039;&#039;packages&#039;&#039; | awk -F&#039;[:&amp;lt;=&amp;gt;]&#039; &#039;/^Depends/ {print $2}&#039; | xargs -n1 | sort -u&lt;br /&gt;
&lt;br /&gt;
Alternatively, with {{Pkg|expac}}:&lt;br /&gt;
&lt;br /&gt;
 $ expac -l &#039;\n&#039; %E -S &#039;&#039;packages&#039;&#039; | sort -u&lt;br /&gt;
&lt;br /&gt;
=== Listing changed backup files ===&lt;br /&gt;
&lt;br /&gt;
To list configuration files tracked by &#039;&#039;pacman&#039;&#039; as [[Pacnew and Pacsave files#Package backup files|susceptible of containing user changes]] (i.e. files listed in the [[PKGBUILD#backup|PKGBUILD backup array]]) and having received user modifications, use the following command:&lt;br /&gt;
&lt;br /&gt;
 # pacman -Qii | awk &#039;/\[modified\]/ {print $(NF - 1)}&#039;&lt;br /&gt;
&lt;br /&gt;
Running this command with root permissions will ensure that files readable only by root (such as {{ic|/etc/sudoers}}) are included in the output.&lt;br /&gt;
&lt;br /&gt;
This can be used when doing a selective system backup or when trying to replicate a system configuration from one machine to another.&lt;br /&gt;
&lt;br /&gt;
{{Tip|&lt;br /&gt;
* See [[#Listing all changed files from packages]] to list all changed files &#039;&#039;pacman&#039;&#039; knows about, not only backup files.&lt;br /&gt;
* See [[#Identify files not owned by any package]] to list all files in the system that are not tracked by &#039;&#039;pacman&#039;&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Back up the pacman database ===&lt;br /&gt;
&lt;br /&gt;
The following command can be used to back up the local &#039;&#039;pacman&#039;&#039; database:&lt;br /&gt;
&lt;br /&gt;
 $ tar -cjf pacman_database.tar.bz2 /var/lib/pacman/local&lt;br /&gt;
&lt;br /&gt;
Store the backup &#039;&#039;pacman&#039;&#039; database file on one or more offline media, such as a USB stick, external hard drive, or CD-R.&lt;br /&gt;
&lt;br /&gt;
The database can be restored by moving the {{ic|pacman_database.tar.bz2}} file into the {{ic|/}} directory and executing the following command:&lt;br /&gt;
&lt;br /&gt;
 # tar -xjvf pacman_database.tar.bz2&lt;br /&gt;
&lt;br /&gt;
{{Note|If the &#039;&#039;pacman&#039;&#039; database files are corrupted, and there is no backup file available, there exists some hope of rebuilding the &#039;&#039;pacman&#039;&#039; database. Consult [[#Restore pacman&#039;s local database]].}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|The {{AUR|pakbak-git}} package provides a script and a [[systemd]] service to automate the task. Configuration is possible in {{ic|/etc/pakbak.conf}}.}}&lt;br /&gt;
&lt;br /&gt;
=== Check changelogs easily ===&lt;br /&gt;
&lt;br /&gt;
When maintainers update packages, commits are often commented in a useful fashion. Users can quickly check these from the command line by installing {{AUR|pacolog}}. This utility lists recent commit messages for packages from the official repositories or the AUR, by using {{ic|pacolog &#039;&#039;package&#039;&#039;}}.&lt;br /&gt;
&lt;br /&gt;
== Installation and recovery ==&lt;br /&gt;
&lt;br /&gt;
Alternative ways of getting and restoring packages.&lt;br /&gt;
&lt;br /&gt;
=== Installing packages from a CD/DVD or USB stick ===&lt;br /&gt;
&lt;br /&gt;
{{Merge|#Custom local repository|Use as an example and avoid duplication}}&lt;br /&gt;
&lt;br /&gt;
To download packages, or groups of packages:&lt;br /&gt;
&lt;br /&gt;
 # cd ~/Packages&lt;br /&gt;
 # pacman -Syw --cachedir &amp;quot;$PWD&amp;quot; base base-devel grub-bios xorg gimp&lt;br /&gt;
 # repo-add ./custom.db.tar.zst ./*.pkg.tar.zst&lt;br /&gt;
&lt;br /&gt;
Pacman, which will reference the host installation by default, will not properly resolve and download existing dependencies. In cases where all packages and dependencies are wanted, it is recommended to create a temporary blank DB and reference it with {{ic|--dbpath}}:&lt;br /&gt;
&lt;br /&gt;
 # mkdir /tmp/blankdb&lt;br /&gt;
 # pacman -Syw --cachedir &amp;quot;$PWD&amp;quot; --dbpath /tmp/blankdb base base-devel grub-bios xorg gimp&lt;br /&gt;
 # repo-add ./custom.db.tar.zst ./*.pkg.tar.zst&lt;br /&gt;
&lt;br /&gt;
Then you can burn the &amp;quot;Packages&amp;quot; directory to an optical disc (e.g. CD, DVD) or transfer it to a USB flash drive, external HDD, etc.&lt;br /&gt;
&lt;br /&gt;
To install:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.&#039;&#039;&#039; Mount the media:&lt;br /&gt;
&lt;br /&gt;
For an optical disc drive:&lt;br /&gt;
&lt;br /&gt;
 # mount --mkdir /dev/sr0 /mnt/repo&lt;br /&gt;
&lt;br /&gt;
For a USB flash drive, hard disk drive, etc.:&lt;br /&gt;
&lt;br /&gt;
 # mount --mkdir /dev/sd&#039;&#039;xY&#039;&#039; /mnt/repo&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2.&#039;&#039;&#039; Edit {{ic|pacman.conf}} and add this repository &#039;&#039;before&#039;&#039; the other ones (e.g. extra, core, etc.). This is important. Do not just uncomment the one on the bottom. This way it ensures that the files from the CD/DVD/USB take precedence over those in the standard repositories:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/pacman.conf|2=&lt;br /&gt;
[custom]&lt;br /&gt;
SigLevel = PackageRequired&lt;br /&gt;
Server = file:///mnt/repo/Packages}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3.&#039;&#039;&#039; Finally, synchronize the &#039;&#039;pacman&#039;&#039; database to be able to use the new repository:&lt;br /&gt;
 # pacman -Syu&lt;br /&gt;
&lt;br /&gt;
=== Custom local repository ===&lt;br /&gt;
&lt;br /&gt;
Use the &#039;&#039;repo-add&#039;&#039; script included with &#039;&#039;pacman&#039;&#039; to generate a database for a personal repository. Use {{ic|repo-add --help}} for more details on its usage.&lt;br /&gt;
A package database is a tar file, optionally compressed. Valid extensions are &#039;&#039;.db&#039;&#039; or &#039;&#039;.files&#039;&#039; followed by an archive extension of &#039;&#039;.tar&#039;&#039;, &#039;&#039;.tar.gz&#039;&#039;, &#039;&#039;.tar.bz2&#039;&#039;, &#039;&#039;.tar.xz&#039;&#039;, &#039;&#039;.tar.zst&#039;&#039;, or &#039;&#039;.tar.Z&#039;&#039;. The file does not need to exist, but all parent directories must exist.&lt;br /&gt;
&lt;br /&gt;
To add a new package to the database, or to replace the old version of an existing package in the database, run:&lt;br /&gt;
&lt;br /&gt;
 $ repo-add &#039;&#039;/path/to/repo.db.tar.zst /path/to/package-1.0-1-x86_64.pkg.tar.zst&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The database and the packages do not need to be in the same directory when using &#039;&#039;repo-add&#039;&#039;, but keep in mind that when using &#039;&#039;pacman&#039;&#039; with that database, they should be together. Storing all the built packages to be included in the repository in one directory also allows to use shell glob expansion to add or update multiple packages at once:&lt;br /&gt;
&lt;br /&gt;
 $ repo-add &#039;&#039;/path/to/repo.db.tar.zst /path/to/*.pkg.tar.zst&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{Warning|&#039;&#039;repo-add&#039;&#039; adds the entries into the database in the same order as passed on the command line. If multiple versions of the same package are involved, care must be taken to ensure that the correct version is added last. In particular, note that lexical order used by the shell depends on the locale and differs from the {{man|8|vercmp}} ordering used by &#039;&#039;pacman&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
If you are looking to support multiple architectures, then precautions should be taken to prevent errors from occurring. Each architecture should have its own directory tree:&lt;br /&gt;
&lt;br /&gt;
{{hc|$ tree ~/customrepo/ {{!}} sed &amp;quot;s/$(uname -m)/&#039;&#039;arch&#039;&#039;/g&amp;quot;|&lt;br /&gt;
/home/archie/customrepo/&lt;br /&gt;
└── &#039;&#039;arch&#039;&#039;&lt;br /&gt;
    ├── customrepo.db -&amp;gt; customrepo.db.tar.zst&lt;br /&gt;
    ├── customrepo.db.tar.zst&lt;br /&gt;
    ├── customrepo.files -&amp;gt; customrepo.files.tar.zst&lt;br /&gt;
    ├── customrepo.files.tar.zst&lt;br /&gt;
    └── personal-website-git-b99cce0-1-&#039;&#039;arch&#039;&#039;.pkg.tar.zst&lt;br /&gt;
&lt;br /&gt;
1 directory, 5 files&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;repo-add&#039;&#039; executable checks whether the package is appropriate. If this is not the case, you will be running into error messages similar to this:&lt;br /&gt;
&lt;br /&gt;
 ==&amp;gt; ERROR: &#039;/home/archie/customrepo/&#039;&#039;arch&#039;&#039;/foo-&#039;&#039;arch&#039;&#039;.pkg.tar.zst&#039; does not have a valid database archive extension.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;repo-remove&#039;&#039; is used to remove packages from the package database, except that only package names are specified on the command line.&lt;br /&gt;
&lt;br /&gt;
 $ repo-remove &#039;&#039;/path/to/repo.db.tar.zst pkgname&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Once the local repository database has been created, add the repository to {{ic|/etc/pacman.conf}} of each system that is to use the repository. An example of a custom repository is in {{ic|/etc/pacman.conf}}. The repository&#039;s name is the database filename with the file extension omitted. In the example above the repository&#039;s name simply is &#039;&#039;repo&#039;&#039;. Reference the repository&#039;s location using a {{ic|file://}} URL, or via HTTP using {{ic|&amp;lt;nowiki&amp;gt;http://localhost/path/to/directory&amp;lt;/nowiki&amp;gt;}}.&lt;br /&gt;
&lt;br /&gt;
If willing, add the custom repository to the [[Unofficial user repositories|list of unofficial user repositories]], so that the community can benefit from it.&lt;br /&gt;
&lt;br /&gt;
=== Network shared pacman cache ===&lt;br /&gt;
&lt;br /&gt;
See [[Package proxy cache]].&lt;br /&gt;
&lt;br /&gt;
=== Recreate a package from the file system ===&lt;br /&gt;
&lt;br /&gt;
To recreate a package from the file system, use {{AUR|fakepkg}}. Files from the system are taken as they are, hence any modifications will be present in the assembled package. Distributing the recreated package is therefore discouraged; see [[ABS]] and [[Arch Linux Archive]] for alternatives.&lt;br /&gt;
&lt;br /&gt;
=== List of installed packages ===&lt;br /&gt;
&lt;br /&gt;
Keeping a list of all explicitly installed packages can be useful to backup a system or quicken the installation of a new one:&lt;br /&gt;
&lt;br /&gt;
 $ pacman -Qqe &amp;gt; pkglist.txt&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* With option {{ic|-t}}, the packages already required by other explicitly installed packages are not mentioned. If reinstalling from this list they will be installed but as dependencies only.&lt;br /&gt;
* With option {{ic|-n}}, foreign packages (e.g. from [[AUR]]) would be omitted from the list.&lt;br /&gt;
* Use {{ic|comm -13 &amp;lt;(pacman -Qqdt {{!}} sort) &amp;lt;(pacman -Qqdtt {{!}} sort) &amp;gt; optdeplist.txt}} to also create a list of the installed optional dependencies which can be reinstalled with {{ic|--asdeps}}.&lt;br /&gt;
* Use {{ic|pacman -Qqem &amp;gt; foreignpkglist.txt}} to create the list of AUR and other foreign packages that have been explicitly installed.}}&lt;br /&gt;
&lt;br /&gt;
To keep an up-to-date list of explicitly installed packages (e.g. in combination with a versioned {{ic|/etc/}}), you can set up a [[Pacman#Hooks|hook]]. Example:&lt;br /&gt;
&lt;br /&gt;
 [Trigger]&lt;br /&gt;
 Operation = Install&lt;br /&gt;
 Operation = Remove&lt;br /&gt;
 Type = Package&lt;br /&gt;
 Target = *&lt;br /&gt;
 &lt;br /&gt;
 [Action]&lt;br /&gt;
 When = PostTransaction&lt;br /&gt;
 Exec = /bin/sh -c &#039;/usr/bin/pacman -Qqe &amp;gt; /etc/pkglist.txt&#039;&lt;br /&gt;
&lt;br /&gt;
=== Install packages from a list ===&lt;br /&gt;
&lt;br /&gt;
To install packages from a previously saved list of packages, while not reinstalling previously installed packages that are already up-to-date, run:&lt;br /&gt;
&lt;br /&gt;
 # pacman -S --needed - &amp;lt; pkglist.txt&lt;br /&gt;
&lt;br /&gt;
However, it is likely foreign packages such as from the AUR or installed locally are present in the list. To filter out from the list the foreign packages, the previous command line can be enriched as follows:&lt;br /&gt;
&lt;br /&gt;
 # pacman -S --needed $(comm -12 &amp;lt;(pacman -Slq | sort) &amp;lt;(sort pkglist.txt))&lt;br /&gt;
&lt;br /&gt;
Eventually, to make sure the installed packages of your system match the list and remove all the packages that are not mentioned in it:&lt;br /&gt;
&lt;br /&gt;
 # pacman -Rsu $(comm -23 &amp;lt;(pacman -Qq | sort) &amp;lt;(sort pkglist.txt))&lt;br /&gt;
&lt;br /&gt;
{{Tip|These tasks can be automated. See {{AUR|bacpac}}, {{AUR|packup}}, {{AUR|pacmanity}}, and {{AUR|pug}} for examples.}}&lt;br /&gt;
&lt;br /&gt;
=== Listing all changed files from packages ===&lt;br /&gt;
&lt;br /&gt;
If you are suspecting file corruption (e.g. by software/hardware failure), but are unsure if files were corrupted, you might want to compare with the hash sums in the packages. This can be done with {{Pkg|pacutils}}:&lt;br /&gt;
&lt;br /&gt;
 # paccheck --sha256sum --quiet&lt;br /&gt;
&lt;br /&gt;
For recovery of the database see [[#Restore pacman&#039;s local database]]. The {{ic|mtree}} files can also be [[#Viewing files inside remote .pkg files|extracted as .MTREE from the respective package files]].&lt;br /&gt;
&lt;br /&gt;
{{Note|This should &#039;&#039;&#039;not&#039;&#039;&#039; be used as is when suspecting malicious changes! In this case security precautions such as using a live medium and an independent source for the hash sums are advised.}}&lt;br /&gt;
&lt;br /&gt;
=== Reinstalling all packages ===&lt;br /&gt;
&lt;br /&gt;
To reinstall all native packages, use:&lt;br /&gt;
&lt;br /&gt;
 # pacman -Qqn | pacman -S -&lt;br /&gt;
&lt;br /&gt;
Foreign (AUR) packages must be reinstalled separately; you can list them with {{ic|pacman -Qqm}}.&lt;br /&gt;
&lt;br /&gt;
Pacman preserves the [[installation reason]] by default.&lt;br /&gt;
&lt;br /&gt;
{{Warning|To force all packages to be overwritten, use {{ic|1=--overwrite=*}}, though this should be an absolute last resort. See [[System maintenance#Avoid certain pacman commands]].}}&lt;br /&gt;
&lt;br /&gt;
=== Restore pacman&#039;s local database ===&lt;br /&gt;
&lt;br /&gt;
See [[pacman/Restore local database]].&lt;br /&gt;
&lt;br /&gt;
=== Recovering broken install from existing install ===&lt;br /&gt;
&lt;br /&gt;
If you have managed to mess up an Arch install with broken packages, it is possible to re-install all the packages and hopefully get it back up and working again (assuming the root of the broken install is mounted in {{ic|/brokenArch}})&lt;br /&gt;
&lt;br /&gt;
 # pacman -S $(pacman -Qq --dbpath /brokenArch/var/lib/pacman) --root /brokenArch --dbpath /brokenArch/var/lib/pacman&lt;br /&gt;
&lt;br /&gt;
=== Viewing files inside remote .pkg files ===&lt;br /&gt;
&lt;br /&gt;
{{Pkg|paccat}} is a small utility that finds which package contains a given file, downloads it and then prints the contents. This can be used to read specific files, restore changed files back to their initial state, and extract files without installing the package.&lt;br /&gt;
&lt;br /&gt;
For example, if you want to see the contents of {{ic|/etc/systemd/logind.conf}} supplied within the {{Pkg|systemd}} package:&lt;br /&gt;
&lt;br /&gt;
 $ paccat systemd etc/systemd/logind.conf&lt;br /&gt;
&lt;br /&gt;
Or if you want to see the contents of {{ic|archive.h}} supplied by any package:&lt;br /&gt;
&lt;br /&gt;
 $ paccat -F archive.h&lt;br /&gt;
&lt;br /&gt;
{{ic|bsdtar}} can also be used to show the contents:&lt;br /&gt;
&lt;br /&gt;
 $ bsdtar -xOf /var/cache/pacman/pkg/systemd-250.4-2-x86_64.pkg.tar.zst etc/systemd/logind.conf&lt;br /&gt;
&lt;br /&gt;
Or you can use {{Pkg|vim}} to browse the archive:&lt;br /&gt;
&lt;br /&gt;
 $ vim /var/cache/pacman/pkg/systemd-250.4-2-x86_64.pkg.tar.zst&lt;br /&gt;
&lt;br /&gt;
=== Find applications that use libraries from older packages ===&lt;br /&gt;
&lt;br /&gt;
Already running processes do not automatically notice changes caused by updates. Instead, they continue using old library versions. That may be undesirable, due to potential issues related to security vulnerabilities or other bugs, and version incompatibility.&lt;br /&gt;
&lt;br /&gt;
Processes depending on updated libraries may be found using either {{Pkg|htop}}, which highlights the names of the affected programs, or with a snippet based on {{Pkg|lsof}}, which also prints the names of the libraries:&lt;br /&gt;
&lt;br /&gt;
 # lsof +c 0 | grep -w DEL | awk &#039;1 { print $1 &amp;quot;: &amp;quot; $NF }&#039; | sort -u&lt;br /&gt;
&lt;br /&gt;
This solution will only detect files, that are normally kept opened by running processes, which basically limits it to shared libraries ({{ic|.so}} files). It may miss some dependencies, like those of Java or Python applications.&lt;br /&gt;
&lt;br /&gt;
=== Installing only content in required languages ===&lt;br /&gt;
&lt;br /&gt;
Many packages install documentation and translations in several languages. Some programs are designed to remove such unnecessary files, such as {{AUR|localepurge}}, which runs after a package is installed to delete the unneeded locale files. A more preemptive approach is provided through the {{ic|NoExtract}} directive in {{ic|/etc/pacman.conf}}, which prevent these files from ever being installed.&lt;br /&gt;
&lt;br /&gt;
{{Note|As explained in [[Pacman#Skip files from being installed to system]], &amp;quot;later rules override previous ones, and you can negate a rule by prepending {{ic|!}}&amp;quot;.}}&lt;br /&gt;
&lt;br /&gt;
To prevent the installation of all translations for help files, except for the C locale, add:&lt;br /&gt;
&lt;br /&gt;
 NoExtract = usr/share/help/* !usr/share/help/C/*&lt;br /&gt;
&lt;br /&gt;
To prevent the installation of all the HTML documentation, add:&lt;br /&gt;
&lt;br /&gt;
 NoExtract = usr/share/gtk-doc/html/*&lt;br /&gt;
 NoExtract = usr/share/doc/HTML/*&lt;br /&gt;
&lt;br /&gt;
{{Warning|1=Some users noted that removing &#039;&#039;&#039;all&#039;&#039;&#039; locales has resulted in unintended consequences with [[Special:Permalink/460285#Dangerous NoExtract example|dmenu]], [[Special:Permalink/767628#Languages: NoExtract usr/share/X11/locale/*|Steam]], even under [https://bbs.archlinux.org/viewtopic.php?id=250846 Xorg]. The following example is adjusted to avoid such issues, by installing only English (US) files and the required C locales.}}&lt;br /&gt;
&lt;br /&gt;
To prevent the installation of the various [[locale]]s, except the required ones, add:&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
NoExtract = usr/share/locale/* usr/share/X11/locale/*/* usr/share/i18n/locales/* opt/google/chrome/locales/* !usr/share/X11/locale/C/* !usr/share/X11/locale/en_US.UTF-8/*&lt;br /&gt;
NoExtract = !usr/share/X11/locale/compose.dir !usr/share/X11/locale/iso8859-1/*&lt;br /&gt;
NoExtract = !*locale*/en*/* !usr/share/*locale*/locale.*&lt;br /&gt;
NoExtract = !usr/share/*locales/en_?? !usr/share/*locales/i18n* !usr/share/*locales/iso*&lt;br /&gt;
NoExtract = usr/share/i18n/charmaps/* !usr/share/i18n/charmaps/UTF-8.gz !usr/share/i18n/charmaps/ANSI_X3.4-1968.gz&lt;br /&gt;
NoExtract = !usr/share/*locales/trans*&lt;br /&gt;
NoExtract = !usr/share/*locales/C !usr/share/*locales/POSIX&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To prevent the installation of the translated [[man page]]s, add:&lt;br /&gt;
&lt;br /&gt;
 NoExtract = usr/share/man/* !usr/share/man/man*&lt;br /&gt;
&lt;br /&gt;
To prevent the installation of the language files in {{Pkg|vim-runtime}}, add:&lt;br /&gt;
&lt;br /&gt;
 NoExtract = usr/share/vim/vim*/lang/*&lt;br /&gt;
&lt;br /&gt;
To prevent the installation of all but English content in [[Qt]] applications, add:&lt;br /&gt;
&lt;br /&gt;
 NoExtract = usr/share/*/translations/*.qm !usr/share/*/translations/*en.qm usr/share/*/nls/*.qm usr/share/qt/phrasebooks/*.qph usr/share/qt/translations/*.pak !*/en-US.pak&lt;br /&gt;
&lt;br /&gt;
To prevent the installation of all but English content in [[Chromium]] and [[Electron]] applications, add:&lt;br /&gt;
&lt;br /&gt;
 NoExtract = usr/share/*/locales/*.pak opt/*/locales/*.pak usr/lib/*/locales/*.pak !*/en-US.pak&lt;br /&gt;
&lt;br /&gt;
To prevent the installation of English help files in [[LibreOffice]], add:&lt;br /&gt;
&lt;br /&gt;
 NoExtract = usr/lib/libreoffice/help/en-US/*&lt;br /&gt;
&lt;br /&gt;
To prevent the installation of all but English content from [[List of applications/Documents#Office suites|OnlyOffice]], add:&lt;br /&gt;
&lt;br /&gt;
{{bc|1=&lt;br /&gt;
NoExtract = opt/onlyoffice/desktopeditors/dictionaries/* !opt/onlyoffice/desktopeditors/dictionaries/en_US/*&lt;br /&gt;
NoExtract = opt/onlyoffice/desktopeditors/editors/web-apps/apps/*/main/locale/* !*/en.json&lt;br /&gt;
NoExtract = opt/onlyoffice/desktopeditors/editors/web-apps/apps/*/main/resources/help/*/* !*/help/en/*&lt;br /&gt;
NoExtract = opt/onlyoffice/desktopeditors/editors/web-apps/apps/*/main/resources/symboltable/* !*/en.json&lt;br /&gt;
NoExtract = opt/onlyoffice/desktopeditors/editors/web-apps/apps/documenteditor/forms/locale/* !*/en.json&lt;br /&gt;
NoExtract = opt/onlyoffice/desktopeditors/editors/web-apps/apps/spreadsheeteditor/main/resources/formula-lang/* !*/en.json !*/en_desc.json&lt;br /&gt;
NoExtract = opt/onlyoffice/desktopeditors/converter/empty/*/* !opt/onlyoffice/desktopeditors/converter/empty/en-US/*&lt;br /&gt;
NoExtract = opt/onlyoffice/desktopeditors/converter/templates/*/* !opt/onlyoffice/desktopeditors/converter/templates/EN/*&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To prevent the installation of all but the English [[iBus]] dictionary for emojis, add:&lt;br /&gt;
&lt;br /&gt;
 NoExtract = usr/share/ibus/dicts/emoji-*.dict !usr/share/ibus/dicts/emoji-en.dict&lt;br /&gt;
&lt;br /&gt;
=== Installing packages on bad connection ===&lt;br /&gt;
&lt;br /&gt;
When trying to install a package from a bad connection (e.g. a train using a cell phone), use the {{ic|--disable-download-timeout}} option to lessen the chance of receiving errors such as:&lt;br /&gt;
&lt;br /&gt;
 error: failed retrieving file […] Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 error: failed retrieving file […] Operation timed out after 10014 milliseconds with 0 out of 0 bytes received&lt;br /&gt;
&lt;br /&gt;
== Performance ==&lt;br /&gt;
&lt;br /&gt;
=== Download speeds ===&lt;br /&gt;
&lt;br /&gt;
When downloading packages &#039;&#039;pacman&#039;&#039; uses the mirrors in the order they are in {{ic|/etc/pacman.d/mirrorlist}}. The mirror which is at the top of the list by default however may not be the fastest for you. To select a faster mirror, see [[Mirrors]].&lt;br /&gt;
&lt;br /&gt;
Pacman&#039;s speed in downloading packages can also be improved by using [[pacman#Parallel downloads|parallel downloads]], a major feature request ({{Bug|20056}}) added with [https://gitlab.archlinux.org/pacman/pacman/-/blob/master/NEWS#L80 pacman 6.0.0]. It is enabled by default since [https://gitlab.archlinux.org/archlinux/packaging/packages/pacman/-/commit/e151844c10fab9f8ea070f9cb24a63675298303c pacman 7.0.0].&lt;br /&gt;
&lt;br /&gt;
Instead of &#039;&#039;pacman&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;s built-in file downloader, a separate application can also be used to download packages.&lt;br /&gt;
&lt;br /&gt;
In all cases, make sure you have the latest &#039;&#039;pacman&#039;&#039; before doing any modifications.&lt;br /&gt;
&lt;br /&gt;
 # pacman -Syu&lt;br /&gt;
&lt;br /&gt;
==== wget ====&lt;br /&gt;
&lt;br /&gt;
This is very handy if you need more powerful proxy settings than &#039;&#039;pacman&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;s built-in capabilities.&lt;br /&gt;
&lt;br /&gt;
To use {{ic|wget}}, first [[install]] the {{Pkg|wget}} package then modify {{ic|/etc/pacman.conf}} by uncommenting the following line in the {{ic|[options]}} section:&lt;br /&gt;
&lt;br /&gt;
 XferCommand = /usr/bin/wget --passive-ftp --show-progress -c -q -N %u&lt;br /&gt;
&lt;br /&gt;
Instead of uncommenting the {{ic|wget}} parameters in {{ic|/etc/pacman.conf}}, you can also modify the {{ic|wget}} configuration file directly (the system-wide file is {{ic|/etc/wgetrc}}, per user files are {{ic|$HOME/.wgetrc}}).&lt;br /&gt;
&lt;br /&gt;
==== aria2 ====&lt;br /&gt;
&lt;br /&gt;
[[aria2]] is a lightweight download utility with support for resumable and segmented HTTP/HTTPS and FTP downloads. aria2 allows for multiple and simultaneous HTTP/HTTPS and FTP connections to an Arch mirror, which should result in an increase in download speeds for both file and package retrieval.&lt;br /&gt;
&lt;br /&gt;
Install {{Pkg|aria2}}, then edit {{ic|/etc/pacman.conf}} by adding the following line to the {{ic|[options]}} section:&lt;br /&gt;
&lt;br /&gt;
 XferCommand = /usr/bin/aria2c --allow-overwrite=true --continue=true --file-allocation=none --log-level=error --max-tries=2 --max-connection-per-server=2 --max-file-not-found=5 --min-split-size=5M --no-conf --remote-time=true --summary-interval=60 --timeout=5 --dir=/ --out %o %u&lt;br /&gt;
&lt;br /&gt;
{{Tip|1=[https://bbs.archlinux.org/viewtopic.php?pid=1491879#p1491879 This alternative configuration for using pacman with aria2] tries to simplify configuration and adds more configuration options.}}&lt;br /&gt;
&lt;br /&gt;
See {{man|1|aria2c|OPTIONS}} for used aria2c options.&lt;br /&gt;
&lt;br /&gt;
* {{ic|-d, --dir}}: The directory to store the downloaded file(s) as specified by &#039;&#039;pacman&#039;&#039;.&lt;br /&gt;
* {{ic|-o, --out}}: The output file name(s) of the downloaded file(s).&lt;br /&gt;
* {{ic|%o}}: Variable which represents the local filename(s) as specified by &#039;&#039;pacman&#039;&#039;.&lt;br /&gt;
* {{ic|%u}}: Variable which represents the download URL as specified by &#039;&#039;pacman&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Other applications ====&lt;br /&gt;
&lt;br /&gt;
There are other downloading applications that you can use with &#039;&#039;pacman&#039;&#039;. Here they are, and their associated XferCommand settings:&lt;br /&gt;
&lt;br /&gt;
* {{ic|snarf}}: {{ic|1=XferCommand = /usr/bin/snarf -N %u}}&lt;br /&gt;
* {{ic|lftp}}: {{ic|1=XferCommand = /usr/bin/lftp -c pget %u}}&lt;br /&gt;
* {{ic|axel}}: {{ic|1=XferCommand = /usr/bin/axel -n 2 -v -a -o %o %u}}&lt;br /&gt;
* {{ic|hget}}: {{ic|1=XferCommand = /usr/bin/hget %u -n 2 -skip-tls false}} (please read the [https://github.com/huydx/hget documentation on the Github project page] for more info)&lt;br /&gt;
* {{ic|saldl}}: {{ic|1=XferCommand = /usr/bin/saldl -c6 -l4 -s2m -o %o %u}} (please read the [https://saldl.github.io documentation on the project page] for more info)&lt;br /&gt;
&lt;br /&gt;
== Utilities ==&lt;br /&gt;
&lt;br /&gt;
{{Tip|Many of the (unsupported) [[AUR helpers]] also function as Pacman wrappers, some of which are graphical.}}&lt;br /&gt;
&lt;br /&gt;
* {{App|isfree|A Bash script to list non-free packages. Based on Parabola&#039;s blacklist.|https://github.com/leo-arch/isfree|{{AUR|isfree}}}}&lt;br /&gt;
* {{App|Lostfiles|Script that identifies files not owned by any package.|https://github.com/graysky2/lostfiles|{{Pkg|lostfiles}}}}&lt;br /&gt;
* {{App|pacutils|Helper library for libalpm based programs.|https://github.com/andrewgregory/pacutils|{{Pkg|pacutils}}}}&lt;br /&gt;
* {{App|[[pkgfile]]|Tool that finds what package owns a file.|https://github.com/falconindy/pkgfile|{{Pkg|pkgfile}}}}&lt;br /&gt;
* {{App|pkgtop|Interactive package manager and resource monitor designed for the GNU/Linux.|https://github.com/orhun/pkgtop|{{AUR|pkgtop-git}}}}&lt;br /&gt;
* {{App|repoctl|Tool to help manage local repositories.|https://github.com/cassava/repoctl|{{AUR|repoctl}}}}&lt;br /&gt;
* {{App|repose|An Arch Linux repository building tool.|https://github.com/vodik/repose|{{Pkg|repose}}}}&lt;br /&gt;
* {{App|[[Snapper#Wrapping pacman transactions in snapshots|snap-pac]]|Make &#039;&#039;pacman&#039;&#039; automatically use snapper to create pre/post snapshots like openSUSE&#039;s YaST.|https://github.com/wesbarnett/snap-pac|{{Pkg|snap-pac}}}}&lt;br /&gt;
* {{App|vrms-arch|A virtual Richard M. Stallman to tell you which non-free packages are installed.|https://github.com/orospakr/vrms-arch|{{AUR|vrms-arch-git}}}}&lt;br /&gt;
&lt;br /&gt;
=== Graphical ===&lt;br /&gt;
&lt;br /&gt;
{{Warning|PackageKit opens up system permissions by default, and is otherwise [https://github.com/archlinux/archinstall/issues/1321#issuecomment-1151343223 not recommended] for general usage. See {{Bug|50459}} and {{Bug|57943}}.}}&lt;br /&gt;
&lt;br /&gt;
* {{App|Discover|Qt application manager using PackageKit written in C++/QML. Supports [https://www.freedesktop.org/wiki/Distributions/AppStream/ AppStream metadata], [[Flatpak]] and [[fwupd|firmware updates]]. Part of {{Grp|plasma}}.|https://apps.kde.org/discover/|{{Pkg|discover}}}}&lt;br /&gt;
* {{App|GNOME PackageKit|GTK package manager using PackageKit written in C.|https://freedesktop.org/software/PackageKit/|{{Pkg|gnome-packagekit}}}}&lt;br /&gt;
* {{App|pcurses|Curses TUI &#039;&#039;pacman&#039;&#039; wrapper written in C++.|https://github.com/schuay/pcurses|{{AUR|pcurses}}}}&lt;br /&gt;
* {{App|tkPacman|Tk pacman wrapper written in Tcl.|https://sourceforge.net/projects/tkpacman|{{AUR|tkpacman}}}}&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=User_talk:Indigo&amp;diff=873422</id>
		<title>User talk:Indigo</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=User_talk:Indigo&amp;diff=873422"/>
		<updated>2026-05-09T13:47:00Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Configuring MAC address randomization */ re, close&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Feel free to leave comments about my wiki edits or other points of interest. Please note my account does not automatically watch articles I edit, but I have enabled [[Special:Preferences#mw-prefsection-echo|web notifications]]. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 17:47, 16 November 2024 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;s&amp;gt; Configuring MAC address randomization &amp;lt;/s&amp;gt;==&lt;br /&gt;
&lt;br /&gt;
Hi! The accuracy template for [[NetworkManager#Configuring MAC address randomization]] says an entry should be provided at [[MAC address spoofing#iwd]]. Please refer to the 1st note point in that section which talks specifically about that issue. The accuracy template is for disputed facts, but the note explicitly talks about the issue. Please clarify what the dispute is about. [[User:TheKnightSky|TheKnightSky]] ([[User talk:TheKnightSky|talk]]) 11:59, 8 May 2026 (UTC)&lt;br /&gt;
&lt;br /&gt;
:Done with [https://wiki.archlinux.org/index.php?title=NetworkManager&amp;amp;diff=873421&amp;amp;oldid=873284]. Closing. You&#039;re welcome to adjust it or re-open this if unclear. An accuracy template always refers to the section it is added to, i.e. the crosslink was a suggestion to point to the section with the resolution. --[[User:Indigo|Indigo]] ([[User talk:Indigo|talk]]) 13:47, 9 May 2026 (UTC)&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=NetworkManager&amp;diff=873421</id>
		<title>NetworkManager</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=NetworkManager&amp;diff=873421"/>
		<updated>2026-05-09T13:31:44Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Configuring MAC address randomization */ add diff reference to template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Network managers]]&lt;br /&gt;
[[Category:DHCP]]&lt;br /&gt;
[[ar:Networkmanager]]&lt;br /&gt;
[[de:Networkmanager]]&lt;br /&gt;
[[fr:NetworkManager]]&lt;br /&gt;
[[hu:NetworkManager]]&lt;br /&gt;
[[ja:NetworkManager]]&lt;br /&gt;
[[pt:NetworkManager]]&lt;br /&gt;
[[ru:NetworkManager]]&lt;br /&gt;
[[zh-hans:NetworkManager]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|NetworkManager/Privacy}}&lt;br /&gt;
{{Related|Network configuration}}&lt;br /&gt;
{{Related|Wireless network configuration}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:NetworkManager|NetworkManager]] is a program for providing detection and configuration for systems to automatically connect to networks.&lt;br /&gt;
&lt;br /&gt;
[https://networkmanager.dev/ NetworkManager] can be useful for both wireless and wired networks. For wireless networks, NetworkManager prefers known wireless networks and has the ability to switch to the most reliable network.  NetworkManager-aware applications can switch from online and offline mode.&lt;br /&gt;
&lt;br /&gt;
NetworkManager also prefers wired connections over wireless ones, has support for modem connections and certain types of VPN.&lt;br /&gt;
&lt;br /&gt;
{{Warning|By default, secrets—e.g. Wi-Fi passwords—are accessible to the root user in the filesystem and to users with access to settings via the GUI (e.g. via [[#nm-applet]]). For more information, see [[#Encrypted Wi-Fi passwords]].}}&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
NetworkManager can be [[install]]ed with the package {{Pkg|networkmanager}}, which contains a daemon, a command line interface (&#039;&#039;nmcli&#039;&#039;) and a curses‐based interface (&#039;&#039;nmtui&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
=== Enable NetworkManager ===&lt;br /&gt;
&lt;br /&gt;
After installation, you should [[start/enable]] {{ic|NetworkManager.service}}. Once the NetworkManager daemon is started, it will automatically connect to any available &amp;quot;system connections&amp;quot; that have already been configured. Any &amp;quot;user connections&amp;quot; or unconfigured connections will need &#039;&#039;nmcli&#039;&#039; or an applet to configure and connect.&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* Each network interface should be managed by only one [[Network configuration#Network managers|DHCP client or network manager]], so it is advised to run only one DHCP client or network manager on the system. Find a list of the currently running services with {{ic|1=systemctl --type=service}} and then [[stop]] or reconfigure those that conflict.&lt;br /&gt;
* If [[systemd-resolved]] is not [[started]], an error message will start flooding your logs. See [[#Unit dbus-org.freedesktop.resolve1.service not found]] for more info.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Additional interfaces ===&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|nm-connection-editor}} for a graphical user interface,&lt;br /&gt;
* {{Pkg|network-manager-applet}} for a system tray applet (see the [[#nm-applet]] section).&lt;br /&gt;
&lt;br /&gt;
=== Mobile broadband support ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager uses [[ModemManager]] for mobile broadband connection support.&lt;br /&gt;
&lt;br /&gt;
[[Install]] {{Pkg|modemmanager}} and {{Pkg|usb_modeswitch}}. Afterwards [[enable]] and [[start]] {{ic|ModemManager.service}}.&lt;br /&gt;
&lt;br /&gt;
It may be necessary to [[restart]] {{ic|NetworkManager.service}} for it to detect ModemManager. After you restart it, re-plug the modem again and it should be recognized. &lt;br /&gt;
&lt;br /&gt;
Add connections from a front-end (e.g. {{Pkg|nm-connection-editor}}) and select mobile broadband as the connection type. After selecting your ISP and billing plan, [[Wikipedia:Access Point Name|APN]] and other settings should be filled in automatically using information from {{Pkg|mobile-broadband-provider-info}}.&lt;br /&gt;
&lt;br /&gt;
=== PPPoE / DSL support ===&lt;br /&gt;
&lt;br /&gt;
[[Install]] {{Pkg|ppp}} package for PPPoE / DSL connection support. To actually add PPPoE connection, use {{ic|1=nm-connection-editor}} and add new DSL/PPPoE connection.&lt;br /&gt;
&lt;br /&gt;
=== VPN support ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager since version 1.16 has native support for [[WireGuard]], all it needs is the {{ic|wireguard}} kernel module. Read the [https://blogs.gnome.org/thaller/2019/03/15/wireguard-in-networkmanager/ WireGuard in NetworkManager blog post] for details.&lt;br /&gt;
&lt;br /&gt;
Support for other VPN types is based on a plug-in system. They are provided in the following packages:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|networkmanager-openconnect}} for [[OpenConnect]]&lt;br /&gt;
* {{Pkg|networkmanager-openvpn}} for [[OpenVPN]]&lt;br /&gt;
* {{Pkg|networkmanager-pptp}} for [[PPTP Client]]&lt;br /&gt;
* {{Pkg|networkmanager-strongswan}} for [[strongSwan]]&lt;br /&gt;
* {{Pkg|networkmanager-vpnc}}&lt;br /&gt;
* {{AUR|networkmanager-fortisslvpn}}&lt;br /&gt;
* {{AUR|networkmanager-iodine-git}}&lt;br /&gt;
* {{AUR|networkmanager-libreswan}}&lt;br /&gt;
* {{Pkg|networkmanager-l2tp}}&lt;br /&gt;
* {{AUR|networkmanager-ssh}}&lt;br /&gt;
* {{Pkg|network-manager-sstp}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|1=There are a lot of [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues?search=VPN&amp;amp;state=opened bugs] related to VPN support. Check the daemon processes options set via the GUI correctly and double-check with each package release.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* To have fully functioning DNS resolution when using VPN, you should set up [[#DNS caching and conditional forwarding|conditional forwarding]].&lt;br /&gt;
* These plug-ins may not have a documented command line interface, or may not work at all without an applet running. This is not an issue if you are using a regular desktop environment; if you are not, you should run [[#nm-applet]] while configuring or activating the connection so that you get the necessary dialogues. [https://bbs.archlinux.org/viewtopic.php?id{{=}}246698]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
NetworkManager comes with {{man|1|nmcli}} and {{man|1|nmtui}}.&lt;br /&gt;
&lt;br /&gt;
=== nmcli examples ===&lt;br /&gt;
&lt;br /&gt;
List nearby Wi-Fi networks:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli device wifi list&lt;br /&gt;
&lt;br /&gt;
Connect to a Wi-Fi network:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli device wifi connect &#039;&#039;SSID_or_BSSID&#039;&#039; password &#039;&#039;password&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Connect to a hidden Wi-Fi network:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli device wifi connect &#039;&#039;SSID_or_BSSID&#039;&#039; password &#039;&#039;password&#039;&#039; hidden yes&lt;br /&gt;
&lt;br /&gt;
Connect to a Wi-Fi on the {{ic|wlan1}} interface:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli device wifi connect &#039;&#039;SSID_or_BSSID&#039;&#039; password &#039;&#039;password&#039;&#039; ifname wlan1 &#039;&#039;profile_name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Disconnect an interface:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli device disconnect ifname eth0&lt;br /&gt;
&lt;br /&gt;
Get a list of connections with their names, UUIDs, types and backing devices:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection show&lt;br /&gt;
&lt;br /&gt;
Activate a connection (i.e. connect to a network with an existing profile):&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection up &#039;&#039;name_or_uuid&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete a connection:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection delete &#039;&#039;name_or_uuid&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See a list of network devices and their state:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli device&lt;br /&gt;
&lt;br /&gt;
Turn off Wi-Fi:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli radio wifi off&lt;br /&gt;
&lt;br /&gt;
=== Edit a connection ===&lt;br /&gt;
&lt;br /&gt;
For a comprehensive list of settings, see {{man|5|nm-settings}}.&lt;br /&gt;
&lt;br /&gt;
Firstly, you need to get a list of connections:&lt;br /&gt;
&lt;br /&gt;
{{hc|$ nmcli connection|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
NAME                UUID                                  TYPE      DEVICE&lt;br /&gt;
Wired connection 2  e7054040-a421-3bef-965d-bb7d60b7cecf  ethernet  enp5s0&lt;br /&gt;
Wired connection 1  997f2782-f0fc-301d-bfba-15421a2735d8  ethernet  enp0s25&lt;br /&gt;
MY-HOME-WIFI-5G     92a0f7b3-2eba-49ab-a899-24d83978f308  wifi       --&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Here you can use the first column as connection-id used later. In this example, we pick {{ic|Wired connection 2}} as a connection-id.&lt;br /&gt;
&lt;br /&gt;
You have three methods to configure a connection {{ic|Wired connection 2}} after it has been created:&lt;br /&gt;
&lt;br /&gt;
; nmcli interactive editor&lt;br /&gt;
: {{ic|nmcli connection edit &#039;Wired connection 2&#039;}}.&amp;lt;br&amp;gt; Usage is well documented from the editor.&lt;br /&gt;
&lt;br /&gt;
; nmcli command line interface&lt;br /&gt;
: {{ic|nmcli connection modify &#039;Wired connection 2&#039; &#039;&#039;setting&#039;&#039;.&#039;&#039;property&#039;&#039; &#039;&#039;value&#039;&#039;}}. See {{man|1|nmcli}} for usage. For example, you can change its IPv4 route metric to 200 using {{ic|nmcli connection modify &#039;Wired connection 2&#039; ipv4.route-metric 200}} command.&lt;br /&gt;
To remove a setting, pass an empty field (&amp;quot;&amp;quot;) to it like this:&lt;br /&gt;
: {{ic|nmcli connection modify &#039;Wired connection 2&#039; &#039;&#039;setting&#039;&#039;.&#039;&#039;property&#039;&#039; &amp;quot;&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
; Connection file&lt;br /&gt;
: In {{ic|/etc/NetworkManager/system-connections/}}, modify the corresponding {{ic|Wired connection 2.nmconnection}} file .&amp;lt;br&amp;gt; Do not forget to reload the configuration file with {{ic|nmcli connection reload}}.&lt;br /&gt;
&lt;br /&gt;
=== nmtui ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager ships a text user interface (TUI) for managing connections, the system hostname and radio switches. It can be launched by running {{ic|nmtui}}.&lt;br /&gt;
&lt;br /&gt;
== Front-ends ==&lt;br /&gt;
&lt;br /&gt;
To provide integration with a [[desktop environment]], most users will want to install an applet. This not only provides easy access to network selection and configuration, but also provides the agent necessary for securely storing secrets. Various desktop environments have their own applet; otherwise, you can use [[#nm-applet]].&lt;br /&gt;
&lt;br /&gt;
=== GNOME ===&lt;br /&gt;
&lt;br /&gt;
[[GNOME]] has a built-in tool, accessible from the Network settings.&lt;br /&gt;
&lt;br /&gt;
=== KDE Plasma ===&lt;br /&gt;
&lt;br /&gt;
[[Install]] the {{Pkg|plasma-nm}} package. After that, add it to the KDE taskbar via the &#039;&#039;Panel options &amp;gt; Add widgets &amp;gt; Networks&#039;&#039; menu.&lt;br /&gt;
&lt;br /&gt;
=== nm-applet ===&lt;br /&gt;
&lt;br /&gt;
{{Pkg|network-manager-applet}} is a GTK 3 front-end which works under Xorg environments with a systray.&lt;br /&gt;
&lt;br /&gt;
To store connection secrets install and configure an application which implements the [https://specifications.freedesktop.org/secret-service-spec/latest/ Secret Service D-Bus API] such as [[GNOME/Keyring]], [[KDE Wallet]], or [[KeePassXC]].&lt;br /&gt;
&lt;br /&gt;
Be aware that after enabling the tick-box option {{ic|Make available to other users}} for a connection, NetworkManager stores the password in plain-text, though the respective file is accessible only to root (or other users via {{ic|nm-applet}}). See [[#Encrypted Wi-Fi passwords]].&lt;br /&gt;
&lt;br /&gt;
In order to run {{ic|nm-applet}} without a systray, you can use {{AUR|trayer}} or {{Pkg|stalonetray}}. For example, you can add a script like this one in your path:&lt;br /&gt;
&lt;br /&gt;
{{hc|nmgui|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
nm-applet    2&amp;gt;&amp;amp;1 &amp;gt; /dev/null &amp;amp;&lt;br /&gt;
stalonetray  2&amp;gt;&amp;amp;1 &amp;gt; /dev/null&lt;br /&gt;
killall nm-applet&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
When you close the &#039;&#039;stalonetray&#039;&#039; window, it closes {{ic|nm-applet}} too, so no extra memory is used once you are done with network settings.&lt;br /&gt;
&lt;br /&gt;
The applet can show notifications for events such as connecting to or disconnecting from a Wi-Fi network. For these notifications to display, ensure that you have a notification server installed - see [[Desktop notifications]]. If you use the applet without a notification server, you might see some messages in stdout/stderr, and the applet might hang. See [https://bugzilla.gnome.org/show_bug.cgi?id=788313].&lt;br /&gt;
&lt;br /&gt;
In order to run {{ic|nm-applet}} with such notifications disabled, start the applet with the following command:&lt;br /&gt;
&lt;br /&gt;
 $ nm-applet --no-agent&lt;br /&gt;
&lt;br /&gt;
{{Tip|{{ic|nm-applet}} might be started automatically with a [[XDG Autostart|autostart desktop file]], to add the {{ic|--no-agent}} option modify the Exec line there, i.e.&lt;br /&gt;
&lt;br /&gt;
{{bc|1=Exec=nm-applet --no-agent}}&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|On [[i3]], if nm-applet is started with the {{ic|--no-agent}} option, it is not possible to connect to a new encrypted Wi-Fi network by clicking on the item list because no password input dialogue window will pop out. [[journal]] will show {{ic|no secrets: No agents were available for this request}}.}}&lt;br /&gt;
&lt;br /&gt;
==== Appindicator ====&lt;br /&gt;
&lt;br /&gt;
As of version 1.18.0 Appindicator support is [https://gitlab.archlinux.org/archlinux/packaging/packages/network-manager-applet/-/commit/527448fb2a87d85055f504f463dfe961dccd75c3 available] in the official {{Pkg|network-manager-applet}} package. To use nm-applet in an Appindicator environment start the applet with the following command:&lt;br /&gt;
&lt;br /&gt;
 $ nm-applet --indicator&lt;br /&gt;
&lt;br /&gt;
=== networkmanager-dmenu ===&lt;br /&gt;
&lt;br /&gt;
Alternatively there is {{Pkg|networkmanager-dmenu}} which is a small script to manage NetworkManager connections with [[dmenu]] or [[rofi]] instead of {{ic|nm-applet}}. It provides all essential features such as connection to existing NetworkManager Wi-Fi or wired connections, connect to new Wi-Fi connections, requests passphrase if required, connect to existing VPN connections, enable/disable networking, launch &#039;&#039;nm-connection-editor&#039;&#039; GUI, connect to Bluetooth networks.&lt;br /&gt;
&lt;br /&gt;
=== switchboard ===&lt;br /&gt;
&lt;br /&gt;
Pantheon&#039;s {{Pkg|switchboard}} offers a desktop environment-agnostic way to configure NetworkManager when combined with {{Pkg|switchboard-plug-network}} and {{Pkg|nm-connection-editor}}. It can be ran with the following command:&lt;br /&gt;
&lt;br /&gt;
 $ io.elementary.settings&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
NetworkManager may require some additional steps to be able run properly. Make sure you have configured {{ic|/etc/hosts}} as described in [[Network configuration#Set the hostname]] section.&lt;br /&gt;
&lt;br /&gt;
NetworkManager has a global configuration file at {{ic|/etc/NetworkManager/NetworkManager.conf}}. Additional configuration files can be placed in {{ic|/etc/NetworkManager/conf.d/}}. Usually no configuration needs to be done to the global defaults.&lt;br /&gt;
&lt;br /&gt;
After editing a configuration file, the changes can be applied by running:&lt;br /&gt;
&lt;br /&gt;
 # nmcli general reload&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager-wait-online ===&lt;br /&gt;
&lt;br /&gt;
Enabling {{ic|NetworkManager.service}} also enables {{ic|NetworkManager-wait-online.service}}, which is a oneshot system service that waits for the network to be configured. The latter has {{ic|1=WantedBy=network-online.target}}, so it will finish only when {{ic|network-online.target}} itself is enabled or pulled in by some other unit. See also [[systemd#Running services after the network is up]].&lt;br /&gt;
&lt;br /&gt;
By default, {{ic|NetworkManager-wait-online.service}} waits for NetworkManager startup to complete, rather than waiting for network connectivity specifically (see {{man|1|nm-online}}). If {{ic|NetworkManager-wait-online.service}} finishes before the network is really up, resulting in failed services on boot, [[extend the unit]] to remove the {{ic|-s}} from the {{ic|ExecStart}} line:&lt;br /&gt;
&lt;br /&gt;
 [Service]&lt;br /&gt;
 ExecStart=&lt;br /&gt;
 ExecStart=/usr/bin/nm-online -q&lt;br /&gt;
&lt;br /&gt;
Be aware that this can cause [https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org/thread/EGC324JD3HJCGVN7J55WYPRLFDA3TP7N/ other issues].&lt;br /&gt;
&lt;br /&gt;
In some cases, the service will still fail to start successfully on boot due to the timeout setting being too short. [[Edit]] the service to change {{ic|NM_ONLINE_TIMEOUT}} from {{ic|60}} to a higher value.&lt;br /&gt;
&lt;br /&gt;
=== Set up PolicyKit permissions ===&lt;br /&gt;
&lt;br /&gt;
By default, all users in active local sessions are allowed to change most network settings without a password. See [[General troubleshooting#Session permissions]] to check your session type. In most cases, everything should work out of the box.&lt;br /&gt;
&lt;br /&gt;
Some actions (such as changing the system hostname) require an administrator password. In this case, you need to [[Users and groups#Group management|add]] yourself to the {{ic|wheel}} group and run a [[Polkit#Authentication agents|Polkit authentication agent]] which will prompt for your password.&lt;br /&gt;
&lt;br /&gt;
For remote sessions (e.g. [[TigerVNC#Running vncserver for virtual (headless) sessions|headless VNC]]), you have several options for obtaining the necessary privileges to use NetworkManager:&lt;br /&gt;
&lt;br /&gt;
# [[Users and groups#Group management|Add]] yourself to the {{ic|wheel}} group. You will have to enter your password for every action. Note that your user account may be granted other permissions as well, such as the ability to use [[sudo]] without entering the root password.&lt;br /&gt;
# [[Users and groups#Group management|Add]] yourself to the {{ic|network}} group and create {{ic|/etc/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules}} with the following content: {{bc|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
polkit.addRule(function(action, subject) {&lt;br /&gt;
  if (action.id.indexOf(&amp;quot;org.freedesktop.NetworkManager.&amp;quot;) == 0 &amp;amp;&amp;amp; subject.isInGroup(&amp;quot;network&amp;quot;)) {&lt;br /&gt;
    return polkit.Result.YES;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}} All users in the {{ic|network}} group will be able to add and remove networks without a password (which means you do not have to run a Polkit authentication agent, so this option will also work in SSH sessions).&lt;br /&gt;
&lt;br /&gt;
=== Proxy settings ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager does support some proxy settings. While they can not be directly modified using &#039;&#039;nmtui&#039;&#039;, &#039;&#039;nm-applet&#039;&#039; and &#039;&#039;nmcli&#039;&#039; support those.&lt;br /&gt;
See the proxy settings in {{man|5|nm-settings-nmcli}}.&lt;br /&gt;
&lt;br /&gt;
Additionally, custom proxy commands can always be run using dispatcher scripts, see [[#Dispatcher examples]].&lt;br /&gt;
&lt;br /&gt;
See also [[Proxy settings]].&lt;br /&gt;
&lt;br /&gt;
=== Checking connectivity ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager can try to reach a webserver after connecting to a network in order to determine if it is e.g behind a captive portal. The default host (configured in {{ic|/usr/lib/NetworkManager/conf.d/20-connectivity.conf}}) is [https://ping.archlinux.org ping.archlinux.org] (a CNAME alias of redirect.archlinux.org). To use a different webserver or to disable connectivity checking, create {{ic|/etc/NetworkManager/conf.d/20-connectivity.conf}}, see {{man|5|NetworkManager.conf|CONNECTIVITY SECTION}}. Below is an example of using GNOME servers (it does not require the use of [[GNOME]]):&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/20-connectivity.conf|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
[connectivity]&lt;br /&gt;
uri=http://nmcheck.gnome.org/check_network_status.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
To disable NetworkManager&#039;s connectivity check, use the following configuration. This can be useful when connected to a VPN that blocks connectivity checks.&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/20-connectivity.conf|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
[connectivity]&lt;br /&gt;
enabled=false&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Although automatic connectivity checks are a potential privacy leak, Arch Linux&#039;s default connectivity URL is committed to not logging any access. See [https://gitlab.archlinux.org/archlinux/infrastructure/-/commit/fabccd0f61e5dea3925e8a0c6a46d56d5750c121#a4f34381bbb18ea77bfb3dd11a8aeca707078fca_0_26] [https://gitlab.archlinux.org/archlinux/infrastructure/-/blob/master/roles/ping/templates/nginx.d.conf.j2].}}&lt;br /&gt;
&lt;br /&gt;
=== Captive portals ===&lt;br /&gt;
&lt;br /&gt;
{{Style|Complex scripts should not be maintained on the wiki.}}&lt;br /&gt;
&lt;br /&gt;
For those behind a [[Wikipedia:Captive portal|captive portal]], the desktop manager may automatically open a window asking for credentials. If your desktop does not, you can use {{Pkg|capnet-assist}} package (however, it currently has a broken NetworkManager dispatcher script). Alternatively, you can create a NetworkManager dispatcher script with the following content:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/90-open_captive_portal|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh -e&lt;br /&gt;
# Script to dispatch NetworkManager events&lt;br /&gt;
#&lt;br /&gt;
# Runs shows a login webpage on walled garden networks.&lt;br /&gt;
# See NetworkManager(8) for further documentation of the dispatcher events.&lt;br /&gt;
&lt;br /&gt;
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&lt;br /&gt;
&lt;br /&gt;
if [ -x &amp;quot;/usr/bin/logger&amp;quot; ]; then&lt;br /&gt;
    logger=&amp;quot;/usr/bin/logger -s -t captive-portal&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
    logger=&amp;quot;:&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
wait_for_process() {&lt;br /&gt;
    PNAME=$1&lt;br /&gt;
    while [ -z &amp;quot;$(/usr/bin/pgrep $PNAME)&amp;quot; ]; do&lt;br /&gt;
        sleep 3;&lt;br /&gt;
    done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#launch the browser, but on boot we need to wait that nm-applet starts&lt;br /&gt;
start_browser() {&lt;br /&gt;
    local user=&amp;quot;$1&amp;quot;&lt;br /&gt;
    local display=&amp;quot;$2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    export DISPLAY=&amp;quot;$display&amp;quot;&lt;br /&gt;
    wait_for_process nm-applet&lt;br /&gt;
&lt;br /&gt;
    export XAUTHORITY=&amp;quot;/home/$user/.Xauthority&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    $logger &amp;quot;Running browser as &#039;$user&#039; with display &#039;$display&#039; to login in captive portal&amp;quot;&lt;br /&gt;
    sudo -u &amp;quot;$user&amp;quot; --preserve-env=DISPLAY,XAUTHORITY -H xdg-open http://capnet.elementary.io 2&amp;gt;&amp;amp;1 &amp;gt; /dev/null&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Run the right scripts&lt;br /&gt;
case &amp;quot;$2&amp;quot; in&lt;br /&gt;
    connectivity-change)&lt;br /&gt;
    $logger -p user.debug &amp;quot;dispatcher script triggered on connectivity change: $CONNECTIVITY_STATE&amp;quot;&lt;br /&gt;
    if [ &amp;quot;$CONNECTIVITY_STATE&amp;quot; = &amp;quot;PORTAL&amp;quot; ]; then&lt;br /&gt;
        # Match last column of who&#039;s output with &#039; :[at least one digit] &#039;&lt;br /&gt;
        who | awk &#039;$NF ~ /\(:[0-9]+\)/ { print $1 &amp;quot; &amp;quot; substr($NF, 2, length($NF)-2) };&#039; | \&lt;br /&gt;
        while read user display; do&lt;br /&gt;
            start_browser $user $display || $logger -p user.err &amp;quot;Failed for user: &#039;$user&#039; display: &#039;$display&#039;&amp;quot;&lt;br /&gt;
        done&lt;br /&gt;
    fi&lt;br /&gt;
    ;;&lt;br /&gt;
    *)&lt;br /&gt;
    # In a down phase&lt;br /&gt;
    exit 0&lt;br /&gt;
    ;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Make the script [[executable]]. But that script assumes you use X and simply opens http page. It might not work for everyone.&lt;br /&gt;
&lt;br /&gt;
You will need to [[restart]] {{ic|NetworkManager.service}} or reboot for this to start working. Once you do, the dispatcher script should open a login window once it detects you are behind a captive portal.&lt;br /&gt;
&lt;br /&gt;
Simple solution is [https://github.com/Seme4eg/captive-portal-sh captive-portal-sh] - shell script that obtains captive portal URL and opens it in your default browser (for Wayland users only).&lt;br /&gt;
&lt;br /&gt;
Another solution is {{AUR|captive-browser-git}} based on Google Chrome.&lt;br /&gt;
&lt;br /&gt;
==== iwd support for captive portal support on legacy hardware ====&lt;br /&gt;
&lt;br /&gt;
Some older Wi-Fi chips (e.g. Broadcom BCM4360) require the proprietary {{ic|wl}} driver, which lacks support for the OWE/Elliptic-Curve handshake that many captive-portal hotspots use before presenting a login page. By switching NetworkManager’s Wi-Fi backend to {{ic|iwd}} (see [[#Using iwd as the Wi-Fi backend]]), which implements the full OWE key exchange in userspace over the existing driver, you can complete the encrypted association, obtain a DHCP lease, and trigger the portal “PORTAL” state. Once that is done, any dispatcher script or browser-launcher will reliably pop up the login page on hardware that otherwise could never fully connect.&lt;br /&gt;
&lt;br /&gt;
=== DHCP client ===&lt;br /&gt;
&lt;br /&gt;
By default NetworkManager uses its internal DHCP client. The internal DHCPv4 plugin is based on the [https://nettools.github.io/n-dhcp4/ nettools&#039; n-dhcp4] library, while the internal DHCPv6 plugin is made from code based on systemd-networkd.&lt;br /&gt;
&lt;br /&gt;
To use a different DHCP client [[install]] one of the alternatives:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|dhcpcd}} - [[dhcpcd]]&lt;br /&gt;
* {{Pkg|dhclient}} - [[dhclient]]&lt;br /&gt;
&lt;br /&gt;
To change the DHCP client backend, set the option {{ic|1=main.dhcp=&#039;&#039;dhcp_client_name&#039;&#039;}} with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}. E.g.:&lt;br /&gt;
&lt;br /&gt;
{{hc|1=/etc/NetworkManager/conf.d/dhcp-client.conf|2=&lt;br /&gt;
[main]&lt;br /&gt;
dhcp=dhcpcd&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
Do not enable the systemd units shipped with the {{Pkg|dhclient}} and {{Pkg|dhcpcd}} packages. They will conflict with NetworkManager, see the note in [[#Installation]] for details.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== DNS management ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager&#039;s DNS management is described in the GNOME project&#039;s wiki page—[https://wiki.gnome.org/Projects/NetworkManager/DNS Projects/NetworkManager/DNS].&lt;br /&gt;
&lt;br /&gt;
==== DNS caching and conditional forwarding ====&lt;br /&gt;
&lt;br /&gt;
NetworkManager has a plugin to enable DNS caching and conditional forwarding ([https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/143 previously] called &amp;quot;split DNS&amp;quot; in NetworkManager&#039;s documentation) using [[dnsmasq]] or [[systemd-resolved]]. The advantages of this setup is that DNS lookups will be cached, shortening resolve times, and DNS lookups of VPN hosts will be routed to the relevant VPN&#039;s DNS servers. This is especially useful if you are connected to more than one VPN.&lt;br /&gt;
&lt;br /&gt;
{{Note|If {{ic|/etc/resolv.conf}} is a symlink to {{ic|/run/systemd/resolve/stub-resolv.conf}}, {{ic|/run/systemd/resolve/resolv.conf}},{{ic|/lib/systemd/resolv.conf}} or {{ic|/usr/lib/systemd/resolv.conf}}, NetworkManager will choose systemd-resolved automatically. To use dnsmasq, you must first remove that symlink, then restart NetworkManager.}}&lt;br /&gt;
&lt;br /&gt;
===== dnsmasq =====&lt;br /&gt;
&lt;br /&gt;
Make sure {{Pkg|dnsmasq}} has been installed. Then set {{ic|1=main.dns=dnsmasq}} with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/dns.conf|2=&lt;br /&gt;
[main]&lt;br /&gt;
dns=dnsmasq&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Now run {{ic|nmcli general reload}} as root. NetworkManager will automatically start dnsmasq and add {{ic|127.0.0.1}} to {{ic|/etc/resolv.conf}}. The original DNS servers can be found in {{ic|/run/NetworkManager/no-stub-resolv.conf}}. You can verify dnsmasq is being used by doing the same DNS lookup twice with {{ic|drill example.com}} and verifying the server and query times.&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* You do not need to start {{ic|dnsmasq.service}} or edit {{ic|/etc/dnsmasq.conf}}. NetworkManager will start dnsmasq without using the systemd service and without reading the dnsmasq&#039;s default configuration file(s).&lt;br /&gt;
* The dnsmasq instance started by NetworkManager will bind to {{ic|127.0.0.1:53}}, you cannot run any other software (including {{ic|dnsmasq.service}}) on the same address and port.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====== Custom dnsmasq configuration ======&lt;br /&gt;
&lt;br /&gt;
Custom configurations can be created for &#039;&#039;dnsmasq&#039;&#039; by creating configuration files in {{ic|/etc/NetworkManager/dnsmasq.d/}}. For example, to change the size of the DNS cache (which is stored in RAM):&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dnsmasq.d/cache.conf|2=&lt;br /&gt;
cache-size=1000&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can check the configuration file syntax with:&lt;br /&gt;
&lt;br /&gt;
 $ dnsmasq --test --conf-file=/dev/null --conf-dir=/etc/NetworkManager/dnsmasq.d&lt;br /&gt;
&lt;br /&gt;
See {{man|8|dnsmasq}} for all available options.&lt;br /&gt;
&lt;br /&gt;
====== IPv6 ======&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|This does not solve the issue because NetworkManager does not add {{ic|::1}} to {{ic|/etc/resolv.conf}}. Unless {{ic|@::1}} is manually passed to drill, it will still fail with {{ic|Error: error sending query: No (valid) nameservers defined in the resolver}}.}}&lt;br /&gt;
&lt;br /&gt;
Enabling {{ic|dnsmasq}} in NetworkManager may break IPv6-only DNS lookups (i.e. {{ic|drill -6 [hostname]}}) which would otherwise work. In order to resolve this, creating the following file will configure &#039;&#039;dnsmasq&#039;&#039; to also listen to the IPv6 loopback:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dnsmasq.d/ipv6-listen.conf|2=&lt;br /&gt;
listen-address=::1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
In addition, {{ic|dnsmasq}} also does not prioritize upstream IPv6 DNS. Unfortunately NetworkManager does not do this ([https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/936712 Ubuntu Bug]). A workaround would be to disable IPv4 DNS in the NetworkManager config, assuming one exists.&lt;br /&gt;
&lt;br /&gt;
====== DNSSEC ======&lt;br /&gt;
&lt;br /&gt;
The dnsmasq instance started by NetworkManager by default will not validate [[DNSSEC]]. To enable DNSSEC validation, thus breaking DNS resolution with name servers that do not support it, create the following configuration file:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dnsmasq.d/dnssec.conf|2=&lt;br /&gt;
conf-file=/usr/share/dnsmasq/trust-anchors.conf&lt;br /&gt;
dnssec&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== systemd-resolved =====&lt;br /&gt;
&lt;br /&gt;
{{Expansion|NetworkManager 1.16 adds a new setting {{ic|main.systemd-resolved}}[https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commit/d4eb4cb45f41b1751cacf71da558bf8f0988f383] (enabled by default). It unconditionally sends DNS configuration to systemd-resolved. Related to &amp;quot;Preserving resolv.conf&amp;quot; from [[systemd-resolved#DNS]]?}}&lt;br /&gt;
&lt;br /&gt;
NetworkManager can use [[systemd-resolved]] as a DNS resolver and cache. Make sure that &#039;&#039;systemd-resolved&#039;&#039; is properly configured and that {{ic|systemd-resolved.service}} is [[started]] before using it.&lt;br /&gt;
&lt;br /&gt;
systemd-resolved will be used automatically if {{ic|/etc/resolv.conf}} is a [[systemd-resolved#DNS|symlink]] to {{ic|/run/systemd/resolve/stub-resolv.conf}}, {{ic|/run/systemd/resolve/resolv.conf}} or {{ic|/usr/lib/systemd/resolv.conf}}.&lt;br /&gt;
&lt;br /&gt;
You can enable it explicitly by setting {{ic|1=main.dns=systemd-resolved}} with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/dns.conf|2=&lt;br /&gt;
[main]&lt;br /&gt;
dns=systemd-resolved&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== DNS resolver with an openresolv subscriber =====&lt;br /&gt;
&lt;br /&gt;
If [[openresolv]] has a subscriber for your local [[DNS resolver]], set up the subscriber and [[#Use openresolv|configure NetworkManager to use openresolv]].&lt;br /&gt;
&lt;br /&gt;
Because NetworkManager advertises a single &amp;quot;interface&amp;quot; to &#039;&#039;resolvconf&#039;&#039;, it is not possible to implement conditional forwarding between two NetworkManager connections. See [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/153 NetworkManager issue 153].&lt;br /&gt;
&lt;br /&gt;
This can be partially mitigated if you set {{ic|1=private_interfaces=&amp;quot;*&amp;quot;}} in {{ic|/etc/resolvconf.conf}}[https://roy.marples.name/projects/openresolv/configuration/]. Any queries for domains that are not in search domain list will not get forwarded. They will be handled according to the local resolver&#039;s configuration, for example, forwarded to another DNS server or resolved recursively from the DNS root.&lt;br /&gt;
&lt;br /&gt;
==== Custom DNS servers ====&lt;br /&gt;
&lt;br /&gt;
===== Setting custom global DNS servers =====&lt;br /&gt;
&lt;br /&gt;
To set DNS servers for all connections, specify them in {{man|5|NetworkManager.conf}} using the syntax {{ic|1=servers=&#039;&#039;serveripaddress1&#039;&#039;,&#039;&#039;serveripaddress2&#039;&#039;,&#039;&#039;serveripaddress3&#039;&#039;}} in a section named {{ic|[global-dns-domain-*]}}. For example:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/dns-servers.conf|2=&lt;br /&gt;
[global-dns-domain-*]&lt;br /&gt;
servers=::1,127.0.0.1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* If you use [[#DNS caching and conditional forwarding|NetworkManager&#039;s dnsmasq or systemd-resolved plugin]] or [[#DNS resolver with an openresolv subscriber|openresolv subscribers]], then do not specify loopback addresses with the {{ic|1=servers=}} option, it can break DNS resolution.&lt;br /&gt;
* The specified servers do not get sent to [[systemd-resolved]], the connection&#039;s DNS servers are used instead. See [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1366 NetworkManager issue 1366] and [https://github.com/systemd/systemd/issues/33754 systemd issue 33754].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== Setting custom DNS servers in a connection =====&lt;br /&gt;
&lt;br /&gt;
====== Setting custom DNS servers in a connection (GUI) ======&lt;br /&gt;
&lt;br /&gt;
Setup will depend on the type of front-end used; the process usually involves right-clicking on the applet, editing (or creating) a profile, and then choosing DHCP type as &#039;&#039;Automatic (specify addresses)&#039;&#039;. The DNS addresses will need to be entered and are usually in this form: {{ic|127.0.0.1, &#039;&#039;DNS-server-one&#039;&#039;, ...}}.&lt;br /&gt;
&lt;br /&gt;
====== Setting custom DNS servers in a connection (nmcli / connection file) ======&lt;br /&gt;
&lt;br /&gt;
To set up DNS Servers per connection, you change the {{ic|ipv4.dns}} and {{ic|ipv6.dns}} settings (and their associated {{ic|dns-search}} and {{ic|dns-options}}) in the [[#Edit a connection|connection settings]].&lt;br /&gt;
&lt;br /&gt;
If {{ic|method}} is set to {{ic|auto}} (when you use DHCP/RA), you need to set {{ic|ignore-auto-dns}} to {{ic|yes}}.&lt;br /&gt;
&lt;br /&gt;
To use DNS over TLS ([[#systemd-resolved|requires systemd-resolved]]), specify the DNS servers using the syntax {{ic|1=dns=&#039;&#039;ip.address&#039;&#039;#&#039;&#039;servername&#039;&#039;;}} and additionally set the {{ic|connection.dns-over-tls}} setting to {{ic|2}}. For example, to use Quad9:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/system-connections/Example Wi-Fi.nmconnection|2=&lt;br /&gt;
...&lt;br /&gt;
[connection]&lt;br /&gt;
...&lt;br /&gt;
dns-over-tls=2&lt;br /&gt;
&lt;br /&gt;
[ipv4]&lt;br /&gt;
...&lt;br /&gt;
dns=9.9.9.9#dns.quad9.net;149.112.112.112#dns.quad9.net;&lt;br /&gt;
ignore-auto-dns=true&lt;br /&gt;
&lt;br /&gt;
[ipv6]&lt;br /&gt;
...&lt;br /&gt;
dns=2620:fe::fe#dns.quad9.net;2620:fe::9#dns.quad9.net;&lt;br /&gt;
ignore-auto-dns=true&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|This example uses Quad9. Replace it with a DNS resolver you trust. See [[Domain name resolution#Third-party DNS services]].}}&lt;br /&gt;
&lt;br /&gt;
==== /etc/resolv.conf ====&lt;br /&gt;
&lt;br /&gt;
NetworkManager&#039;s {{ic|/etc/resolv.conf}} management mode is configured with the {{ic|main.rc-manager}} setting. {{Pkg|networkmanager}} sets it to {{ic|symlink}} as opposed to the upstream default {{ic|auto}}. The setting and its values are documented in the {{man|5|NetworkManager.conf}} man page.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Using openresolv allows NetworkManager to coexist with other &#039;&#039;resolvconf&#039;&#039; supporting software or, for example, to run a local DNS caching and split-DNS resolver for which openresolv has a [[openresolv#Subscribers|subscriber]]. Note that conditional forwarding is [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/153 not yet fully supported] when using NetworkManager with openresolv.}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NetworkManager&#039;&#039; also offers hooks via so called dispatcher scripts that can be used to alter the {{ic|/etc/resolv.conf}} after network changes. See [[#Network services with NetworkManager dispatcher]] and {{man|8|NetworkManager}} for more information.&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* If NetworkManager is configured to use either [[#dnsmasq|dnsmasq]] or [[#systemd-resolved|systemd-resolved]], then the appropriate loopback addresses will be written to {{ic|/etc/resolv.conf}}.&lt;br /&gt;
* The {{ic|resolv.conf}} file NetworkManager writes or would write to {{ic|/etc/resolv.conf}} can be found at {{ic|/run/NetworkManager/resolv.conf}}.&lt;br /&gt;
* A {{ic|resolv.conf}} file with the acquired name servers and search domains can be found at {{ic|/run/NetworkManager/no-stub-resolv.conf}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== Unmanaged /etc/resolv.conf =====&lt;br /&gt;
&lt;br /&gt;
To stop NetworkManager from touching {{ic|/etc/resolv.conf}}, set {{ic|1=main.dns=none}} with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/dns.conf|2=&lt;br /&gt;
[main]&lt;br /&gt;
dns=none&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|You might also want to set {{ic|1=main.systemd-resolved=false}}, so that NetworkManager does not send the DNS configuration to [[systemd-resolved]].}}&lt;br /&gt;
&lt;br /&gt;
{{Note|See [[#DNS caching and conditional forwarding]], to configure NetworkManager using other DNS backends like [[dnsmasq]] and [[systemd-resolved]], instead of using {{ic|1=main.dns=none}}.}}&lt;br /&gt;
&lt;br /&gt;
After that {{ic|/etc/resolv.conf}} might be a broken symlink that you will need to remove. Then, just create a new {{ic|/etc/resolv.conf}} file.&lt;br /&gt;
&lt;br /&gt;
===== Use openresolv =====&lt;br /&gt;
&lt;br /&gt;
{{Note|NetworkManager does not support using systemd-resolved&#039;s &#039;&#039;resolvconf&#039;&#039; interface ({{man|1|resolvectl|COMPATIBILITY WITH RESOLVCONF(8)}}) which is provided by {{Pkg|systemd-resolvconf}}.&lt;br /&gt;
* Do not set {{ic|1=main.rc-manager=resolvconf}} when using [[systemd-resolved]], instead make sure to [[systemd-resolved#DNS|correctly create the /etc/resolv.conf symlink]] or [[#systemd-resolved|configure NetworkManager to use systemd-resolved explicitly]].&lt;br /&gt;
* Make sure the {{Pkg|systemd-resolvconf}} package is not installed when systemd-resolved is not used. Unless {{ic|systemd-resolved.service}} started, it will break all networking software (not just NetworkManager) that use resolvconf.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To configure NetworkManager to use [[openresolv]], set {{ic|1=main.rc-manager=resolvconf}} with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/rc-manager.conf|2=&lt;br /&gt;
[main]&lt;br /&gt;
rc-manager=resolvconf&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Firewall ===&lt;br /&gt;
&lt;br /&gt;
You can [[Firewalld#Using NetworkManager to manage zones|assign a firewalld zone]] based on your current connection. For example a restrictive firewall when at work, and a less restrictive one when at home.&lt;br /&gt;
&lt;br /&gt;
This can also be done with [[#Network services with NetworkManager dispatcher|NetworkManager dispatcher]].&lt;br /&gt;
&lt;br /&gt;
== Network services with NetworkManager dispatcher ==&lt;br /&gt;
&lt;br /&gt;
There are quite a few network services that you will not want running until NetworkManager brings up an interface. NetworkManager has the ability to start services when you connect to a network and stop them when you disconnect (e.g. when using [[NFS]], [[SMB]] and [[NTPd]]).&lt;br /&gt;
&lt;br /&gt;
To activate the feature you need to [[enable]] and [[start]] the {{ic|NetworkManager-dispatcher.service}}.&lt;br /&gt;
&lt;br /&gt;
Once the service is active, scripts can be added to the {{ic|/etc/NetworkManager/dispatcher.d}} directory.&lt;br /&gt;
&lt;br /&gt;
Scripts must be owned by &#039;&#039;&#039;root&#039;&#039;&#039;, otherwise the dispatcher will not execute them. For added security, set group [[ownership]] to root as well:&lt;br /&gt;
&lt;br /&gt;
 # chown root:root /etc/NetworkManager/dispatcher.d/&#039;&#039;10-script.sh&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Make sure the file is [[executable]]. &lt;br /&gt;
&lt;br /&gt;
The scripts will be run in alphabetical order at connection time, and in reverse alphabetical order at disconnect time. To ensure what order they come up in, it is common to use numerical characters prior to the name of the script (e.g. {{ic|10-portmap}} or {{ic|30-netfs}} (which ensures that the &#039;&#039;portmapper&#039;&#039; is up before NFS mounts are attempted).&lt;br /&gt;
&lt;br /&gt;
Scripts will receive the following arguments:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Interface name:&#039;&#039;&#039; e.g. {{ic|eth0}}&lt;br /&gt;
* &#039;&#039;&#039;Action:&#039;&#039;&#039; &#039;&#039;up&#039;&#039;, &#039;&#039;down&#039;&#039;, &#039;&#039;vpn-up&#039;&#039;, &#039;&#039;vpn-down&#039;&#039;, ... (see {{man|8|NetworkManager-dispatcher}} for the complete list)&lt;br /&gt;
&lt;br /&gt;
{{Warning|If you connect to foreign or public networks, be aware of what services you are starting and what servers you expect to be available for them to connect to. You could make a security hole by starting the wrong services while connected to a public network.}}&lt;br /&gt;
&lt;br /&gt;
=== Avoiding the dispatcher timeout ===&lt;br /&gt;
&lt;br /&gt;
If the above is working, then this section is not relevant. However, there is a general problem related to running dispatcher scripts which take longer to be executed. Initially an internal timeout of three seconds only was used. If the called script did not complete in time, it was killed. Later the timeout was extended to about 20 seconds (see the [https://bugzilla.redhat.com/show_bug.cgi?id=982734 Bugtracker] for more information). If the timeout still creates the problem, a work around may be to use a [[drop-in file]] for the {{ic|NetworkManager-dispatcher.service}} to remain active after exit: &lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/systemd/system/NetworkManager-dispatcher.service.d/remain_after_exit.conf|2=&lt;br /&gt;
[Service]&lt;br /&gt;
RemainAfterExit=yes&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Now start and enable the modified {{ic|NetworkManager-dispatcher}} service.&lt;br /&gt;
&lt;br /&gt;
{{Warning|Adding the {{ic|RemainAfterExit}} line to it will prevent the dispatcher from closing. Unfortunately, the dispatcher &#039;&#039;&#039;has&#039;&#039;&#039; to close before it can run your scripts again. With it the dispatcher will not time out but it also will not close, which means that the scripts will only run once per boot. Therefore, do not add the line unless the timeout is definitely causing a problem.}}&lt;br /&gt;
&lt;br /&gt;
=== Dispatcher examples ===&lt;br /&gt;
&lt;br /&gt;
==== Automatically set the timezone ====&lt;br /&gt;
&lt;br /&gt;
Create a [[#Network services with NetworkManager dispatcher|NetworkManager dispatcher script]] and make it [[executable]]:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/09-timezone|&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
case &amp;quot;$2&amp;quot; in&lt;br /&gt;
    up)&lt;br /&gt;
        timedatectl set-timezone &amp;quot;$(curl --fail &amp;lt;nowiki&amp;gt;https://ipapi.co/timezone&amp;lt;/nowiki&amp;gt;)&amp;quot;&lt;br /&gt;
    ;;&lt;br /&gt;
esac&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|Using {{ic|connectivity-change}} instead of {{ic|up}} can prevent timezone changes when connecting to VPNs with clients such as [[OpenConnect]].}}&lt;br /&gt;
&lt;br /&gt;
Alternatively, the tool {{aur|tzupdate}} automatically sets the timezone based on the geolocation of the IP address. This [https://medium.com/@ipdata_co/what-is-the-best-commercial-ip-geolocation-api-d8195cda7027 comparison of the most popular IP geolocation apis] may be helpful in deciding which API to use in production.&lt;br /&gt;
&lt;br /&gt;
==== Mount remote directory with sshfs ====&lt;br /&gt;
&lt;br /&gt;
As the script is run in a very restrictive environment, you have to export {{ic|SSH_AUTH_SOCK}} in order to connect to your SSH agent. There are different ways to accomplish this, see [https://bbs.archlinux.org/viewtopic.php?pid=1042030#p1042030 this message] for more information. The example below works with [[GNOME Keyring]], and will ask you for the password if not unlocked already. In case NetworkManager connects automatically on login, it is likely &#039;&#039;gnome-keyring&#039;&#039; has not yet started and the export will fail (hence the sleep). The {{ic|UUID}} to match can be found with the command {{ic|nmcli connection status}} or {{ic|nmcli connection list}}.     &lt;br /&gt;
&lt;br /&gt;
{{bc|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
USER=&#039;username&#039;&lt;br /&gt;
REMOTE=&#039;user@host:/remote/path&#039;&lt;br /&gt;
LOCAL=&#039;/local/path&#039;&lt;br /&gt;
&lt;br /&gt;
interface=$1 status=$2&lt;br /&gt;
if [ &amp;quot;$CONNECTION_UUID&amp;quot; = &amp;quot;&amp;lt;/nowiki&amp;gt;&#039;&#039;uuid&#039;&#039;&amp;lt;nowiki&amp;gt;&amp;quot; ]; then&lt;br /&gt;
  case $status in&lt;br /&gt;
    up)&lt;br /&gt;
      # sleep 10&lt;br /&gt;
      SSH_AUTH_SOCK=$(find /tmp -maxdepth 1 -type s -user &amp;quot;$USER&amp;quot; -name &#039;ssh&#039;)&lt;br /&gt;
      export SSH_AUTH_SOCK&lt;br /&gt;
      su &amp;quot;$USER&amp;quot; -c &amp;quot;sshfs $REMOTE $LOCAL&amp;quot;&lt;br /&gt;
      ;;&lt;br /&gt;
    down)&lt;br /&gt;
      fusermount -u &amp;quot;$LOCAL&amp;quot;&lt;br /&gt;
      ;;&lt;br /&gt;
  esac&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
==== Mounting of SMB shares ====&lt;br /&gt;
&lt;br /&gt;
Some [[SMB]] shares are only available on certain networks or locations (e.g. at home). You can use the dispatcher to only mount SMB shares that are present at your current location.&lt;br /&gt;
&lt;br /&gt;
The following script will check if we connected to a specific network and mount shares accordingly:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/30-mount-smb.sh|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# Find the connection UUID with &amp;quot;nmcli connection show&amp;quot; in terminal.&lt;br /&gt;
# All NetworkManager connection types are supported: wireless, VPN, wired...&lt;br /&gt;
if [ &amp;quot;$2&amp;quot; = &amp;quot;up&amp;quot; ]; then&lt;br /&gt;
  if [ &amp;quot;$CONNECTION_UUID&amp;quot; = &amp;quot;uuid&amp;quot; ]; then&lt;br /&gt;
    mount /your/mount/point &amp;amp; &lt;br /&gt;
    # add more shares as needed&lt;br /&gt;
  fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
The following script will unmount all SMB shares before a software initiated disconnect from a specific network:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/pre-down.d/30-umount-smb.sh|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$CONNECTION_UUID&amp;quot; = &amp;quot;uuid&amp;quot; ]; then&lt;br /&gt;
  umount -a -l -t cifs&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Make sure this script is located in the {{ic|pre-down.d}} sub-directory as shown above, otherwise it will unmount all shares on any connection state change.}}&lt;br /&gt;
&lt;br /&gt;
The following script will attempt to unmount all SMB shares following an unexpected disconnect from a specific network:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/40-umount-smb.sh|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$CONNECTION_UUID&amp;quot; = &amp;quot;uuid&amp;quot; ]; then&lt;br /&gt;
  if [ &amp;quot;$2&amp;quot; = &amp;quot;down&amp;quot; ]; then&lt;br /&gt;
    umount -a -l -t cifs&lt;br /&gt;
  fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* Since NetworkManager 0.9.8, the &#039;&#039;pre-down&#039;&#039; and &#039;&#039;down&#039;&#039; events are not executed on shutdown or restart, see [https://bugzilla.gnome.org/show_bug.cgi?id&amp;amp;#61;701242 this bug report] for more info.&lt;br /&gt;
* The previous &#039;&#039;umount&#039;&#039; scripts are still prone to leaving applications actually accessing the mount to &#039;hang&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
An alternative is to use the script as seen in [[NFS#Using a NetworkManager dispatcher]]:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/30-smb.sh|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# Find the connection UUID with &amp;quot;nmcli con show&amp;quot; in terminal.&lt;br /&gt;
# All NetworkManager connection types are supported: wireless, VPN, wired...&lt;br /&gt;
WANTED_CON_UUID=&amp;quot;CHANGE-ME-NOW-9c7eff15-010a-4b1c-a786-9b4efa218ba9&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$CONNECTION_UUID&amp;quot; = &amp;quot;$WANTED_CON_UUID&amp;quot; ]; then&lt;br /&gt;
    &lt;br /&gt;
    # Script parameter $1: network interface name, not used&lt;br /&gt;
    # Script parameter $2: dispatched event&lt;br /&gt;
    &lt;br /&gt;
    case &amp;quot;$2&amp;quot; in&lt;br /&gt;
        &amp;quot;up&amp;quot;)&lt;br /&gt;
            mount -a -t cifs&lt;br /&gt;
            ;;&lt;br /&gt;
        &amp;quot;down&amp;quot;|&amp;quot;pre-down&amp;quot;|&amp;quot;vpn-pre-down&amp;quot;)&lt;br /&gt;
            umount -l -a -t cifs &amp;gt;/dev/null&lt;br /&gt;
            ;;&lt;br /&gt;
    esac&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|This script ignores mounts with the {{ic|noauto}} option, remove this mount option or use {{ic|auto}} to allow the dispatcher to manage these mounts.}}&lt;br /&gt;
&lt;br /&gt;
Create a symlink inside {{ic|/etc/NetworkManager/dispatcher.d/pre-down/}} to catch the {{ic|pre-down}} events:&lt;br /&gt;
&lt;br /&gt;
 # ln -s ../30-smb.sh /etc/NetworkManager/dispatcher.d/pre-down.d/30-smb.sh&lt;br /&gt;
&lt;br /&gt;
==== Mounting of NFS shares ====&lt;br /&gt;
&lt;br /&gt;
See [[NFS#Using a NetworkManager dispatcher]].&lt;br /&gt;
&lt;br /&gt;
==== Use dispatcher to automatically toggle wireless depending on LAN cable being plugged in ====&lt;br /&gt;
&lt;br /&gt;
The idea is to only turn Wi-Fi on when the LAN cable is unplugged (for example when detaching from a laptop dock), and for Wi-Fi to be automatically disabled, once a LAN cable is plugged in again.&lt;br /&gt;
&lt;br /&gt;
Create the following dispatcher script[https://superuser.com/questions/233448/disable-wlan-if-wired-cable-network-is-available], replacing {{ic|&#039;&#039;Your_Ethernet_Interface&#039;&#039;}} with your ethernet interface&#039;s device name.&lt;br /&gt;
&lt;br /&gt;
{{Note|You can get a list of interfaces using [[#nmcli examples|nmcli]] ({{ic|nmcli d {{!}} grep ethernet}}). The Ethernet interfaces start with {{ic|en}} or {{ic|eth}}, e.g. {{ic|enp0s5}} or {{ic|eth0}}.}}&lt;br /&gt;
&lt;br /&gt;
Remember to make the script [[executable]]. You can verify that it works by [[restart]]ing {{ic|NetworkManager.service}}, running {{ic|ip a}}, and checking that {{ic|wlp3s0}} (or whatever your Wi-Fi interface is called) is in {{ic|state DOWN}}. If you encounter unexpected behavior, check the [[journal]] of {{ic|NetworkManager-dispatcher.service}}.&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/99-wifi-auto-toggle.sh|2=&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LOG_PREFIX=&amp;quot;WiFi Auto-Toggle&amp;quot;&lt;br /&gt;
ETHERNET_INTERFACE=&amp;quot;&#039;&#039;Your_Ethernet_Interface&#039;&#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$1&amp;quot; = &amp;quot;$ETHERNET_INTERFACE&amp;quot; ]; then&lt;br /&gt;
    case &amp;quot;$2&amp;quot; in&lt;br /&gt;
        up)&lt;br /&gt;
            echo &amp;quot;$LOG_PREFIX ethernet up&amp;quot;&lt;br /&gt;
            nmcli radio wifi off&lt;br /&gt;
            ;;&lt;br /&gt;
        down)&lt;br /&gt;
            echo &amp;quot;$LOG_PREFIX ethernet down&amp;quot;&lt;br /&gt;
            nmcli radio wifi on&lt;br /&gt;
            ;;&lt;br /&gt;
    esac&lt;br /&gt;
elif [ &amp;quot;$(nmcli -g GENERAL.STATE device show $ETHERNET_INTERFACE)&amp;quot; = &amp;quot;20 (unavailable)&amp;quot; ]; then&lt;br /&gt;
    echo &amp;quot;$LOG_PREFIX failsafe&amp;quot;&lt;br /&gt;
    nmcli radio wifi on&lt;br /&gt;
fi&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|There is a fail-safe for the case when the LAN interface was connected when the computer was last on, and then disconnected while the computer was off. That would mean the radio would still be off when the computer is turned back on, and with a disconnected LAN interface, you would have no network.}}&lt;br /&gt;
&lt;br /&gt;
==== Use dispatcher to connect to a VPN after a network connection is established ====&lt;br /&gt;
&lt;br /&gt;
In this example we want to connect automatically to a previously defined VPN connection after connecting to a specific Wi-Fi network. First thing to do is to create the dispatcher script that defines what to do after we are connected to the network.&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|A scripting without {{ic|iwgetid}} does work too and may be more reliable?|section=Fixes for automatic VPN dispatcher script}}&lt;br /&gt;
&lt;br /&gt;
{{Note|This script will require {{Pkg|wireless_tools}} in order to use {{ic|iwgetid}}.}}&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/vpn-up|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
VPN_NAME=&amp;quot;name of VPN connection defined in NetworkManager&amp;quot;&lt;br /&gt;
ESSID=&amp;quot;Wi-Fi network ESSID (not connection name)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
interface=$1 status=$2&lt;br /&gt;
case $status in&lt;br /&gt;
  up|vpn-down)&lt;br /&gt;
    if iwgetid | grep -qs &amp;quot;:\&amp;quot;$ESSID\&amp;quot;&amp;quot;; then&lt;br /&gt;
      nmcli connection up id &amp;quot;$VPN_NAME&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
    ;;&lt;br /&gt;
  down)&lt;br /&gt;
    if iwgetid | grep -qs &amp;quot;:\&amp;quot;$ESSID\&amp;quot;&amp;quot;; then&lt;br /&gt;
      if nmcli connection show --active | grep &amp;quot;$VPN_NAME&amp;quot;; then&lt;br /&gt;
        nmcli connection down id &amp;quot;$VPN_NAME&amp;quot;&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
    ;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
If you would like to attempt to automatically connect to VPN for all Wi-Fi networks, you can use the following definition of the ESSID: {{ic|1=ESSID=$(iwgetid -r)}}. Remember to set the script&#039;s permissions [[#Network services with NetworkManager dispatcher|accordingly]]. &lt;br /&gt;
&lt;br /&gt;
Trying to connect with the above script may still fail with {{ic|NetworkManager-dispatcher.service}} complaining about &#039;no valid VPN secrets&#039;, because of [https://developer.gnome.org/NetworkManager/0.9/secrets-flags.html the way VPN secrets are stored]. Fortunately, there are different options to give the above script access to your VPN password.&lt;br /&gt;
&lt;br /&gt;
1: One of them requires editing the VPN connection configuration file to make NetworkManager store the secrets by itself rather than inside a keyring [https://bugzilla.redhat.com/show_bug.cgi?id=710552 that will be inaccessible for root]: open up {{ic|/etc/NetworkManager/system-connections/&#039;&#039;name of your VPN connection&#039;&#039;.nmconnection}} and change the {{ic|password-flags}} and {{ic|secret-flags}} from {{ic|1}} to {{ic|0}}.&lt;br /&gt;
&lt;br /&gt;
If that alone does not work, you may have to create a {{ic|passwd-file}} in a safe location with the same permissions and ownership as the dispatcher script, containing the following:&lt;br /&gt;
&lt;br /&gt;
{{hc|/path/to/passwd-file|&lt;br /&gt;
vpn.secrets.password:YOUR_PASSWORD&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The script must be changed accordingly, so that it gets the password from the file:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/vpn-up|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
VPN_NAME=&amp;quot;name of VPN connection defined in NetworkManager&amp;quot;&lt;br /&gt;
ESSID=&amp;quot;Wi-Fi network ESSID (not connection name)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
interface=$1 status=$2&lt;br /&gt;
case $status in&lt;br /&gt;
  up|vpn-down)&lt;br /&gt;
    if iwgetid | grep -qs &amp;quot;:\&amp;quot;$ESSID\&amp;quot;&amp;quot;; then&lt;br /&gt;
      nmcli connection up id &amp;quot;$VPN_NAME&amp;quot; passwd-file /path/to/passwd-file&lt;br /&gt;
    fi&lt;br /&gt;
    ;;&lt;br /&gt;
  down)&lt;br /&gt;
    if iwgetid | grep -qs &amp;quot;:\&amp;quot;$ESSID\&amp;quot;&amp;quot;; then&lt;br /&gt;
      if nmcli connection show --active | grep &amp;quot;$VPN_NAME&amp;quot;; then&lt;br /&gt;
        nmcli connection down id &amp;quot;$VPN_NAME&amp;quot;&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
    ;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
2: Alternatively, change the {{ic|password-flags}} and put the password directly in the configuration file adding the section {{ic|vpn-secrets}}:&lt;br /&gt;
&lt;br /&gt;
  [vpn]&lt;br /&gt;
  ....&lt;br /&gt;
  password-flags=0&lt;br /&gt;
  &lt;br /&gt;
  [vpn-secrets]&lt;br /&gt;
  password=&#039;&#039;your_password&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{Note|It may now be necessary to re-open the NetworkManager connection editor and save the VPN passwords/secrets again.}}&lt;br /&gt;
&lt;br /&gt;
==== Use dispatcher to disable IPv6 on VPN provider connections ====&lt;br /&gt;
&lt;br /&gt;
Many [[:Category:VPN providers|commercial VPN providers]] support only IPv4. That means all IPv6 traffic bypasses the VPN and renders it virtually useless. To avoid this, dispatcher can be used to disable all IPv6 traffic for the time a VPN connection is up.&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/10-vpn-ipv6|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$2&amp;quot; in&lt;br /&gt;
	vpn-up)&lt;br /&gt;
		echo 1 &amp;gt; /proc/sys/net/ipv6/conf/all/disable_ipv6&lt;br /&gt;
		;;&lt;br /&gt;
	vpn-down)&lt;br /&gt;
		echo 0 &amp;gt; /proc/sys/net/ipv6/conf/all/disable_ipv6&lt;br /&gt;
		;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|The above script does not work for WireGuard since NetworkManager does not send the {{ic|vpn-up/down}} events for it. Instead you have to rely on generic events for your WireGuard interfaces as demonstrated in [https://gist.github.com/TheDcoder/85e1ec99a31180e20ba8e4896024f265].}}&lt;br /&gt;
&lt;br /&gt;
As an alternative, dispatcher can be used to temporarily set the IPv6 mode of the device used by the VPN connection to {{ic|link-local}}. This will avoid NetworkManager log spam about IPv6 being disabled. This script will not work if multiple devices or connections provide IPv6 connectivity, but could be adapted to iterate over multiple devices. Note that any change to the connection (using {{man|1|nmcli}} or a [[desktop environment]]) will reapply the entire connection to the device and re-enable IPv6 (if it is enabled in the connection).&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/10-vpn-ipv6|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$2&amp;quot; in&lt;br /&gt;
	vpn-up)&lt;br /&gt;
		nmcli device modify &amp;quot;${DEVICE_IFACE}&amp;quot; ipv6.method link-local&lt;br /&gt;
		;;&lt;br /&gt;
	vpn-down)&lt;br /&gt;
		nmcli device reapply &amp;quot;${DEVICE_IFACE}&amp;quot;&lt;br /&gt;
		;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
==== OpenNTPD ====&lt;br /&gt;
&lt;br /&gt;
See [[OpenNTPD#Using NetworkManager dispatcher]].&lt;br /&gt;
&lt;br /&gt;
==== Dynamically set NTP servers received via DHCP with systemd-timesyncd ====&lt;br /&gt;
&lt;br /&gt;
When roaming between different networks (e.g. a company&#039;s LAN, Wi-Fi at home, various other Wi-Fi now and then) you might want to set the NTP server(s) used by timesyncd to those provided by DHCP. However, NetworkManager itself is not capable to communicate with systemd-timesyncd to set the NTP server(s).&lt;br /&gt;
&lt;br /&gt;
The dispatcher can work around it. &lt;br /&gt;
&lt;br /&gt;
[[Create]] the overlay directory for your systemd-timesyncd configuration {{ic|/etc/systemd/timesyncd.conf.d}} if it does not already exist. Inside {{ic|/etc/NetworkManager/dispatcher.d}}, put the following: &lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/10-update-timesyncd|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
[ -z &amp;quot;$CONNECTION_UUID&amp;quot; ] &amp;amp;&amp;amp; exit 0&lt;br /&gt;
INTERFACE=&amp;quot;$1&amp;quot;&lt;br /&gt;
ACTION=&amp;quot;$2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
case $ACTION in&lt;br /&gt;
up | dhcp4-change | dhcp6-change)&lt;br /&gt;
	# `DHCP6_DHCP6_NTP_SERVERS` with double `DHCP6` is the correct variable name as varified by `printenv` as of NetworkManager 1.56.0-1&lt;br /&gt;
	set -- ${DHCP6_DHCP6_NTP_SERVERS-} ${DHCP4_NTP_SERVERS-}&lt;br /&gt;
	servers=$*&lt;br /&gt;
	[ -n &amp;quot;$servers&amp;quot; ] || exit 0&lt;br /&gt;
	mkdir -p /etc/systemd/timesyncd.conf.d&lt;br /&gt;
	cat &amp;lt;&amp;lt;-THE_END &amp;gt;&amp;quot;/etc/systemd/timesyncd.conf.d/${CONNECTION_UUID}.conf&amp;quot;&lt;br /&gt;
		[Time]&lt;br /&gt;
		NTP=$servers&lt;br /&gt;
	THE_END&lt;br /&gt;
	systemctl restart systemd-timesyncd.service&lt;br /&gt;
	;;&lt;br /&gt;
down)&lt;br /&gt;
	rm -f &amp;quot;/etc/systemd/timesyncd.conf.d/${CONNECTION_UUID}.conf&amp;quot;&lt;br /&gt;
	systemctl restart systemd-timesyncd.service&lt;br /&gt;
	;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Every time NetworkManager sets up a new network connection ({{ic|1=ACTION=up}}) or gets some update for an existing connection ({{ic|1=ACTION=dhcp4-change}} or {{ic|1=ACTION=dhcp6-change}}) and the provided connection data contains information about NTP server(s) ({{ic|DHCP6_DHCP6_NTP_SERVERS}} and {{ic|DHCP4_NTP_SERVERS}}), a connection specific overlay configuration file is written to {{ic|/etc/systemd/timesyncd.conf.d}}, containing the provided NTP server(s). Whenever a connection is taken down ({{ic|1=ACTION=down}}) the connection specific overlay file is removed. After each change to the configuration of systemd-timesyncd, this service is restarted to pick up the updated configuration. The use of connection specific configuration files is intentional so that when two or more connections are managed by NetworkManager in parallel the different NTP server names in the configuration are not overwritten as {{ic|up}}, {{ic|dhcp4-change}}, {{ic|dhcp6-change}} and {{ic|down}} actions might come in an arbitrary order.&lt;br /&gt;
&lt;br /&gt;
{{Note|{{ic|1=DHCP6_DHCP6_NTP_SERVERS}} with double {{ic|1=DHCP6}} is the correct variable name as varified by {{ic|1=printenv}} as of NetworkManager 1.56.0-1 }}&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
NetworkManager applets are designed to load upon login so no further configuration should be necessary for most users.  If you have already disabled your previous network settings and disconnected from your network, you can now test if NetworkManager will work. The first step is to [[start]] {{ic|NetworkManager.service}}.&lt;br /&gt;
&lt;br /&gt;
Some applets will provide you with a {{ic|.desktop}} file so that the NetworkManager applet can be loaded through the application menu.  If it does not, you are going to either have to discover the command to use or logout and login again to start the applet.  Once the applet is started, it will likely begin polling network connections with for auto-configuration with a DHCP server.&lt;br /&gt;
&lt;br /&gt;
To start the GNOME applet in non-xdg-compliant window managers like [[awesome]]:&lt;br /&gt;
&lt;br /&gt;
 nm-applet --sm-disable &amp;amp;&lt;br /&gt;
&lt;br /&gt;
For static IP addresses, you will have to configure NetworkManager to understand them.  The process usually involves right-clicking the applet and selecting something like &#039;Edit Connections&#039;.&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypted Wi-Fi passwords ===&lt;br /&gt;
&lt;br /&gt;
By default, NetworkManager stores passwords in clear text in the connection files at {{ic|/etc/NetworkManager/system-connections/}}. To print the stored passwords, use the following command:&lt;br /&gt;
&lt;br /&gt;
 # grep -r &#039;^psk=&#039; /etc/NetworkManager/system-connections/&lt;br /&gt;
&lt;br /&gt;
The passwords are accessible to the root user in the filesystem and to users with access to settings via the GUI (e.g. {{ic|nm-applet}}).&lt;br /&gt;
&lt;br /&gt;
It is preferable to save the passwords in encrypted form in a keyring instead of clear text. The downside to this is that the connections have to be set up for each user.&lt;br /&gt;
&lt;br /&gt;
In order to read and write to the keyring, there must be a secret agent available. This can be one of:&lt;br /&gt;
&lt;br /&gt;
* {{ic|nmcli}} with the {{ic|--ask}} option&lt;br /&gt;
* One of the graphical interfaces from [[#Front-ends]]&lt;br /&gt;
&lt;br /&gt;
If you make neither of these available, then authentication will fail with the error {{ic|no secrets: No agents were available for this request.}}&lt;br /&gt;
&lt;br /&gt;
==== Using GNOME Keyring ====&lt;br /&gt;
&lt;br /&gt;
The keyring daemon has to be started and the keyring needs to be unlocked for the following to work.&lt;br /&gt;
&lt;br /&gt;
Furthermore, NetworkManager needs to be configured not to store the password for all users. Using GNOME&#039;s {{Pkg|network-manager-applet}}, run {{ic|nm-connection-editor}} from a terminal, select a network connection, click &#039;&#039;Edit&#039;&#039;, select the &#039;&#039;Wi-Fi Security&#039;&#039; tab and click on the right icon of password and check &#039;&#039;Store the password only for this user&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Using KDE Wallet ====&lt;br /&gt;
&lt;br /&gt;
Using KDE&#039;s {{Pkg|plasma-nm}}, click the applet, click on the top right &#039;&#039;Settings&#039;&#039; icon, click on a network connection, in the &#039;&#039;General configuration&#039;&#039; tab, untick &#039;&#039;All users may connect to this network&#039;&#039;. If the option is ticked, the passwords will still be stored in clear text, even if a keyring daemon is running.&lt;br /&gt;
&lt;br /&gt;
If the option was selected previously and you un-tick it, you may have to use the {{ic|reset}} option first to make the password disappear from the file. Alternatively, delete the connection first and set it up again.&lt;br /&gt;
&lt;br /&gt;
=== Sharing internet connection over Wi-Fi ===&lt;br /&gt;
&lt;br /&gt;
You can share your internet connection (e.g. 3G or wired) with a few clicks.  Please note that a [[firewall]] may interfere with internet sharing.&lt;br /&gt;
&lt;br /&gt;
You will need a Wi-Fi card which supports AP mode, see [[Software access point#Wi-Fi device must support AP mode]] for details.&lt;br /&gt;
&lt;br /&gt;
[[Install]] the {{Pkg|dnsmasq}} package to be able to actually share the connection. Note that NetworkManager starts its own instance of &#039;&#039;dnsmasq&#039;&#039;, independent of {{ic|dnsmasq.service}}, as a DHCP server. See [[#dnsmasq]] for the caveats.&lt;br /&gt;
&lt;br /&gt;
Create the shared connection:&lt;br /&gt;
&lt;br /&gt;
* Click on applet and choose &#039;&#039;Create new wireless network&#039;&#039;.&lt;br /&gt;
* Follow wizard (choose WPA2 or higher, be sure to use at least 8 character long password, lower lengths will fail).&lt;br /&gt;
** Choose either [[Fedora:Features/RealHotspot|Hotspot]] or Ad-hoc as Wi-Fi mode.&lt;br /&gt;
&lt;br /&gt;
The connection will be saved and remain stored for the next time you need it.&lt;br /&gt;
&lt;br /&gt;
{{Note|Android does not support connecting to Ad-hoc networks. To share a connection with Android use infrastructure mode (i.e. set Wi-Fi mode to &amp;quot;Hotspot&amp;quot;).}}&lt;br /&gt;
&lt;br /&gt;
=== Sharing internet connection over Ethernet ===&lt;br /&gt;
&lt;br /&gt;
Scenario: your device has internet connection over Wi-Fi and you want to share the internet connection to other devices over Ethernet.&lt;br /&gt;
&lt;br /&gt;
Requirements:&lt;br /&gt;
&lt;br /&gt;
* [[Install]] the {{Pkg|dnsmasq}} and {{Pkg|nm-connection-editor}} packages to be able to actually share the connection. Note that NetworkManager starts its own instance of &#039;&#039;dnsmasq&#039;&#039;, independent of {{ic|dnsmasq.service}}, as a DHCP server. See [[#dnsmasq]] for the caveats.&lt;br /&gt;
* Your internet connected device and the other devices are connected over a suitable Ethernet cable (this usually means a cross over cable or a switch in between).&lt;br /&gt;
* Internet sharing is not blocked by a [[firewall]].&lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
&lt;br /&gt;
* Run {{ic|nm-connection-editor}} from terminal.&lt;br /&gt;
* Add a new Ethernet connection.&lt;br /&gt;
* Give it some sensible name. For example &amp;quot;Shared Internet&amp;quot;&lt;br /&gt;
* Go to &amp;quot;IPv4 Settings&amp;quot;.&lt;br /&gt;
* For &amp;quot;Method:&amp;quot; select &amp;quot;Shared to other computers&amp;quot;.&lt;br /&gt;
* Save&lt;br /&gt;
&lt;br /&gt;
Now you should have a new option &amp;quot;Shared Internet&amp;quot; under the Wired connections in NetworkManager.&lt;br /&gt;
&lt;br /&gt;
=== Checking if networking is up inside a cron job or script ===&lt;br /&gt;
&lt;br /&gt;
{{Out of date|&#039;&#039;nm-tool&#039;&#039; was removed from NetworkManager for long time now[https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commit/bb8c75bd536d4f8fb80a4366025a279078f0ec81]. &#039;&#039;nmcli&#039;&#039; should be used instead.}}&lt;br /&gt;
&lt;br /&gt;
Some &#039;&#039;cron&#039;&#039; jobs require networking to be up to succeed. You may wish to avoid running these jobs when the network is down. To accomplish this, add an &#039;&#039;&#039;if&#039;&#039;&#039; test for networking that queries NetworkManager&#039;s &#039;&#039;nm-tool&#039;&#039; and checks the state of networking. The test shown here succeeds if any interface is up, and fails if they are all down. This is convenient for laptops that might be hardwired, might be on wireless, or might be off the network.&lt;br /&gt;
&lt;br /&gt;
{{bc|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
if [ $(nm-tool|grep State|cut -f2 -d&#039; &#039;) == &amp;quot;connected&amp;quot; ]; then&lt;br /&gt;
    #Whatever you want to do if the network is online&lt;br /&gt;
else&lt;br /&gt;
    #Whatever you want to do if the network is offline - note, this and the else above are optional&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
This is useful for a {{ic|cron.hourly}} script that runs &#039;&#039;fpupdate&#039;&#039; for the F-Prot virus scanner signature update, as an example. Another way it might be useful, with a little modification, is to differentiate between networks using various parts of the output from &#039;&#039;nm-tool&#039;&#039;; for example, since the active wireless network is denoted with an asterisk, you could grep for the network name and then grep for a literal asterisk.&lt;br /&gt;
&lt;br /&gt;
=== Connect to network with secret on boot ===&lt;br /&gt;
&lt;br /&gt;
By default, NetworkManager will not connect to networks requiring a secret automatically on boot. This is because it locks such connections to the user who makes it by default, only connecting after they have logged in. To change this, do the following:&lt;br /&gt;
&lt;br /&gt;
# Right click on the {{ic|nm-applet}} icon in your panel and select Edit Connections and open the Wireless tab&lt;br /&gt;
# Select the connection you want to work with and click the Edit button&lt;br /&gt;
# Check the boxes “Connect Automatically” and “Available to all users”&lt;br /&gt;
# Additionally, ensure that under &amp;quot;Wi-Fi Security&amp;quot;, &amp;quot;Store password for all users (not encrypted)&amp;quot; is selected&lt;br /&gt;
&lt;br /&gt;
Log out and log back in to complete.&lt;br /&gt;
&lt;br /&gt;
=== OpenConnect with password in KWallet ===&lt;br /&gt;
&lt;br /&gt;
While you may type both values at connection time, {{Pkg|plasma-nm}} 0.9.3.2-1 and above are capable of retrieving OpenConnect username and password directly from [[KWallet]].&lt;br /&gt;
&lt;br /&gt;
Open &amp;quot;KDE Wallet Manager&amp;quot; and look up your OpenConnect VPN connection under &amp;quot;Network Management|Maps&amp;quot;. Click &amp;quot;Show values&amp;quot; and &lt;br /&gt;
enter your credentials in key &amp;quot;VpnSecrets&amp;quot; in this form (replace &#039;&#039;username&#039;&#039; and &#039;&#039;password&#039;&#039; accordingly):&lt;br /&gt;
&lt;br /&gt;
 form:main:username%SEP%&#039;&#039;username&#039;&#039;%SEP%form:main:password%SEP%&#039;&#039;password&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Next time you connect, username and password should appear in the &amp;quot;VPN secrets&amp;quot; dialog box.&lt;br /&gt;
&lt;br /&gt;
=== Ignore specific devices ===&lt;br /&gt;
&lt;br /&gt;
Sometimes it may be desired that NetworkManager ignores specific devices and does not try to configure addresses and routes for them. You can quickly and easily ignore devices by MAC or interface-name by using the following in {{ic|/etc/NetworkManager/conf.d/unmanaged.conf}}:&lt;br /&gt;
&lt;br /&gt;
 [keyfile]&lt;br /&gt;
 unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth0&lt;br /&gt;
&lt;br /&gt;
After editing the file, run {{ic|nmcli general reload}} as root. Afterwards you should be able to configure interfaces without NetworkManager altering what you have set.&lt;br /&gt;
&lt;br /&gt;
=== Configuring MAC address randomization ===&lt;br /&gt;
&lt;br /&gt;
{{Merge|NetworkManager/Privacy#MAC Randomization|There is a dedicated sub-page for Privacy now.}}&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|The [[iwd]] backend reportedly refuses MAC address randomisation due to open issues, and entry in [[iwd#Troubleshooting]] or link to [[MAC address spoofing#iwd]] (where [[Special:diff/873389/873277]] explains it) might be suitable to account for it; see:|section=iwd backend doesn&#039;t support mac spoofing}}&lt;br /&gt;
&lt;br /&gt;
{{Note|1=Disabling MAC address randomization may be needed to get (stable) link connection [https://bbs.archlinux.org/viewtopic.php?id=220101] and/or networks that restrict devices based on their MAC Address or have a limit network capacity.}}&lt;br /&gt;
&lt;br /&gt;
{{Note| See [[#Using iwd as the Wi-Fi backend]] for iwd specific MAC randomization.}}&lt;br /&gt;
&lt;br /&gt;
MAC randomization can be used for increased privacy by not disclosing your real MAC address to the network.&lt;br /&gt;
&lt;br /&gt;
NetworkManager supports two types MAC Address Randomization: randomization during scanning, and for network connections. Both modes can be configured by modifying {{ic|/etc/NetworkManager/NetworkManager.conf}} or by creating a separate configuration file in {{ic|/etc/NetworkManager/conf.d/}} which is recommended since the aforementioned configuration file may be overwritten by NetworkManager.&lt;br /&gt;
&lt;br /&gt;
Randomization during Wi-Fi scanning is enabled by default, but it may be disabled by adding the following lines to {{ic|/etc/NetworkManager/NetworkManager.conf}} or a dedicated configuration file under {{ic|/etc/NetworkManager/conf.d}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/wifi_rand_mac.conf|2=&lt;br /&gt;
[device]&lt;br /&gt;
wifi.scan-rand-mac-address=no&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
MAC randomization for network connections can be set to different modes for both wireless and ethernet interfaces. See the [https://blogs.gnome.org/thaller/2016/08/26/mac-address-spoofing-in-networkmanager-1-4-0/ GNOME blog post] for more details on the different modes. &lt;br /&gt;
&lt;br /&gt;
In terms of MAC randomization the most important modes are {{ic|stable}} and {{ic|random}}. {{ic|stable}} generates a random MAC address when you connect to a new network and associates the two permanently. This means that you will use the same MAC address every time you connect to that network. In contrast, {{ic|random}} will generate a new MAC address every time you connect to a network, new or previously known. You can configure the MAC randomization by adding the desired configuration under {{ic|/etc/NetworkManager/conf.d}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/wifi_rand_mac.conf|2=&lt;br /&gt;
[device-mac-randomization]&lt;br /&gt;
# &amp;quot;yes&amp;quot; is already the default for scanning&lt;br /&gt;
wifi.scan-rand-mac-address=yes&lt;br /&gt;
 &lt;br /&gt;
[connection-mac-randomization]&lt;br /&gt;
# Randomize MAC for every ethernet connection&lt;br /&gt;
ethernet.cloned-mac-address=random&lt;br /&gt;
# Generate a random MAC for each Wi-Fi and associate the two permanently.&lt;br /&gt;
wifi.cloned-mac-address=stable&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To configure MAC randomization for a specific connection (for example, if the network does not like random MAC addresses), [[#Edit a connection|edit the connection]] to set {{ic|802-11-wireless.cloned-mac-address}} to one of the modes (e.g. {{ic|stable}} or {{ic|random}}).&lt;br /&gt;
&lt;br /&gt;
See the following [https://blogs.gnome.org/thaller/2016/08/26/mac-address-spoofing-in-networkmanager-1-4-0/ GNOME blog post] for more details.&lt;br /&gt;
&lt;br /&gt;
=== Turn off hostname sending ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager by default sends the hostname to the DHCP server.&lt;br /&gt;
&lt;br /&gt;
To disable sending your hostname to the DHCP server globally, set the {{ic|ipv4.dhcp-send-hostname{{=}}0}} and {{ic|ipv6.dhcp-send-hostname{{=}}0}} options with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}. E.g.:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/dhcp-send-hostname.conf|2=&lt;br /&gt;
[connection]&lt;br /&gt;
ipv4.dhcp-send-hostname=0&lt;br /&gt;
ipv6.dhcp-send-hostname=0&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To disable sending your hostname to the DHCP server for a specific connection (or alternatively, enable it for a connection if it is disabled globally), add the following to your network connection file:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/system-connections/&#039;&#039;your_connection_file&#039;&#039;.nmconnection|2=&lt;br /&gt;
...&lt;br /&gt;
[ipv4]&lt;br /&gt;
dhcp-send-hostname=false&lt;br /&gt;
...&lt;br /&gt;
[ipv6]&lt;br /&gt;
dhcp-send-hostname=false&lt;br /&gt;
...&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|These options are only honored by the default [[#DHCP client|internal DHCP client]]. To omit sending the hostname when using NetworkManager with dhcpcd, edit {{ic|/etc/dhcpcd.conf}} and insert {{ic|anonymous}} as the last line.}}&lt;br /&gt;
&lt;br /&gt;
=== Enable IPv6 Privacy Extensions ===&lt;br /&gt;
&lt;br /&gt;
See [[IPv6#NetworkManager]].&lt;br /&gt;
&lt;br /&gt;
=== Configure a unique DUID per connection ===&lt;br /&gt;
&lt;br /&gt;
The DHCPv6 Unique Identifier (DUID) is a value used by the DHCPv6 client to identify itself to DHCPv6 servers. NetworkManager supports 3 types of DUID:&lt;br /&gt;
&lt;br /&gt;
* DUID-UUID ([[RFC:6355|RFC 6355]]): generated from an Universally Unique IDentifier (UUID).&lt;br /&gt;
* DUID-LL ([[RFC:3315|RFC 3315]]): generated from the Link-Layer address (a.k.a. MAC address).&lt;br /&gt;
* DUID-LLT ([[RFC:3315|RFC 3315]]): generated from the Link-Layer address plus a timestamp.&lt;br /&gt;
&lt;br /&gt;
If the internal NetworkManager&#039;s DHCP client is in use (the default) it will identify itself with a global and permanent DUID-UUID generated from the machine-id ({{ic|/etc/machine-id}}). This means that all connections share the same UUID, which may be a privacy breach.&lt;br /&gt;
&lt;br /&gt;
Fortunately, NetworkManager is able to provide unique DUIDs per connection, derived from the connection&#039;s stable-id and a per-host unique key. You can enable that by adding the following configuration under {{ic|/etc/NetworkManager/conf.d}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/duid.conf|2=&lt;br /&gt;
[connection]&lt;br /&gt;
ipv6.dhcp-duid=stable-uuid&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The {{ic|stable-ll}} and {{ic|stable-llt}} values are also supported. For further information read the description for {{ic|dhcp-duid}} in {{man|5|nm-settings|ipv6 setting}}.&lt;br /&gt;
&lt;br /&gt;
=== Working with wired connections ===&lt;br /&gt;
&lt;br /&gt;
By default, NetworkManager generates a connection profile for each wired ethernet connection it finds. At the point when generating the connection, it does not know whether there will be more Ethernet adapters available. Hence, it calls the first wired connection &amp;quot;Wired connection 1&amp;quot;. You can avoid generating this connection, by configuring {{ic|no-auto-default}} (see {{man|5|NetworkManager.conf}}), or by simply deleting it. Then NetworkManager will remember not to generate a connection for this interface again.&lt;br /&gt;
&lt;br /&gt;
You can also edit the connection (and persist it to disk) or delete it. NetworkManager will not re-generate a new connection. Then you can change the name to whatever you want. You can use something like {{Pkg|nm-connection-editor}} for this task.&lt;br /&gt;
&lt;br /&gt;
=== Using iwd as the Wi-Fi backend ===&lt;br /&gt;
&lt;br /&gt;
{{Note|1=&amp;lt;nowiki/&amp;gt;&lt;br /&gt;
* Do not enable {{ic|iwd.service}} or manually configure [[iwd]]. NetworkManager will start and manage it itself.&lt;br /&gt;
* Consider [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues?scope=all&amp;amp;utf8=%E2%9C%93&amp;amp;state=opened&amp;amp;search=iwd existing issues] before switching to &#039;&#039;iwd&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
To enable the [https://archive.kernel.org/oldwiki/iwd.wiki.kernel.org/networkmanager.html experimental iwd backend], first [[install]] {{Pkg|iwd}} and then create the following configuration file:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/wifi_backend.conf|2=&lt;br /&gt;
[device]&lt;br /&gt;
wifi.backend=iwd&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To use MAC randomization with iwd see [[MAC address spoofing#iwd]].&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can install {{AUR|networkmanager-iwd}}, a modified package configured to build &#039;&#039;NetworkManager&#039;&#039; working exclusively with &#039;&#039;iwd&#039;&#039;, with the main difference being that &#039;&#039;iwd&#039;&#039; is required and &#039;&#039;wpa_supplicant&#039;&#039; can be uninstalled after building.&lt;br /&gt;
&lt;br /&gt;
{{Note|1=You may need to [https://archive.kernel.org/oldwiki/iwd.wiki.kernel.org/networkmanager.html#converting_network_profiles convert existing NetworkManager network profiles] after switching to &#039;&#039;iwd&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Running in a network namespace ===&lt;br /&gt;
&lt;br /&gt;
If you would like to run NetworkManager inside a network namespace (e.g., to manage a specific device which should be used by selected applications), bring the device down before moving it to the namespace:&lt;br /&gt;
&lt;br /&gt;
 $ ip link set dev &#039;&#039;MY_DEVICE&#039;&#039; down&lt;br /&gt;
 $ ip link set dev &#039;&#039;MY_DEVICE&#039;&#039; netns &#039;&#039;MY_NAMESPACE&#039;&#039;&lt;br /&gt;
 $ ip netns exec &#039;&#039;MY_NAMESPACE&#039;&#039; NetworkManager&lt;br /&gt;
 ...&lt;br /&gt;
 $ ip netns exec &#039;&#039;MY_NAMESPACE&#039;&#039; killall NetworkManager&lt;br /&gt;
&lt;br /&gt;
otherwise NetworkManager will later fail to establish the connection with a {{ic|device is strictly unmanaged}} error.&lt;br /&gt;
&lt;br /&gt;
=== Automatically connect to VPN ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager can be set to automatically connect to a VPN when connecting to the internet, on a per network basis. The VPN connection itself can be added in GNOME&#039;s NetworkManager front-end, but to make it automatically use the VPN {{ic|nmcli}} must be used. Other front-ends might not have this limitation.&lt;br /&gt;
&lt;br /&gt;
First, make sure to make the VPN connection available to all users. In the GNOME this is a matter of checking a box under the {{ic|details}} tab. Under the {{ic|Identity}} tab, in the password field, click the icon on the right side in the field, and set it to {{ic|Store the password for all users}}.&lt;br /&gt;
&lt;br /&gt;
Then find the UUID of the VPN connection, and add that to {{ic|connection.secondaries}} of the Internet connection:&lt;br /&gt;
&lt;br /&gt;
 # UUID=$(nmcli --get-values connection.uuid connection show &#039;&#039;name-of-VPN-connection&#039;&#039;)&lt;br /&gt;
 # nmcli connection modify &#039;&#039;name-of-Internet-connection&#039;&#039; connection.secondaries &amp;quot;$UUID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now when NetworkManager is restarted and you connect to the Internet connection you have configured, you should automatically get connected to the VPN.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== No prompt for password of secured Wi-Fi networks ===&lt;br /&gt;
&lt;br /&gt;
When trying to connect to a secured Wi-Fi network, no prompt for a password is shown and no connection is established. This happens when no keyring package is installed. An easy solution is to install {{Pkg|gnome-keyring}}. If you want the passwords to be stored in encrypted form, follow [[GNOME Keyring]] to set up the &#039;&#039;gnome-keyring-daemon&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Network management disabled ===&lt;br /&gt;
&lt;br /&gt;
When NetworkManager shuts down but the pid (state) file is not removed, you will see a {{ic|Network management disabled}} message. If this happens, remove the file manually:&lt;br /&gt;
&lt;br /&gt;
 # rm /var/lib/NetworkManager/NetworkManager.state&lt;br /&gt;
&lt;br /&gt;
=== Problems with internal DHCP client ===&lt;br /&gt;
&lt;br /&gt;
If you have problems with getting an IP address using the internal DHCP client, consider using another DHCP client, see [[#DHCP client]] for instructions. This workaround might solve problems in big wireless networks like eduroam.&lt;br /&gt;
&lt;br /&gt;
=== DHCP problems with dhclient ===&lt;br /&gt;
&lt;br /&gt;
If you have problems with getting an IP address via DHCP, try to add the following to your {{ic|/etc/dhclient.conf}}:&lt;br /&gt;
&lt;br /&gt;
  interface &amp;quot;eth0&amp;quot; {&lt;br /&gt;
    send dhcp-client-identifier 01:&#039;&#039;aa:bb:cc:dd:ee:ff&#039;&#039;;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Where {{ic|&#039;&#039;aa:bb:cc:dd:ee:ff&#039;&#039;}} is the MAC address of this NIC. The MAC address can be found using the {{ic|ip link show &#039;&#039;interface&#039;&#039;}} command from the {{Pkg|iproute2}} package.&lt;br /&gt;
&lt;br /&gt;
=== 3G modem not detected ===&lt;br /&gt;
&lt;br /&gt;
See [[Mobile broadband modem#NetworkManager]].&lt;br /&gt;
&lt;br /&gt;
=== Switching off WLAN on laptops ===&lt;br /&gt;
&lt;br /&gt;
Sometimes NetworkManager will not work when you disable your Wi-Fi adapter with a switch on your laptop and try to enable it again afterwards. This is often a problem with &#039;&#039;rfkill&#039;&#039;. To check if the driver notifies &#039;&#039;rfkill&#039;&#039; about the wireless adapter&#039;s status, use:&lt;br /&gt;
&lt;br /&gt;
 $ watch -n1 rfkill list all&lt;br /&gt;
&lt;br /&gt;
If one identifier stays blocked after you switch on the adapter you could try to manually unblock it with (where X is the number of the identifier provided by the above output):&lt;br /&gt;
&lt;br /&gt;
 # rfkill event unblock X&lt;br /&gt;
&lt;br /&gt;
=== Static IP address settings revert to DHCP ===&lt;br /&gt;
&lt;br /&gt;
{{Out of date|This section is [[Special:Diff/119236|added in 2010]] and describes an ancient version of &#039;&#039;nm-applet&#039;&#039;. Is this still relevant in 2024?}}&lt;br /&gt;
&lt;br /&gt;
Due to an unresolved bug, when changing default connections to a static IP address, {{ic|nm-applet}} may not properly store the configuration change, and will revert to automatic DHCP.&lt;br /&gt;
&lt;br /&gt;
To work around this issue you have to edit the default connection (e.g. &amp;quot;Auto eth0&amp;quot;) in {{ic|nm-applet}}, change the connection name (e.g. &amp;quot;my eth0&amp;quot;), uncheck the &amp;quot;Available to all users&amp;quot; checkbox, change your static IP address settings as desired, and click &#039;&#039;&#039;Apply&#039;&#039;&#039;.  This will save a new connection with the given name.&lt;br /&gt;
&lt;br /&gt;
Next, you will want to make the default connection not connect automatically.  To do so, run {{ic|nm-connection-editor}} (&#039;&#039;&#039;not&#039;&#039;&#039; as root). In the connection editor, edit the default connection (e.g. &amp;quot;Auto eth0&amp;quot;) and uncheck &amp;quot;Connect automatically&amp;quot;.  Click &#039;&#039;&#039;Apply&#039;&#039;&#039; and close the connection editor.&lt;br /&gt;
&lt;br /&gt;
=== Cannot edit connections as normal user ===&lt;br /&gt;
&lt;br /&gt;
See [[#Set up PolicyKit permissions]].&lt;br /&gt;
&lt;br /&gt;
=== Forget hidden wireless network ===&lt;br /&gt;
&lt;br /&gt;
Since hidden networks are not displayed in the selection list of the Wireless view, they cannot be forgotten (removed) with the GUI. You can delete one with the following command:&lt;br /&gt;
&lt;br /&gt;
 # rm /etc/NetworkManager/system-connections/&#039;&#039;SSID&#039;&#039;.nmconnection&lt;br /&gt;
&lt;br /&gt;
This also works for any other connection.&lt;br /&gt;
&lt;br /&gt;
=== VPN not working in GNOME ===&lt;br /&gt;
&lt;br /&gt;
When setting up OpenConnect or vpnc connections in NetworkManager while using GNOME, you will sometimes never see the dialog box pop up and the following error appears in {{ic|/var/log/errors.log}}:&lt;br /&gt;
&lt;br /&gt;
 localhost NetworkManager[399]: &amp;lt;error&amp;gt; [1361719690.10506] [nm-vpn-connection.c:1405] get_secrets_cb(): Failed to request VPN secrets #3: (6) No agents were available for this request.&lt;br /&gt;
&lt;br /&gt;
This is caused by the GNOME NetworkManager Applet expecting dialog scripts to be at {{ic|/usr/lib/gnome-shell}}, when NetworkManager&#039;s packages put them in {{ic|/usr/lib/networkmanager}}.&lt;br /&gt;
As a &amp;quot;temporary&amp;quot; fix (this bug has been around for a while now), make the following symlink(s):&lt;br /&gt;
&lt;br /&gt;
* For OpenConnect: {{ic|ln -s /usr/lib/nm-openconnect-auth-dialog /usr/lib/gnome-shell/}}&lt;br /&gt;
* For VPNC (i.e. Cisco VPN): {{ic|ln -s /usr/lib/nm-vpnc-auth-dialog /usr/lib/gnome-shell/}}&lt;br /&gt;
&lt;br /&gt;
This may need to be done for any other NetworkManager VPN plugins as well, but these are the two most common.&lt;br /&gt;
&lt;br /&gt;
=== Unable to connect to visible European wireless networks ===&lt;br /&gt;
&lt;br /&gt;
WLAN chips are shipped with a default [[Wireless network configuration#Respecting the regulatory domain|regulatory domain]]. If your access point does not operate within these limitations, you will not be able to connect to the network. Fixing this is easy:&lt;br /&gt;
&lt;br /&gt;
# [[Install]] {{Pkg|wireless-regdb}}.&lt;br /&gt;
# Uncomment the correct country code in {{ic|/etc/conf.d/wireless-regdom}}.&lt;br /&gt;
# Reboot the system, because the setting is only read on boot.&lt;br /&gt;
&lt;br /&gt;
=== Automatic connect to VPN on boot is not working ===&lt;br /&gt;
&lt;br /&gt;
The problem occurs when the system (i.e. NetworkManager running as the root user) tries to establish a VPN connection, but the password is not accessible because it is stored in the GNOME Keyring of a particular user. &lt;br /&gt;
&lt;br /&gt;
A solution is to keep the password to your VPN in plaintext, as described in step (2.) of [[#Use dispatcher to connect to a VPN after a network connection is established]]. &lt;br /&gt;
&lt;br /&gt;
You do not need to use the dispatcher described in step (1.) to auto-connect anymore, if you use the new &amp;quot;auto-connect VPN&amp;quot; option from the {{ic|nm-applet}} GUI.&lt;br /&gt;
&lt;br /&gt;
=== systemd bottleneck ===&lt;br /&gt;
&lt;br /&gt;
Over time the log files ({{ic|/var/log/journal}}) can become very large. This can have a big impact on boot performance when using NetworkManager, see: [[systemd#Boot time increasing over time]].&lt;br /&gt;
&lt;br /&gt;
=== Regular network disconnects, latency and lost packets (Wi-Fi) ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager does a scan every 2 minutes.&lt;br /&gt;
&lt;br /&gt;
Some Wi-Fi drivers have issues when scanning for base stations whilst connected/associated. Symptoms include VPN disconnects/reconnects and lost packets, web pages failing to load and then refresh fine.&lt;br /&gt;
&lt;br /&gt;
Running {{ic|journalctl -f}} as root will indicate that this is taking place, messages like the following will be contained in the logs at regular intervals.&lt;br /&gt;
&lt;br /&gt;
 NetworkManager[410]: &amp;lt;info&amp;gt;  (wlp3s0): roamed from BSSID 00:14:48:11:20:CF (my-wifi-name) to (none) ((none))&lt;br /&gt;
&lt;br /&gt;
If roaming is not important, the periodic scanning behavior can be disabled by locking the BSSID of the access point in the Wi-Fi connection profile.&lt;br /&gt;
&lt;br /&gt;
=== Unable to turn on Wi-Fi with Lenovo laptop (IdeaPad, Legion, etc.) ===&lt;br /&gt;
&lt;br /&gt;
There is an issue with the {{ic|ideapad_laptop}} module on some Lenovo models due to the Wi-Fi driver incorrectly reporting a soft block. The card can still be manipulated with {{ic|netctl}}, but managers like NetworkManager break. You can verify that this is the problem by checking the output of {{ic|rfkill list}} after toggling your hardware switch and seeing that the soft block persists.&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|Try to use {{ic|rfkill.default_state}} and {{ic|rfkill.master_switch_mode}} (see [https://docs.kernel.org/admin-guide/kernel-parameters.html kernel-parameters.html]) to fix the rfkill problem.}}&lt;br /&gt;
&lt;br /&gt;
[[modprobe|Unloading]] the {{ic|ideapad_laptop}} module should fix this. (&#039;&#039;&#039;warning&#039;&#039;&#039;: this may disable the laptop keyboard and touchpad also!).&lt;br /&gt;
&lt;br /&gt;
=== nm-applet disappears in i3wm ===&lt;br /&gt;
&lt;br /&gt;
If you use the {{ic|xfce4-notifyd.service}} for notifications you must [[edit]] the unit and add the following:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/systemd/user/xfce4-notifyd.service.d/display_env.conf|2=&lt;br /&gt;
[Service]&lt;br /&gt;
Environment=&amp;quot;DISPLAY=:0.0&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
After reloading the daemons [[restart]] {{ic|xfce4-notifyd.service}}. Exit i3 and start it back up again and the applet should show on the tray.&lt;br /&gt;
&lt;br /&gt;
=== Unit dbus-org.freedesktop.resolve1.service not found ===&lt;br /&gt;
&lt;br /&gt;
If {{ic|systemd-resolved.service}} is not started, NetworkManager will try to start it using D-Bus and fail:&lt;br /&gt;
&lt;br /&gt;
 dbus-daemon[991]: [system] Activating via systemd: service name=&#039;org.freedesktop.resolve1&#039; unit=&#039;dbus-org.freedesktop.resolve1.service&#039; requested by &#039;:1.23&#039; (uid=0 pid=1012 comm=&amp;quot;/usr/bin/NetworkManager --no-daemon &amp;quot;)&lt;br /&gt;
 dbus-daemon[991]: [system] Activation via systemd failed for unit &#039;dbus-org.freedesktop.resolve1.service&#039;: Unit dbus-org.freedesktop.resolve1.service not found.&lt;br /&gt;
 dbus-daemon[991]: [system] Activating via systemd: service name=&#039;org.freedesktop.resolve1&#039; unit=&#039;dbus-org.freedesktop.resolve1.service&#039; requested by &#039;:1.23&#039; (uid=0 pid=1012 comm=&amp;quot;/usr/bin/NetworkManager --no-daemon &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
This is because NetworkManager will try to send DNS information to [[systemd-resolved]] regardless of the {{ic|1=main.dns=}} setting in {{man|5|NetworkManager.conf}}.[https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commit/d4eb4cb45f41b1751cacf71da558bf8f0988f383]&lt;br /&gt;
&lt;br /&gt;
This can be disabled with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/no-systemd-resolved.conf|2=&lt;br /&gt;
[main]&lt;br /&gt;
systemd-resolved=false&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
See {{Bug|62138}}.&lt;br /&gt;
&lt;br /&gt;
=== Secrets were required, but not provided ===&lt;br /&gt;
&lt;br /&gt;
If you received the following error when attempting to connect to a network: &lt;br /&gt;
&lt;br /&gt;
{{hc|$ nmcli device wifi connect &#039;&#039;SSID&#039;&#039; password &#039;&#039;password&#039;&#039;|&lt;br /&gt;
Error: Connection activation failed: (7) Secrets were required, but not provided&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This error can have numerous causes and you should read the [[journal]] (filter it with {{ic|-u NetworkManager}}). For example, if NetworkManager took too long to establish connection, it will believe that the password is incorrect:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
NetworkManager[1372]: &amp;lt;warn&amp;gt;  [1643991888.3808] device (wlan0): Activation: (wifi) association took too long&lt;br /&gt;
NetworkManager[1372]: &amp;lt;info&amp;gt;  [1643991888.3809] device (wlan0): state change: config -&amp;gt; need-auth (reason &#039;none&#039;, sys-iface-state: &#039;managed&#039;)&lt;br /&gt;
NetworkManager[1372]: &amp;lt;warn&amp;gt;  [1643991888.3838] device (wlan0): Activation: (wifi) asking for new secrets&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can try deleting the connection profile and creating a new one:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection delete &#039;&#039;SSID&#039;&#039;&lt;br /&gt;
 $ nmcli device wifi connect &#039;&#039;SSID&#039;&#039; password &#039;&#039;password&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can also try disabling MAC address randomization:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/wifi_rand_mac.conf|2=&lt;br /&gt;
[device]&lt;br /&gt;
wifi.scan-rand-mac-address=no&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== WPA Enterprise connection with iwd ===&lt;br /&gt;
&lt;br /&gt;
If you try to connect to an WPA Enterprise network like &#039;eduroam&#039; with NetworkManager with the [[#Using iwd as the Wi-Fi backend|iwd backend]] then you will get the following error from NetworkManager:&lt;br /&gt;
&lt;br /&gt;
  Connection &#039;eduroam&#039; is not avialable on device wlan0 because profile is not compatible with device (802.1x connections must have IWD provisioning files)&lt;br /&gt;
&lt;br /&gt;
This is because NetworkManager can not configure a WPA Enterprise network. Therefore you have to configure it using an iwd configuration file {{ic|/var/lib/iwd/&#039;&#039;essid&#039;&#039;.8021x}} like described in [[iwd#WPA Enterprise]].&lt;br /&gt;
&lt;br /&gt;
=== Failed to request VPN secrets ===&lt;br /&gt;
&lt;br /&gt;
If you get this error:&lt;br /&gt;
 Failed to request VPN secrets #1: No agents were available for this request.&lt;br /&gt;
&lt;br /&gt;
It is either because the password is empty or you have to [[#Set up PolicyKit permissions|set up PolicyKit permissions]].&lt;br /&gt;
&lt;br /&gt;
=== OpenVPN connections fail with &amp;quot;secrets: failed to request VPN secrets&amp;quot; warn ===&lt;br /&gt;
&lt;br /&gt;
{{Remove|This does not warrant a troubleshooting section. Optional dependencies are pointed out by pacman, if this is not clear enough it should be covered in [[#VPN support]].|section=Remove unnecessary section 8.22}}&lt;br /&gt;
&lt;br /&gt;
The package {{Pkg|networkmanager-openvpn}} requires {{Pkg|libnma-gtk4}} and optionally {{Pkg|libnma}} (Gtk3) when integrated within the GNOME-Shell. If {{Pkg|libnma}} is required but not installed a message will be  printed to the system log:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
NetworkManager[642]: &amp;lt;warn&amp;gt;  [...] vpn[...&amp;quot;name_of_vpn_profile VPN&amp;quot;]: secrets: failed to request VPN secrets #3: No agents were available for this request.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== OpenVPN connections fail with OpenSSL &amp;quot;ca md too weak&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
Since {{Pkg|openssl}} was updated to version 3, certificates generated with legacy cryptographic algorithms are rejected by default. Attempting to use {{Pkg|networkmanager-openvpn}} with such a setup can result in the following error in the logs:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
nm-openvpn[14359]: OpenSSL: error:0A00018E:SSL routines::ca md too weak&lt;br /&gt;
nm-openvpn[14359]: Cannot load certificate file /home/archie/.local/share/networkmanagement/certificates/my_issued_cert.crt&lt;br /&gt;
nm-openvpn[14359]: Exiting due to fatal error&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The correct approach is to have the OpenVPN server administrator generate and re-issue more secure certificates. However, as an immediate work-around, OpenVPN requires {{ic|1=tls-cipher &amp;quot;DEFAULT:@SECLEVEL=0&amp;quot;}}. This may not be possible through the plugin GUI, but it is possible with &#039;&#039;nmcli&#039;&#039;. Separately, you will also need to enable the &#039;&#039;legacy&#039;&#039; provider in OpenSSL.&lt;br /&gt;
&lt;br /&gt;
Firstly, obtain the name of the VPN connection with the issue, from the output of the following:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection show&lt;br /&gt;
&lt;br /&gt;
Assuming the connection name is &#039;&#039;vpn.example.com&#039;&#039;, use &#039;&#039;nmcli&#039;&#039; like so:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection modify vpn.example.com +vpn.data tls-cipher=DEFAULT:@SECLEVEL=0&lt;br /&gt;
&lt;br /&gt;
The change should instantly be reflected in {{ic|/etc/NetworkManager/system-connections/vpn.example.com.nmconnection}}.&lt;br /&gt;
&lt;br /&gt;
As for OpenSSL, edit {{ic|/etc/ssl/openssl.cnf}} as described on the [https://wiki.openssl.org/index.php/OpenSSL_3.0#Providers OpenSSL wiki].&lt;br /&gt;
&lt;br /&gt;
Specifically, at the end of the {{ic|[provider_sect]}} section add {{ic|1=legacy = legacy_sect}}. Under {{ic|[default_sect]}} uncomment {{ic|1=activate = 1}}. Lastly, add a new section {{ic|[legacy_sect]}} that also contains the line {{ic|1=activate = 1}}. Excluding most other preexisting configuration sections, the end result will look something like:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/ssl/openssl.cnf|2=&lt;br /&gt;
openssl_conf = openssl_init&lt;br /&gt;
&lt;br /&gt;
[openssl_init]&lt;br /&gt;
providers = provider_sect&lt;br /&gt;
&lt;br /&gt;
[provider_sect]&lt;br /&gt;
default = default_sect&lt;br /&gt;
legacy = legacy_sect&lt;br /&gt;
&lt;br /&gt;
[default_sect]&lt;br /&gt;
activate = 1&lt;br /&gt;
&lt;br /&gt;
[legacy_sect]&lt;br /&gt;
activate = 1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Finally, [[restart]] the {{ic|NetworkManager.service}} to have the new OpenSSL configuration take effect.&lt;br /&gt;
&lt;br /&gt;
=== WPA Enterprise connections fail to authenticate with OpenSSL &amp;quot;unsupported protocol&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
Since {{Pkg|openssl}} was updated to version 3, &amp;quot;SSL 3, TLS 1.0, TLS 1.1, and DTLS 1.0 only work at security level 0&amp;quot; [https://www.openssl.org/news/openssl-3.0-notes.html by default]. Attempting to authenticate to a Wi-Fi network only supporting older standards results in the following error in the logs:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
wpa_supplicant[3320]: SSL: SSL3 alert: write (local SSL3 detected an error):fatal:protocol version&lt;br /&gt;
wpa_supplicant[3320]: OpenSSL: openssl_handshake - SSL_connect error:0A000102:SSL routines::unsupported protocol&lt;br /&gt;
wpa_supplicant[3320]: wlp3s0: CTRL-EVENT-EAP-FAILURE EAP authentication failed&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The correct approach is to convince the institution&#039;s administrator to upgrade the encrypted networking tunnel protocol to TLS 1.3 and optionally drop support for deprecated security standards, including TLS 1.0/1.1, DTLS 1.0 and SSL 1-3. However, as an immediate workaround, there are multiple ways to allow TLS 1.0 and/or 1.1 by default. One way would be to manually patch or revert the breaking changes in OpenSSL ([https://github.com/openssl/openssl/commit/7bf2e4d7f0c7ae19b7a8c416910886a7171e9820]). As this also lowers security for all other programs using OpenSSL level 1, it is not recommended. Instead, one can directly set the level used by wpa_supplicant, like described in [https://bbs.archlinux.org/viewtopic.php?id=286417#p2104492 BBS#286417]. To only change the affected connection, it is possible to set {{ic|1=phase1-auth-flags=32}} or {{ic|1=phase1-auth-flags=64}} in the {{ic|1=[802-1x]}} section of the connection&#039;s configuration file. This may not be possible through GUIs, but it is possible with &#039;&#039;nmcli&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Firstly, obtain the name of the Wi-Fi connection with the issue, from the output of the following:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection show&lt;br /&gt;
&lt;br /&gt;
Assuming the connection uses TLS 1.0 and its name is &#039;&#039;Example Wi-Fi&#039;&#039;, use &#039;&#039;nmcli&#039;&#039; like so:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection modify &#039;Example Wi-Fi&#039; 802-1x.phase1-auth-flags 32&lt;br /&gt;
&lt;br /&gt;
And for a TLS 1.1 connection, type &amp;quot;64&amp;quot; instead:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection modify &#039;Example Wi-Fi&#039; 802-1x.phase1-auth-flags 64&lt;br /&gt;
&lt;br /&gt;
{{Note|1=The number you type in refers to the number you get from raising 2 to the power of &#039;&#039;&#039;n&#039;&#039;&#039;. Here, &#039;&#039;&#039;n&#039;&#039;&#039; is the index of the network authentication bit octet, read from right to left. Flipping the fifth bit enables TLS 1.0 &#039;&#039;&#039;[log(2) 32]&#039;&#039;&#039; and flipping the sixth bit enables TLS 1.1 &#039;&#039;&#039;[log(2) 64]&#039;&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
The change should instantly be reflected in {{ic|/etc/NetworkManager/system-connections/Example Wi-Fi.nmconnection}}.&lt;br /&gt;
&lt;br /&gt;
Finally, [[restart]] the {{ic|NetworkManager.service}} to have the new OpenSSL configuration take effect.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://blogs.gnome.org/dcbw/2015/02/16/networkmanager-for-administrators-part-1/ NetworkManager for Administrators Part 1]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=NetworkManager&amp;diff=873284</id>
		<title>NetworkManager</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=NetworkManager&amp;diff=873284"/>
		<updated>2026-05-08T09:57:06Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Configuring MAC address randomization */ add relevant crosslink to template&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Network managers]]&lt;br /&gt;
[[Category:DHCP]]&lt;br /&gt;
[[ar:Networkmanager]]&lt;br /&gt;
[[de:Networkmanager]]&lt;br /&gt;
[[fr:NetworkManager]]&lt;br /&gt;
[[hu:NetworkManager]]&lt;br /&gt;
[[ja:NetworkManager]]&lt;br /&gt;
[[pt:NetworkManager]]&lt;br /&gt;
[[ru:NetworkManager]]&lt;br /&gt;
[[zh-hans:NetworkManager]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|NetworkManager/Privacy}}&lt;br /&gt;
{{Related|Network configuration}}&lt;br /&gt;
{{Related|Wireless network configuration}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:NetworkManager|NetworkManager]] is a program for providing detection and configuration for systems to automatically connect to networks.&lt;br /&gt;
&lt;br /&gt;
[https://networkmanager.dev/ NetworkManager] can be useful for both wireless and wired networks. For wireless networks, NetworkManager prefers known wireless networks and has the ability to switch to the most reliable network.  NetworkManager-aware applications can switch from online and offline mode.&lt;br /&gt;
&lt;br /&gt;
NetworkManager also prefers wired connections over wireless ones, has support for modem connections and certain types of VPN.&lt;br /&gt;
&lt;br /&gt;
{{Warning|By default, secrets—e.g. Wi-Fi passwords—are accessible to the root user in the filesystem and to users with access to settings via the GUI (e.g. via [[#nm-applet]]). For more information, see [[#Encrypted Wi-Fi passwords]].}}&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
NetworkManager can be [[install]]ed with the package {{Pkg|networkmanager}}, which contains a daemon, a command line interface (&#039;&#039;nmcli&#039;&#039;) and a curses‐based interface (&#039;&#039;nmtui&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
=== Enable NetworkManager ===&lt;br /&gt;
&lt;br /&gt;
After installation, you should [[start/enable]] {{ic|NetworkManager.service}}. Once the NetworkManager daemon is started, it will automatically connect to any available &amp;quot;system connections&amp;quot; that have already been configured. Any &amp;quot;user connections&amp;quot; or unconfigured connections will need &#039;&#039;nmcli&#039;&#039; or an applet to configure and connect.&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* Each network interface should be managed by only one [[Network configuration#Network managers|DHCP client or network manager]], so it is advised to run only one DHCP client or network manager on the system. Find a list of the currently running services with {{ic|1=systemctl --type=service}} and then [[stop]] or reconfigure those that conflict.&lt;br /&gt;
* If [[systemd-resolved]] is not [[started]], an error message will start flooding your logs. See [[#Unit dbus-org.freedesktop.resolve1.service not found]] for more info.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Additional interfaces ===&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|nm-connection-editor}} for a graphical user interface,&lt;br /&gt;
* {{Pkg|network-manager-applet}} for a system tray applet (see the [[#nm-applet]] section).&lt;br /&gt;
&lt;br /&gt;
=== Mobile broadband support ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager uses [[ModemManager]] for mobile broadband connection support.&lt;br /&gt;
&lt;br /&gt;
[[Install]] {{Pkg|modemmanager}} and {{Pkg|usb_modeswitch}}. Afterwards [[enable]] and [[start]] {{ic|ModemManager.service}}.&lt;br /&gt;
&lt;br /&gt;
It may be necessary to [[restart]] {{ic|NetworkManager.service}} for it to detect ModemManager. After you restart it, re-plug the modem again and it should be recognized. &lt;br /&gt;
&lt;br /&gt;
Add connections from a front-end (e.g. {{Pkg|nm-connection-editor}}) and select mobile broadband as the connection type. After selecting your ISP and billing plan, [[Wikipedia:Access Point Name|APN]] and other settings should be filled in automatically using information from {{Pkg|mobile-broadband-provider-info}}.&lt;br /&gt;
&lt;br /&gt;
=== PPPoE / DSL support ===&lt;br /&gt;
&lt;br /&gt;
[[Install]] {{Pkg|ppp}} package for PPPoE / DSL connection support. To actually add PPPoE connection, use {{ic|1=nm-connection-editor}} and add new DSL/PPPoE connection.&lt;br /&gt;
&lt;br /&gt;
=== VPN support ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager since version 1.16 has native support for [[WireGuard]], all it needs is the {{ic|wireguard}} kernel module. Read the [https://blogs.gnome.org/thaller/2019/03/15/wireguard-in-networkmanager/ WireGuard in NetworkManager blog post] for details.&lt;br /&gt;
&lt;br /&gt;
Support for other VPN types is based on a plug-in system. They are provided in the following packages:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|networkmanager-openconnect}} for [[OpenConnect]]&lt;br /&gt;
* {{Pkg|networkmanager-openvpn}} for [[OpenVPN]]&lt;br /&gt;
* {{Pkg|networkmanager-pptp}} for [[PPTP Client]]&lt;br /&gt;
* {{Pkg|networkmanager-strongswan}} for [[strongSwan]]&lt;br /&gt;
* {{Pkg|networkmanager-vpnc}}&lt;br /&gt;
* {{AUR|networkmanager-fortisslvpn}}&lt;br /&gt;
* {{AUR|networkmanager-iodine-git}}&lt;br /&gt;
* {{AUR|networkmanager-libreswan}}&lt;br /&gt;
* {{Pkg|networkmanager-l2tp}}&lt;br /&gt;
* {{AUR|networkmanager-ssh}}&lt;br /&gt;
* {{Pkg|network-manager-sstp}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|1=There are a lot of [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues?search=VPN&amp;amp;state=opened bugs] related to VPN support. Check the daemon processes options set via the GUI correctly and double-check with each package release.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* To have fully functioning DNS resolution when using VPN, you should set up [[#DNS caching and conditional forwarding|conditional forwarding]].&lt;br /&gt;
* These plug-ins may not have a documented command line interface, or may not work at all without an applet running. This is not an issue if you are using a regular desktop environment; if you are not, you should run [[#nm-applet]] while configuring or activating the connection so that you get the necessary dialogues. [https://bbs.archlinux.org/viewtopic.php?id{{=}}246698]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
NetworkManager comes with {{man|1|nmcli}} and {{man|1|nmtui}}.&lt;br /&gt;
&lt;br /&gt;
=== nmcli examples ===&lt;br /&gt;
&lt;br /&gt;
List nearby Wi-Fi networks:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli device wifi list&lt;br /&gt;
&lt;br /&gt;
Connect to a Wi-Fi network:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli device wifi connect &#039;&#039;SSID_or_BSSID&#039;&#039; password &#039;&#039;password&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Connect to a hidden Wi-Fi network:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli device wifi connect &#039;&#039;SSID_or_BSSID&#039;&#039; password &#039;&#039;password&#039;&#039; hidden yes&lt;br /&gt;
&lt;br /&gt;
Connect to a Wi-Fi on the {{ic|wlan1}} interface:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli device wifi connect &#039;&#039;SSID_or_BSSID&#039;&#039; password &#039;&#039;password&#039;&#039; ifname wlan1 &#039;&#039;profile_name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Disconnect an interface:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli device disconnect ifname eth0&lt;br /&gt;
&lt;br /&gt;
Get a list of connections with their names, UUIDs, types and backing devices:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection show&lt;br /&gt;
&lt;br /&gt;
Activate a connection (i.e. connect to a network with an existing profile):&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection up &#039;&#039;name_or_uuid&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete a connection:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection delete &#039;&#039;name_or_uuid&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See a list of network devices and their state:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli device&lt;br /&gt;
&lt;br /&gt;
Turn off Wi-Fi:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli radio wifi off&lt;br /&gt;
&lt;br /&gt;
=== Edit a connection ===&lt;br /&gt;
&lt;br /&gt;
For a comprehensive list of settings, see {{man|5|nm-settings}}.&lt;br /&gt;
&lt;br /&gt;
Firstly, you need to get a list of connections:&lt;br /&gt;
&lt;br /&gt;
{{hc|$ nmcli connection|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
NAME                UUID                                  TYPE      DEVICE&lt;br /&gt;
Wired connection 2  e7054040-a421-3bef-965d-bb7d60b7cecf  ethernet  enp5s0&lt;br /&gt;
Wired connection 1  997f2782-f0fc-301d-bfba-15421a2735d8  ethernet  enp0s25&lt;br /&gt;
MY-HOME-WIFI-5G     92a0f7b3-2eba-49ab-a899-24d83978f308  wifi       --&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Here you can use the first column as connection-id used later. In this example, we pick {{ic|Wired connection 2}} as a connection-id.&lt;br /&gt;
&lt;br /&gt;
You have three methods to configure a connection {{ic|Wired connection 2}} after it has been created:&lt;br /&gt;
&lt;br /&gt;
; nmcli interactive editor&lt;br /&gt;
: {{ic|nmcli connection edit &#039;Wired connection 2&#039;}}.&amp;lt;br&amp;gt; Usage is well documented from the editor.&lt;br /&gt;
&lt;br /&gt;
; nmcli command line interface&lt;br /&gt;
: {{ic|nmcli connection modify &#039;Wired connection 2&#039; &#039;&#039;setting&#039;&#039;.&#039;&#039;property&#039;&#039; &#039;&#039;value&#039;&#039;}}. See {{man|1|nmcli}} for usage. For example, you can change its IPv4 route metric to 200 using {{ic|nmcli connection modify &#039;Wired connection 2&#039; ipv4.route-metric 200}} command.&lt;br /&gt;
To remove a setting, pass an empty field (&amp;quot;&amp;quot;) to it like this:&lt;br /&gt;
: {{ic|nmcli connection modify &#039;Wired connection 2&#039; &#039;&#039;setting&#039;&#039;.&#039;&#039;property&#039;&#039; &amp;quot;&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
; Connection file&lt;br /&gt;
: In {{ic|/etc/NetworkManager/system-connections/}}, modify the corresponding {{ic|Wired connection 2.nmconnection}} file .&amp;lt;br&amp;gt; Do not forget to reload the configuration file with {{ic|nmcli connection reload}}.&lt;br /&gt;
&lt;br /&gt;
=== nmtui ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager ships a text user interface (TUI) for managing connections, the system hostname and radio switches. It can be launched by running {{ic|nmtui}}.&lt;br /&gt;
&lt;br /&gt;
== Front-ends ==&lt;br /&gt;
&lt;br /&gt;
To provide integration with a [[desktop environment]], most users will want to install an applet. This not only provides easy access to network selection and configuration, but also provides the agent necessary for securely storing secrets. Various desktop environments have their own applet; otherwise, you can use [[#nm-applet]].&lt;br /&gt;
&lt;br /&gt;
=== GNOME ===&lt;br /&gt;
&lt;br /&gt;
[[GNOME]] has a built-in tool, accessible from the Network settings.&lt;br /&gt;
&lt;br /&gt;
=== KDE Plasma ===&lt;br /&gt;
&lt;br /&gt;
[[Install]] the {{Pkg|plasma-nm}} package. After that, add it to the KDE taskbar via the &#039;&#039;Panel options &amp;gt; Add widgets &amp;gt; Networks&#039;&#039; menu.&lt;br /&gt;
&lt;br /&gt;
=== nm-applet ===&lt;br /&gt;
&lt;br /&gt;
{{Pkg|network-manager-applet}} is a GTK 3 front-end which works under Xorg environments with a systray.&lt;br /&gt;
&lt;br /&gt;
To store connection secrets install and configure an application which implements the [https://specifications.freedesktop.org/secret-service-spec/latest/ Secret Service D-Bus API] such as [[GNOME/Keyring]], [[KDE Wallet]], or [[KeePassXC]].&lt;br /&gt;
&lt;br /&gt;
Be aware that after enabling the tick-box option {{ic|Make available to other users}} for a connection, NetworkManager stores the password in plain-text, though the respective file is accessible only to root (or other users via {{ic|nm-applet}}). See [[#Encrypted Wi-Fi passwords]].&lt;br /&gt;
&lt;br /&gt;
In order to run {{ic|nm-applet}} without a systray, you can use {{AUR|trayer}} or {{Pkg|stalonetray}}. For example, you can add a script like this one in your path:&lt;br /&gt;
&lt;br /&gt;
{{hc|nmgui|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
nm-applet    2&amp;gt;&amp;amp;1 &amp;gt; /dev/null &amp;amp;&lt;br /&gt;
stalonetray  2&amp;gt;&amp;amp;1 &amp;gt; /dev/null&lt;br /&gt;
killall nm-applet&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
When you close the &#039;&#039;stalonetray&#039;&#039; window, it closes {{ic|nm-applet}} too, so no extra memory is used once you are done with network settings.&lt;br /&gt;
&lt;br /&gt;
The applet can show notifications for events such as connecting to or disconnecting from a Wi-Fi network. For these notifications to display, ensure that you have a notification server installed - see [[Desktop notifications]]. If you use the applet without a notification server, you might see some messages in stdout/stderr, and the applet might hang. See [https://bugzilla.gnome.org/show_bug.cgi?id=788313].&lt;br /&gt;
&lt;br /&gt;
In order to run {{ic|nm-applet}} with such notifications disabled, start the applet with the following command:&lt;br /&gt;
&lt;br /&gt;
 $ nm-applet --no-agent&lt;br /&gt;
&lt;br /&gt;
{{Tip|{{ic|nm-applet}} might be started automatically with a [[XDG Autostart|autostart desktop file]], to add the {{ic|--no-agent}} option modify the Exec line there, i.e.&lt;br /&gt;
&lt;br /&gt;
{{bc|1=Exec=nm-applet --no-agent}}&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|On [[i3]], if nm-applet is started with the {{ic|--no-agent}} option, it is not possible to connect to a new encrypted Wi-Fi network by clicking on the item list because no password input dialogue window will pop out. [[journal]] will show {{ic|no secrets: No agents were available for this request}}.}}&lt;br /&gt;
&lt;br /&gt;
==== Appindicator ====&lt;br /&gt;
&lt;br /&gt;
As of version 1.18.0 Appindicator support is [https://gitlab.archlinux.org/archlinux/packaging/packages/network-manager-applet/-/commit/527448fb2a87d85055f504f463dfe961dccd75c3 available] in the official {{Pkg|network-manager-applet}} package. To use nm-applet in an Appindicator environment start the applet with the following command:&lt;br /&gt;
&lt;br /&gt;
 $ nm-applet --indicator&lt;br /&gt;
&lt;br /&gt;
=== networkmanager-dmenu ===&lt;br /&gt;
&lt;br /&gt;
Alternatively there is {{Pkg|networkmanager-dmenu}} which is a small script to manage NetworkManager connections with [[dmenu]] or [[rofi]] instead of {{ic|nm-applet}}. It provides all essential features such as connection to existing NetworkManager Wi-Fi or wired connections, connect to new Wi-Fi connections, requests passphrase if required, connect to existing VPN connections, enable/disable networking, launch &#039;&#039;nm-connection-editor&#039;&#039; GUI, connect to Bluetooth networks.&lt;br /&gt;
&lt;br /&gt;
=== switchboard ===&lt;br /&gt;
&lt;br /&gt;
Pantheon&#039;s {{Pkg|switchboard}} offers a desktop environment-agnostic way to configure NetworkManager when combined with {{Pkg|switchboard-plug-network}} and {{Pkg|nm-connection-editor}}. It can be ran with the following command:&lt;br /&gt;
&lt;br /&gt;
 $ io.elementary.settings&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
NetworkManager may require some additional steps to be able run properly. Make sure you have configured {{ic|/etc/hosts}} as described in [[Network configuration#Set the hostname]] section.&lt;br /&gt;
&lt;br /&gt;
NetworkManager has a global configuration file at {{ic|/etc/NetworkManager/NetworkManager.conf}}. Additional configuration files can be placed in {{ic|/etc/NetworkManager/conf.d/}}. Usually no configuration needs to be done to the global defaults.&lt;br /&gt;
&lt;br /&gt;
After editing a configuration file, the changes can be applied by running:&lt;br /&gt;
&lt;br /&gt;
 # nmcli general reload&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager-wait-online ===&lt;br /&gt;
&lt;br /&gt;
Enabling {{ic|NetworkManager.service}} also enables {{ic|NetworkManager-wait-online.service}}, which is a oneshot system service that waits for the network to be configured. The latter has {{ic|1=WantedBy=network-online.target}}, so it will finish only when {{ic|network-online.target}} itself is enabled or pulled in by some other unit. See also [[systemd#Running services after the network is up]].&lt;br /&gt;
&lt;br /&gt;
By default, {{ic|NetworkManager-wait-online.service}} waits for NetworkManager startup to complete, rather than waiting for network connectivity specifically (see {{man|1|nm-online}}). If {{ic|NetworkManager-wait-online.service}} finishes before the network is really up, resulting in failed services on boot, [[extend the unit]] to remove the {{ic|-s}} from the {{ic|ExecStart}} line:&lt;br /&gt;
&lt;br /&gt;
 [Service]&lt;br /&gt;
 ExecStart=&lt;br /&gt;
 ExecStart=/usr/bin/nm-online -q&lt;br /&gt;
&lt;br /&gt;
Be aware that this can cause [https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org/thread/EGC324JD3HJCGVN7J55WYPRLFDA3TP7N/ other issues].&lt;br /&gt;
&lt;br /&gt;
In some cases, the service will still fail to start successfully on boot due to the timeout setting being too short. [[Edit]] the service to change {{ic|NM_ONLINE_TIMEOUT}} from {{ic|60}} to a higher value.&lt;br /&gt;
&lt;br /&gt;
=== Set up PolicyKit permissions ===&lt;br /&gt;
&lt;br /&gt;
By default, all users in active local sessions are allowed to change most network settings without a password. See [[General troubleshooting#Session permissions]] to check your session type. In most cases, everything should work out of the box.&lt;br /&gt;
&lt;br /&gt;
Some actions (such as changing the system hostname) require an administrator password. In this case, you need to [[Users and groups#Group management|add]] yourself to the {{ic|wheel}} group and run a [[Polkit#Authentication agents|Polkit authentication agent]] which will prompt for your password.&lt;br /&gt;
&lt;br /&gt;
For remote sessions (e.g. [[TigerVNC#Running vncserver for virtual (headless) sessions|headless VNC]]), you have several options for obtaining the necessary privileges to use NetworkManager:&lt;br /&gt;
&lt;br /&gt;
# [[Users and groups#Group management|Add]] yourself to the {{ic|wheel}} group. You will have to enter your password for every action. Note that your user account may be granted other permissions as well, such as the ability to use [[sudo]] without entering the root password.&lt;br /&gt;
# [[Users and groups#Group management|Add]] yourself to the {{ic|network}} group and create {{ic|/etc/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules}} with the following content: {{bc|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
polkit.addRule(function(action, subject) {&lt;br /&gt;
  if (action.id.indexOf(&amp;quot;org.freedesktop.NetworkManager.&amp;quot;) == 0 &amp;amp;&amp;amp; subject.isInGroup(&amp;quot;network&amp;quot;)) {&lt;br /&gt;
    return polkit.Result.YES;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}} All users in the {{ic|network}} group will be able to add and remove networks without a password (which means you do not have to run a Polkit authentication agent, so this option will also work in SSH sessions).&lt;br /&gt;
&lt;br /&gt;
=== Proxy settings ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager does support some proxy settings. While they can not be directly modified using &#039;&#039;nmtui&#039;&#039;, &#039;&#039;nm-applet&#039;&#039; and &#039;&#039;nmcli&#039;&#039; support those.&lt;br /&gt;
See the proxy settings in {{man|5|nm-settings-nmcli}}.&lt;br /&gt;
&lt;br /&gt;
Additionally, custom proxy commands can always be run using dispatcher scripts, see [[#Dispatcher examples]].&lt;br /&gt;
&lt;br /&gt;
See also [[Proxy settings]].&lt;br /&gt;
&lt;br /&gt;
=== Checking connectivity ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager can try to reach a webserver after connecting to a network in order to determine if it is e.g behind a captive portal. The default host (configured in {{ic|/usr/lib/NetworkManager/conf.d/20-connectivity.conf}}) is [https://ping.archlinux.org ping.archlinux.org] (a CNAME alias of redirect.archlinux.org). To use a different webserver or to disable connectivity checking, create {{ic|/etc/NetworkManager/conf.d/20-connectivity.conf}}, see {{man|5|NetworkManager.conf|CONNECTIVITY SECTION}}. Below is an example of using GNOME servers (it does not require the use of [[GNOME]]):&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/20-connectivity.conf|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
[connectivity]&lt;br /&gt;
uri=http://nmcheck.gnome.org/check_network_status.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
To disable NetworkManager&#039;s connectivity check, use the following configuration. This can be useful when connected to a VPN that blocks connectivity checks.&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/20-connectivity.conf|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
[connectivity]&lt;br /&gt;
enabled=false&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Although automatic connectivity checks are a potential privacy leak, Arch Linux&#039;s default connectivity URL is committed to not logging any access. See [https://gitlab.archlinux.org/archlinux/infrastructure/-/commit/fabccd0f61e5dea3925e8a0c6a46d56d5750c121#a4f34381bbb18ea77bfb3dd11a8aeca707078fca_0_26] [https://gitlab.archlinux.org/archlinux/infrastructure/-/blob/master/roles/ping/templates/nginx.d.conf.j2].}}&lt;br /&gt;
&lt;br /&gt;
=== Captive portals ===&lt;br /&gt;
&lt;br /&gt;
{{Style|Complex scripts should not be maintained on the wiki.}}&lt;br /&gt;
&lt;br /&gt;
For those behind a [[Wikipedia:Captive portal|captive portal]], the desktop manager may automatically open a window asking for credentials. If your desktop does not, you can use {{Pkg|capnet-assist}} package (however, it currently has a broken NetworkManager dispatcher script). Alternatively, you can create a NetworkManager dispatcher script with the following content:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/90-open_captive_portal|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh -e&lt;br /&gt;
# Script to dispatch NetworkManager events&lt;br /&gt;
#&lt;br /&gt;
# Runs shows a login webpage on walled garden networks.&lt;br /&gt;
# See NetworkManager(8) for further documentation of the dispatcher events.&lt;br /&gt;
&lt;br /&gt;
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&lt;br /&gt;
&lt;br /&gt;
if [ -x &amp;quot;/usr/bin/logger&amp;quot; ]; then&lt;br /&gt;
    logger=&amp;quot;/usr/bin/logger -s -t captive-portal&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
    logger=&amp;quot;:&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
wait_for_process() {&lt;br /&gt;
    PNAME=$1&lt;br /&gt;
    while [ -z &amp;quot;$(/usr/bin/pgrep $PNAME)&amp;quot; ]; do&lt;br /&gt;
        sleep 3;&lt;br /&gt;
    done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#launch the browser, but on boot we need to wait that nm-applet starts&lt;br /&gt;
start_browser() {&lt;br /&gt;
    local user=&amp;quot;$1&amp;quot;&lt;br /&gt;
    local display=&amp;quot;$2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    export DISPLAY=&amp;quot;$display&amp;quot;&lt;br /&gt;
    wait_for_process nm-applet&lt;br /&gt;
&lt;br /&gt;
    export XAUTHORITY=&amp;quot;/home/$user/.Xauthority&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    $logger &amp;quot;Running browser as &#039;$user&#039; with display &#039;$display&#039; to login in captive portal&amp;quot;&lt;br /&gt;
    sudo -u &amp;quot;$user&amp;quot; --preserve-env=DISPLAY,XAUTHORITY -H xdg-open http://capnet.elementary.io 2&amp;gt;&amp;amp;1 &amp;gt; /dev/null&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Run the right scripts&lt;br /&gt;
case &amp;quot;$2&amp;quot; in&lt;br /&gt;
    connectivity-change)&lt;br /&gt;
    $logger -p user.debug &amp;quot;dispatcher script triggered on connectivity change: $CONNECTIVITY_STATE&amp;quot;&lt;br /&gt;
    if [ &amp;quot;$CONNECTIVITY_STATE&amp;quot; = &amp;quot;PORTAL&amp;quot; ]; then&lt;br /&gt;
        # Match last column of who&#039;s output with &#039; :[at least one digit] &#039;&lt;br /&gt;
        who | awk &#039;$NF ~ /\(:[0-9]+\)/ { print $1 &amp;quot; &amp;quot; substr($NF, 2, length($NF)-2) };&#039; | \&lt;br /&gt;
        while read user display; do&lt;br /&gt;
            start_browser $user $display || $logger -p user.err &amp;quot;Failed for user: &#039;$user&#039; display: &#039;$display&#039;&amp;quot;&lt;br /&gt;
        done&lt;br /&gt;
    fi&lt;br /&gt;
    ;;&lt;br /&gt;
    *)&lt;br /&gt;
    # In a down phase&lt;br /&gt;
    exit 0&lt;br /&gt;
    ;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Make the script [[executable]]. But that script assumes you use X and simply opens http page. It might not work for everyone.&lt;br /&gt;
&lt;br /&gt;
You will need to [[restart]] {{ic|NetworkManager.service}} or reboot for this to start working. Once you do, the dispatcher script should open a login window once it detects you are behind a captive portal.&lt;br /&gt;
&lt;br /&gt;
Simple solution is [https://github.com/Seme4eg/captive-portal-sh captive-portal-sh] - shell script that obtains captive portal URL and opens it in your default browser (for Wayland users only).&lt;br /&gt;
&lt;br /&gt;
Another solution is {{AUR|captive-browser-git}} based on Google Chrome.&lt;br /&gt;
&lt;br /&gt;
==== iwd support for captive portal support on legacy hardware ====&lt;br /&gt;
&lt;br /&gt;
Some older Wi-Fi chips (e.g. Broadcom BCM4360) require the proprietary {{ic|wl}} driver, which lacks support for the OWE/Elliptic-Curve handshake that many captive-portal hotspots use before presenting a login page. By switching NetworkManager’s Wi-Fi backend to {{ic|iwd}} (see [[#Using iwd as the Wi-Fi backend]]), which implements the full OWE key exchange in userspace over the existing driver, you can complete the encrypted association, obtain a DHCP lease, and trigger the portal “PORTAL” state. Once that is done, any dispatcher script or browser-launcher will reliably pop up the login page on hardware that otherwise could never fully connect.&lt;br /&gt;
&lt;br /&gt;
=== DHCP client ===&lt;br /&gt;
&lt;br /&gt;
By default NetworkManager uses its internal DHCP client. The internal DHCPv4 plugin is based on the [https://nettools.github.io/n-dhcp4/ nettools&#039; n-dhcp4] library, while the internal DHCPv6 plugin is made from code based on systemd-networkd.&lt;br /&gt;
&lt;br /&gt;
To use a different DHCP client [[install]] one of the alternatives:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|dhcpcd}} - [[dhcpcd]]&lt;br /&gt;
* {{Pkg|dhclient}} - [[dhclient]]&lt;br /&gt;
&lt;br /&gt;
To change the DHCP client backend, set the option {{ic|1=main.dhcp=&#039;&#039;dhcp_client_name&#039;&#039;}} with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}. E.g.:&lt;br /&gt;
&lt;br /&gt;
{{hc|1=/etc/NetworkManager/conf.d/dhcp-client.conf|2=&lt;br /&gt;
[main]&lt;br /&gt;
dhcp=dhcpcd&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
Do not enable the systemd units shipped with the {{Pkg|dhclient}} and {{Pkg|dhcpcd}} packages. They will conflict with NetworkManager, see the note in [[#Installation]] for details.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== DNS management ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager&#039;s DNS management is described in the GNOME project&#039;s wiki page—[https://wiki.gnome.org/Projects/NetworkManager/DNS Projects/NetworkManager/DNS].&lt;br /&gt;
&lt;br /&gt;
==== DNS caching and conditional forwarding ====&lt;br /&gt;
&lt;br /&gt;
NetworkManager has a plugin to enable DNS caching and conditional forwarding ([https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/143 previously] called &amp;quot;split DNS&amp;quot; in NetworkManager&#039;s documentation) using [[dnsmasq]] or [[systemd-resolved]]. The advantages of this setup is that DNS lookups will be cached, shortening resolve times, and DNS lookups of VPN hosts will be routed to the relevant VPN&#039;s DNS servers. This is especially useful if you are connected to more than one VPN.&lt;br /&gt;
&lt;br /&gt;
{{Note|If {{ic|/etc/resolv.conf}} is a symlink to {{ic|/run/systemd/resolve/stub-resolv.conf}}, {{ic|/run/systemd/resolve/resolv.conf}},{{ic|/lib/systemd/resolv.conf}} or {{ic|/usr/lib/systemd/resolv.conf}}, NetworkManager will choose systemd-resolved automatically. To use dnsmasq, you must first remove that symlink, then restart NetworkManager.}}&lt;br /&gt;
&lt;br /&gt;
===== dnsmasq =====&lt;br /&gt;
&lt;br /&gt;
Make sure {{Pkg|dnsmasq}} has been installed. Then set {{ic|1=main.dns=dnsmasq}} with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/dns.conf|2=&lt;br /&gt;
[main]&lt;br /&gt;
dns=dnsmasq&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Now run {{ic|nmcli general reload}} as root. NetworkManager will automatically start dnsmasq and add {{ic|127.0.0.1}} to {{ic|/etc/resolv.conf}}. The original DNS servers can be found in {{ic|/run/NetworkManager/no-stub-resolv.conf}}. You can verify dnsmasq is being used by doing the same DNS lookup twice with {{ic|drill example.com}} and verifying the server and query times.&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* You do not need to start {{ic|dnsmasq.service}} or edit {{ic|/etc/dnsmasq.conf}}. NetworkManager will start dnsmasq without using the systemd service and without reading the dnsmasq&#039;s default configuration file(s).&lt;br /&gt;
* The dnsmasq instance started by NetworkManager will bind to {{ic|127.0.0.1:53}}, you cannot run any other software (including {{ic|dnsmasq.service}}) on the same address and port.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====== Custom dnsmasq configuration ======&lt;br /&gt;
&lt;br /&gt;
Custom configurations can be created for &#039;&#039;dnsmasq&#039;&#039; by creating configuration files in {{ic|/etc/NetworkManager/dnsmasq.d/}}. For example, to change the size of the DNS cache (which is stored in RAM):&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dnsmasq.d/cache.conf|2=&lt;br /&gt;
cache-size=1000&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can check the configuration file syntax with:&lt;br /&gt;
&lt;br /&gt;
 $ dnsmasq --test --conf-file=/dev/null --conf-dir=/etc/NetworkManager/dnsmasq.d&lt;br /&gt;
&lt;br /&gt;
See {{man|8|dnsmasq}} for all available options.&lt;br /&gt;
&lt;br /&gt;
====== IPv6 ======&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|This does not solve the issue because NetworkManager does not add {{ic|::1}} to {{ic|/etc/resolv.conf}}. Unless {{ic|@::1}} is manually passed to drill, it will still fail with {{ic|Error: error sending query: No (valid) nameservers defined in the resolver}}.}}&lt;br /&gt;
&lt;br /&gt;
Enabling {{ic|dnsmasq}} in NetworkManager may break IPv6-only DNS lookups (i.e. {{ic|drill -6 [hostname]}}) which would otherwise work. In order to resolve this, creating the following file will configure &#039;&#039;dnsmasq&#039;&#039; to also listen to the IPv6 loopback:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dnsmasq.d/ipv6-listen.conf|2=&lt;br /&gt;
listen-address=::1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
In addition, {{ic|dnsmasq}} also does not prioritize upstream IPv6 DNS. Unfortunately NetworkManager does not do this ([https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/936712 Ubuntu Bug]). A workaround would be to disable IPv4 DNS in the NetworkManager config, assuming one exists.&lt;br /&gt;
&lt;br /&gt;
====== DNSSEC ======&lt;br /&gt;
&lt;br /&gt;
The dnsmasq instance started by NetworkManager by default will not validate [[DNSSEC]]. To enable DNSSEC validation, thus breaking DNS resolution with name servers that do not support it, create the following configuration file:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dnsmasq.d/dnssec.conf|2=&lt;br /&gt;
conf-file=/usr/share/dnsmasq/trust-anchors.conf&lt;br /&gt;
dnssec&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== systemd-resolved =====&lt;br /&gt;
&lt;br /&gt;
{{Expansion|NetworkManager 1.16 adds a new setting {{ic|main.systemd-resolved}}[https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commit/d4eb4cb45f41b1751cacf71da558bf8f0988f383] (enabled by default). It unconditionally sends DNS configuration to systemd-resolved. Related to &amp;quot;Preserving resolv.conf&amp;quot; from [[systemd-resolved#DNS]]?}}&lt;br /&gt;
&lt;br /&gt;
NetworkManager can use [[systemd-resolved]] as a DNS resolver and cache. Make sure that &#039;&#039;systemd-resolved&#039;&#039; is properly configured and that {{ic|systemd-resolved.service}} is [[started]] before using it.&lt;br /&gt;
&lt;br /&gt;
systemd-resolved will be used automatically if {{ic|/etc/resolv.conf}} is a [[systemd-resolved#DNS|symlink]] to {{ic|/run/systemd/resolve/stub-resolv.conf}}, {{ic|/run/systemd/resolve/resolv.conf}} or {{ic|/usr/lib/systemd/resolv.conf}}.&lt;br /&gt;
&lt;br /&gt;
You can enable it explicitly by setting {{ic|1=main.dns=systemd-resolved}} with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/dns.conf|2=&lt;br /&gt;
[main]&lt;br /&gt;
dns=systemd-resolved&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== DNS resolver with an openresolv subscriber =====&lt;br /&gt;
&lt;br /&gt;
If [[openresolv]] has a subscriber for your local [[DNS resolver]], set up the subscriber and [[#Use openresolv|configure NetworkManager to use openresolv]].&lt;br /&gt;
&lt;br /&gt;
Because NetworkManager advertises a single &amp;quot;interface&amp;quot; to &#039;&#039;resolvconf&#039;&#039;, it is not possible to implement conditional forwarding between two NetworkManager connections. See [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/153 NetworkManager issue 153].&lt;br /&gt;
&lt;br /&gt;
This can be partially mitigated if you set {{ic|1=private_interfaces=&amp;quot;*&amp;quot;}} in {{ic|/etc/resolvconf.conf}}[https://roy.marples.name/projects/openresolv/configuration/]. Any queries for domains that are not in search domain list will not get forwarded. They will be handled according to the local resolver&#039;s configuration, for example, forwarded to another DNS server or resolved recursively from the DNS root.&lt;br /&gt;
&lt;br /&gt;
==== Custom DNS servers ====&lt;br /&gt;
&lt;br /&gt;
===== Setting custom global DNS servers =====&lt;br /&gt;
&lt;br /&gt;
To set DNS servers for all connections, specify them in {{man|5|NetworkManager.conf}} using the syntax {{ic|1=servers=&#039;&#039;serveripaddress1&#039;&#039;,&#039;&#039;serveripaddress2&#039;&#039;,&#039;&#039;serveripaddress3&#039;&#039;}} in a section named {{ic|[global-dns-domain-*]}}. For example:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/dns-servers.conf|2=&lt;br /&gt;
[global-dns-domain-*]&lt;br /&gt;
servers=::1,127.0.0.1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* If you use [[#DNS caching and conditional forwarding|NetworkManager&#039;s dnsmasq or systemd-resolved plugin]] or [[#DNS resolver with an openresolv subscriber|openresolv subscribers]], then do not specify loopback addresses with the {{ic|1=servers=}} option, it can break DNS resolution.&lt;br /&gt;
* The specified servers do not get sent to [[systemd-resolved]], the connection&#039;s DNS servers are used instead. See [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1366 NetworkManager issue 1366] and [https://github.com/systemd/systemd/issues/33754 systemd issue 33754].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== Setting custom DNS servers in a connection =====&lt;br /&gt;
&lt;br /&gt;
====== Setting custom DNS servers in a connection (GUI) ======&lt;br /&gt;
&lt;br /&gt;
Setup will depend on the type of front-end used; the process usually involves right-clicking on the applet, editing (or creating) a profile, and then choosing DHCP type as &#039;&#039;Automatic (specify addresses)&#039;&#039;. The DNS addresses will need to be entered and are usually in this form: {{ic|127.0.0.1, &#039;&#039;DNS-server-one&#039;&#039;, ...}}.&lt;br /&gt;
&lt;br /&gt;
====== Setting custom DNS servers in a connection (nmcli / connection file) ======&lt;br /&gt;
&lt;br /&gt;
To set up DNS Servers per connection, you change the {{ic|ipv4.dns}} and {{ic|ipv6.dns}} settings (and their associated {{ic|dns-search}} and {{ic|dns-options}}) in the [[#Edit a connection|connection settings]].&lt;br /&gt;
&lt;br /&gt;
If {{ic|method}} is set to {{ic|auto}} (when you use DHCP/RA), you need to set {{ic|ignore-auto-dns}} to {{ic|yes}}.&lt;br /&gt;
&lt;br /&gt;
To use DNS over TLS ([[#systemd-resolved|requires systemd-resolved]]), specify the DNS servers using the syntax {{ic|1=dns=&#039;&#039;ip.address&#039;&#039;#&#039;&#039;servername&#039;&#039;;}} and additionally set the {{ic|connection.dns-over-tls}} setting to {{ic|2}}. For example, to use Quad9:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/system-connections/Example Wi-Fi.nmconnection|2=&lt;br /&gt;
...&lt;br /&gt;
[connection]&lt;br /&gt;
...&lt;br /&gt;
dns-over-tls=2&lt;br /&gt;
&lt;br /&gt;
[ipv4]&lt;br /&gt;
...&lt;br /&gt;
dns=9.9.9.9#dns.quad9.net;149.112.112.112#dns.quad9.net;&lt;br /&gt;
ignore-auto-dns=true&lt;br /&gt;
&lt;br /&gt;
[ipv6]&lt;br /&gt;
...&lt;br /&gt;
dns=2620:fe::fe#dns.quad9.net;2620:fe::9#dns.quad9.net;&lt;br /&gt;
ignore-auto-dns=true&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|This example uses Quad9. Replace it with a DNS resolver you trust. See [[Domain name resolution#Third-party DNS services]].}}&lt;br /&gt;
&lt;br /&gt;
==== /etc/resolv.conf ====&lt;br /&gt;
&lt;br /&gt;
NetworkManager&#039;s {{ic|/etc/resolv.conf}} management mode is configured with the {{ic|main.rc-manager}} setting. {{Pkg|networkmanager}} sets it to {{ic|symlink}} as opposed to the upstream default {{ic|auto}}. The setting and its values are documented in the {{man|5|NetworkManager.conf}} man page.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Using openresolv allows NetworkManager to coexist with other &#039;&#039;resolvconf&#039;&#039; supporting software or, for example, to run a local DNS caching and split-DNS resolver for which openresolv has a [[openresolv#Subscribers|subscriber]]. Note that conditional forwarding is [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/153 not yet fully supported] when using NetworkManager with openresolv.}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NetworkManager&#039;&#039; also offers hooks via so called dispatcher scripts that can be used to alter the {{ic|/etc/resolv.conf}} after network changes. See [[#Network services with NetworkManager dispatcher]] and {{man|8|NetworkManager}} for more information.&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* If NetworkManager is configured to use either [[#dnsmasq|dnsmasq]] or [[#systemd-resolved|systemd-resolved]], then the appropriate loopback addresses will be written to {{ic|/etc/resolv.conf}}.&lt;br /&gt;
* The {{ic|resolv.conf}} file NetworkManager writes or would write to {{ic|/etc/resolv.conf}} can be found at {{ic|/run/NetworkManager/resolv.conf}}.&lt;br /&gt;
* A {{ic|resolv.conf}} file with the acquired name servers and search domains can be found at {{ic|/run/NetworkManager/no-stub-resolv.conf}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== Unmanaged /etc/resolv.conf =====&lt;br /&gt;
&lt;br /&gt;
To stop NetworkManager from touching {{ic|/etc/resolv.conf}}, set {{ic|1=main.dns=none}} with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/dns.conf|2=&lt;br /&gt;
[main]&lt;br /&gt;
dns=none&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|You might also want to set {{ic|1=main.systemd-resolved=false}}, so that NetworkManager does not send the DNS configuration to [[systemd-resolved]].}}&lt;br /&gt;
&lt;br /&gt;
{{Note|See [[#DNS caching and conditional forwarding]], to configure NetworkManager using other DNS backends like [[dnsmasq]] and [[systemd-resolved]], instead of using {{ic|1=main.dns=none}}.}}&lt;br /&gt;
&lt;br /&gt;
After that {{ic|/etc/resolv.conf}} might be a broken symlink that you will need to remove. Then, just create a new {{ic|/etc/resolv.conf}} file.&lt;br /&gt;
&lt;br /&gt;
===== Use openresolv =====&lt;br /&gt;
&lt;br /&gt;
{{Note|NetworkManager does not support using systemd-resolved&#039;s &#039;&#039;resolvconf&#039;&#039; interface ({{man|1|resolvectl|COMPATIBILITY WITH RESOLVCONF(8)}}) which is provided by {{Pkg|systemd-resolvconf}}.&lt;br /&gt;
* Do not set {{ic|1=main.rc-manager=resolvconf}} when using [[systemd-resolved]], instead make sure to [[systemd-resolved#DNS|correctly create the /etc/resolv.conf symlink]] or [[#systemd-resolved|configure NetworkManager to use systemd-resolved explicitly]].&lt;br /&gt;
* Make sure the {{Pkg|systemd-resolvconf}} package is not installed when systemd-resolved is not used. Unless {{ic|systemd-resolved.service}} started, it will break all networking software (not just NetworkManager) that use resolvconf.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To configure NetworkManager to use [[openresolv]], set {{ic|1=main.rc-manager=resolvconf}} with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/rc-manager.conf|2=&lt;br /&gt;
[main]&lt;br /&gt;
rc-manager=resolvconf&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Firewall ===&lt;br /&gt;
&lt;br /&gt;
You can [[Firewalld#Using NetworkManager to manage zones|assign a firewalld zone]] based on your current connection. For example a restrictive firewall when at work, and a less restrictive one when at home.&lt;br /&gt;
&lt;br /&gt;
This can also be done with [[#Network services with NetworkManager dispatcher|NetworkManager dispatcher]].&lt;br /&gt;
&lt;br /&gt;
== Network services with NetworkManager dispatcher ==&lt;br /&gt;
&lt;br /&gt;
There are quite a few network services that you will not want running until NetworkManager brings up an interface. NetworkManager has the ability to start services when you connect to a network and stop them when you disconnect (e.g. when using [[NFS]], [[SMB]] and [[NTPd]]).&lt;br /&gt;
&lt;br /&gt;
To activate the feature you need to [[enable]] and [[start]] the {{ic|NetworkManager-dispatcher.service}}.&lt;br /&gt;
&lt;br /&gt;
Once the service is active, scripts can be added to the {{ic|/etc/NetworkManager/dispatcher.d}} directory.&lt;br /&gt;
&lt;br /&gt;
Scripts must be owned by &#039;&#039;&#039;root&#039;&#039;&#039;, otherwise the dispatcher will not execute them. For added security, set group [[ownership]] to root as well:&lt;br /&gt;
&lt;br /&gt;
 # chown root:root /etc/NetworkManager/dispatcher.d/&#039;&#039;10-script.sh&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Make sure the file is [[executable]]. &lt;br /&gt;
&lt;br /&gt;
The scripts will be run in alphabetical order at connection time, and in reverse alphabetical order at disconnect time. To ensure what order they come up in, it is common to use numerical characters prior to the name of the script (e.g. {{ic|10-portmap}} or {{ic|30-netfs}} (which ensures that the &#039;&#039;portmapper&#039;&#039; is up before NFS mounts are attempted).&lt;br /&gt;
&lt;br /&gt;
Scripts will receive the following arguments:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Interface name:&#039;&#039;&#039; e.g. {{ic|eth0}}&lt;br /&gt;
* &#039;&#039;&#039;Action:&#039;&#039;&#039; &#039;&#039;up&#039;&#039;, &#039;&#039;down&#039;&#039;, &#039;&#039;vpn-up&#039;&#039;, &#039;&#039;vpn-down&#039;&#039;, ... (see {{man|8|NetworkManager-dispatcher}} for the complete list)&lt;br /&gt;
&lt;br /&gt;
{{Warning|If you connect to foreign or public networks, be aware of what services you are starting and what servers you expect to be available for them to connect to. You could make a security hole by starting the wrong services while connected to a public network.}}&lt;br /&gt;
&lt;br /&gt;
=== Avoiding the dispatcher timeout ===&lt;br /&gt;
&lt;br /&gt;
If the above is working, then this section is not relevant. However, there is a general problem related to running dispatcher scripts which take longer to be executed. Initially an internal timeout of three seconds only was used. If the called script did not complete in time, it was killed. Later the timeout was extended to about 20 seconds (see the [https://bugzilla.redhat.com/show_bug.cgi?id=982734 Bugtracker] for more information). If the timeout still creates the problem, a work around may be to use a [[drop-in file]] for the {{ic|NetworkManager-dispatcher.service}} to remain active after exit: &lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/systemd/system/NetworkManager-dispatcher.service.d/remain_after_exit.conf|2=&lt;br /&gt;
[Service]&lt;br /&gt;
RemainAfterExit=yes&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Now start and enable the modified {{ic|NetworkManager-dispatcher}} service.&lt;br /&gt;
&lt;br /&gt;
{{Warning|Adding the {{ic|RemainAfterExit}} line to it will prevent the dispatcher from closing. Unfortunately, the dispatcher &#039;&#039;&#039;has&#039;&#039;&#039; to close before it can run your scripts again. With it the dispatcher will not time out but it also will not close, which means that the scripts will only run once per boot. Therefore, do not add the line unless the timeout is definitely causing a problem.}}&lt;br /&gt;
&lt;br /&gt;
=== Dispatcher examples ===&lt;br /&gt;
&lt;br /&gt;
==== Automatically set the timezone ====&lt;br /&gt;
&lt;br /&gt;
Create a [[#Network services with NetworkManager dispatcher|NetworkManager dispatcher script]] and make it [[executable]]:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/09-timezone|&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
case &amp;quot;$2&amp;quot; in&lt;br /&gt;
    up)&lt;br /&gt;
        timedatectl set-timezone &amp;quot;$(curl --fail &amp;lt;nowiki&amp;gt;https://ipapi.co/timezone&amp;lt;/nowiki&amp;gt;)&amp;quot;&lt;br /&gt;
    ;;&lt;br /&gt;
esac&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|Using {{ic|connectivity-change}} instead of {{ic|up}} can prevent timezone changes when connecting to VPNs with clients such as [[OpenConnect]].}}&lt;br /&gt;
&lt;br /&gt;
Alternatively, the tool {{aur|tzupdate}} automatically sets the timezone based on the geolocation of the IP address. This [https://medium.com/@ipdata_co/what-is-the-best-commercial-ip-geolocation-api-d8195cda7027 comparison of the most popular IP geolocation apis] may be helpful in deciding which API to use in production.&lt;br /&gt;
&lt;br /&gt;
==== Mount remote directory with sshfs ====&lt;br /&gt;
&lt;br /&gt;
As the script is run in a very restrictive environment, you have to export {{ic|SSH_AUTH_SOCK}} in order to connect to your SSH agent. There are different ways to accomplish this, see [https://bbs.archlinux.org/viewtopic.php?pid=1042030#p1042030 this message] for more information. The example below works with [[GNOME Keyring]], and will ask you for the password if not unlocked already. In case NetworkManager connects automatically on login, it is likely &#039;&#039;gnome-keyring&#039;&#039; has not yet started and the export will fail (hence the sleep). The {{ic|UUID}} to match can be found with the command {{ic|nmcli connection status}} or {{ic|nmcli connection list}}.     &lt;br /&gt;
&lt;br /&gt;
{{bc|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
USER=&#039;username&#039;&lt;br /&gt;
REMOTE=&#039;user@host:/remote/path&#039;&lt;br /&gt;
LOCAL=&#039;/local/path&#039;&lt;br /&gt;
&lt;br /&gt;
interface=$1 status=$2&lt;br /&gt;
if [ &amp;quot;$CONNECTION_UUID&amp;quot; = &amp;quot;&amp;lt;/nowiki&amp;gt;&#039;&#039;uuid&#039;&#039;&amp;lt;nowiki&amp;gt;&amp;quot; ]; then&lt;br /&gt;
  case $status in&lt;br /&gt;
    up)&lt;br /&gt;
      # sleep 10&lt;br /&gt;
      SSH_AUTH_SOCK=$(find /tmp -maxdepth 1 -type s -user &amp;quot;$USER&amp;quot; -name &#039;ssh&#039;)&lt;br /&gt;
      export SSH_AUTH_SOCK&lt;br /&gt;
      su &amp;quot;$USER&amp;quot; -c &amp;quot;sshfs $REMOTE $LOCAL&amp;quot;&lt;br /&gt;
      ;;&lt;br /&gt;
    down)&lt;br /&gt;
      fusermount -u &amp;quot;$LOCAL&amp;quot;&lt;br /&gt;
      ;;&lt;br /&gt;
  esac&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
==== Mounting of SMB shares ====&lt;br /&gt;
&lt;br /&gt;
Some [[SMB]] shares are only available on certain networks or locations (e.g. at home). You can use the dispatcher to only mount SMB shares that are present at your current location.&lt;br /&gt;
&lt;br /&gt;
The following script will check if we connected to a specific network and mount shares accordingly:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/30-mount-smb.sh|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# Find the connection UUID with &amp;quot;nmcli connection show&amp;quot; in terminal.&lt;br /&gt;
# All NetworkManager connection types are supported: wireless, VPN, wired...&lt;br /&gt;
if [ &amp;quot;$2&amp;quot; = &amp;quot;up&amp;quot; ]; then&lt;br /&gt;
  if [ &amp;quot;$CONNECTION_UUID&amp;quot; = &amp;quot;uuid&amp;quot; ]; then&lt;br /&gt;
    mount /your/mount/point &amp;amp; &lt;br /&gt;
    # add more shares as needed&lt;br /&gt;
  fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
The following script will unmount all SMB shares before a software initiated disconnect from a specific network:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/pre-down.d/30-umount-smb.sh|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$CONNECTION_UUID&amp;quot; = &amp;quot;uuid&amp;quot; ]; then&lt;br /&gt;
  umount -a -l -t cifs&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Make sure this script is located in the {{ic|pre-down.d}} sub-directory as shown above, otherwise it will unmount all shares on any connection state change.}}&lt;br /&gt;
&lt;br /&gt;
The following script will attempt to unmount all SMB shares following an unexpected disconnect from a specific network:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/40-umount-smb.sh|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$CONNECTION_UUID&amp;quot; = &amp;quot;uuid&amp;quot; ]; then&lt;br /&gt;
  if [ &amp;quot;$2&amp;quot; = &amp;quot;down&amp;quot; ]; then&lt;br /&gt;
    umount -a -l -t cifs&lt;br /&gt;
  fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* Since NetworkManager 0.9.8, the &#039;&#039;pre-down&#039;&#039; and &#039;&#039;down&#039;&#039; events are not executed on shutdown or restart, see [https://bugzilla.gnome.org/show_bug.cgi?id&amp;amp;#61;701242 this bug report] for more info.&lt;br /&gt;
* The previous &#039;&#039;umount&#039;&#039; scripts are still prone to leaving applications actually accessing the mount to &#039;hang&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
An alternative is to use the script as seen in [[NFS#Using a NetworkManager dispatcher]]:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/30-smb.sh|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# Find the connection UUID with &amp;quot;nmcli con show&amp;quot; in terminal.&lt;br /&gt;
# All NetworkManager connection types are supported: wireless, VPN, wired...&lt;br /&gt;
WANTED_CON_UUID=&amp;quot;CHANGE-ME-NOW-9c7eff15-010a-4b1c-a786-9b4efa218ba9&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$CONNECTION_UUID&amp;quot; = &amp;quot;$WANTED_CON_UUID&amp;quot; ]; then&lt;br /&gt;
    &lt;br /&gt;
    # Script parameter $1: network interface name, not used&lt;br /&gt;
    # Script parameter $2: dispatched event&lt;br /&gt;
    &lt;br /&gt;
    case &amp;quot;$2&amp;quot; in&lt;br /&gt;
        &amp;quot;up&amp;quot;)&lt;br /&gt;
            mount -a -t cifs&lt;br /&gt;
            ;;&lt;br /&gt;
        &amp;quot;down&amp;quot;|&amp;quot;pre-down&amp;quot;|&amp;quot;vpn-pre-down&amp;quot;)&lt;br /&gt;
            umount -l -a -t cifs &amp;gt;/dev/null&lt;br /&gt;
            ;;&lt;br /&gt;
    esac&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|This script ignores mounts with the {{ic|noauto}} option, remove this mount option or use {{ic|auto}} to allow the dispatcher to manage these mounts.}}&lt;br /&gt;
&lt;br /&gt;
Create a symlink inside {{ic|/etc/NetworkManager/dispatcher.d/pre-down/}} to catch the {{ic|pre-down}} events:&lt;br /&gt;
&lt;br /&gt;
 # ln -s ../30-smb.sh /etc/NetworkManager/dispatcher.d/pre-down.d/30-smb.sh&lt;br /&gt;
&lt;br /&gt;
==== Mounting of NFS shares ====&lt;br /&gt;
&lt;br /&gt;
See [[NFS#Using a NetworkManager dispatcher]].&lt;br /&gt;
&lt;br /&gt;
==== Use dispatcher to automatically toggle wireless depending on LAN cable being plugged in ====&lt;br /&gt;
&lt;br /&gt;
The idea is to only turn Wi-Fi on when the LAN cable is unplugged (for example when detaching from a laptop dock), and for Wi-Fi to be automatically disabled, once a LAN cable is plugged in again.&lt;br /&gt;
&lt;br /&gt;
Create the following dispatcher script[https://superuser.com/questions/233448/disable-wlan-if-wired-cable-network-is-available], replacing {{ic|&#039;&#039;Your_Ethernet_Interface&#039;&#039;}} with your ethernet interface&#039;s device name.&lt;br /&gt;
&lt;br /&gt;
{{Note|You can get a list of interfaces using [[#nmcli examples|nmcli]] ({{ic|nmcli d {{!}} grep ethernet}}). The Ethernet interfaces start with {{ic|en}} or {{ic|eth}}, e.g. {{ic|enp0s5}} or {{ic|eth0}}.}}&lt;br /&gt;
&lt;br /&gt;
Remember to make the script [[executable]]. You can verify that it works by [[restart]]ing {{ic|NetworkManager.service}}, running {{ic|ip a}}, and checking that {{ic|wlp3s0}} (or whatever your Wi-Fi interface is called) is in {{ic|state DOWN}}. If you encounter unexpected behavior, check the [[journal]] of {{ic|NetworkManager-dispatcher.service}}.&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/99-wifi-auto-toggle.sh|2=&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LOG_PREFIX=&amp;quot;WiFi Auto-Toggle&amp;quot;&lt;br /&gt;
ETHERNET_INTERFACE=&amp;quot;&#039;&#039;Your_Ethernet_Interface&#039;&#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$1&amp;quot; = &amp;quot;$ETHERNET_INTERFACE&amp;quot; ]; then&lt;br /&gt;
    case &amp;quot;$2&amp;quot; in&lt;br /&gt;
        up)&lt;br /&gt;
            echo &amp;quot;$LOG_PREFIX ethernet up&amp;quot;&lt;br /&gt;
            nmcli radio wifi off&lt;br /&gt;
            ;;&lt;br /&gt;
        down)&lt;br /&gt;
            echo &amp;quot;$LOG_PREFIX ethernet down&amp;quot;&lt;br /&gt;
            nmcli radio wifi on&lt;br /&gt;
            ;;&lt;br /&gt;
    esac&lt;br /&gt;
elif [ &amp;quot;$(nmcli -g GENERAL.STATE device show $ETHERNET_INTERFACE)&amp;quot; = &amp;quot;20 (unavailable)&amp;quot; ]; then&lt;br /&gt;
    echo &amp;quot;$LOG_PREFIX failsafe&amp;quot;&lt;br /&gt;
    nmcli radio wifi on&lt;br /&gt;
fi&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|There is a fail-safe for the case when the LAN interface was connected when the computer was last on, and then disconnected while the computer was off. That would mean the radio would still be off when the computer is turned back on, and with a disconnected LAN interface, you would have no network.}}&lt;br /&gt;
&lt;br /&gt;
==== Use dispatcher to connect to a VPN after a network connection is established ====&lt;br /&gt;
&lt;br /&gt;
In this example we want to connect automatically to a previously defined VPN connection after connecting to a specific Wi-Fi network. First thing to do is to create the dispatcher script that defines what to do after we are connected to the network.&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|A scripting without {{ic|iwgetid}} does work too and may be more reliable?|section=Fixes for automatic VPN dispatcher script}}&lt;br /&gt;
&lt;br /&gt;
{{Note|This script will require {{Pkg|wireless_tools}} in order to use {{ic|iwgetid}}.}}&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/vpn-up|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
VPN_NAME=&amp;quot;name of VPN connection defined in NetworkManager&amp;quot;&lt;br /&gt;
ESSID=&amp;quot;Wi-Fi network ESSID (not connection name)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
interface=$1 status=$2&lt;br /&gt;
case $status in&lt;br /&gt;
  up|vpn-down)&lt;br /&gt;
    if iwgetid | grep -qs &amp;quot;:\&amp;quot;$ESSID\&amp;quot;&amp;quot;; then&lt;br /&gt;
      nmcli connection up id &amp;quot;$VPN_NAME&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
    ;;&lt;br /&gt;
  down)&lt;br /&gt;
    if iwgetid | grep -qs &amp;quot;:\&amp;quot;$ESSID\&amp;quot;&amp;quot;; then&lt;br /&gt;
      if nmcli connection show --active | grep &amp;quot;$VPN_NAME&amp;quot;; then&lt;br /&gt;
        nmcli connection down id &amp;quot;$VPN_NAME&amp;quot;&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
    ;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
If you would like to attempt to automatically connect to VPN for all Wi-Fi networks, you can use the following definition of the ESSID: {{ic|1=ESSID=$(iwgetid -r)}}. Remember to set the script&#039;s permissions [[#Network services with NetworkManager dispatcher|accordingly]]. &lt;br /&gt;
&lt;br /&gt;
Trying to connect with the above script may still fail with {{ic|NetworkManager-dispatcher.service}} complaining about &#039;no valid VPN secrets&#039;, because of [https://developer.gnome.org/NetworkManager/0.9/secrets-flags.html the way VPN secrets are stored]. Fortunately, there are different options to give the above script access to your VPN password.&lt;br /&gt;
&lt;br /&gt;
1: One of them requires editing the VPN connection configuration file to make NetworkManager store the secrets by itself rather than inside a keyring [https://bugzilla.redhat.com/show_bug.cgi?id=710552 that will be inaccessible for root]: open up {{ic|/etc/NetworkManager/system-connections/&#039;&#039;name of your VPN connection&#039;&#039;.nmconnection}} and change the {{ic|password-flags}} and {{ic|secret-flags}} from {{ic|1}} to {{ic|0}}.&lt;br /&gt;
&lt;br /&gt;
If that alone does not work, you may have to create a {{ic|passwd-file}} in a safe location with the same permissions and ownership as the dispatcher script, containing the following:&lt;br /&gt;
&lt;br /&gt;
{{hc|/path/to/passwd-file|&lt;br /&gt;
vpn.secrets.password:YOUR_PASSWORD&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The script must be changed accordingly, so that it gets the password from the file:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/vpn-up|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
VPN_NAME=&amp;quot;name of VPN connection defined in NetworkManager&amp;quot;&lt;br /&gt;
ESSID=&amp;quot;Wi-Fi network ESSID (not connection name)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
interface=$1 status=$2&lt;br /&gt;
case $status in&lt;br /&gt;
  up|vpn-down)&lt;br /&gt;
    if iwgetid | grep -qs &amp;quot;:\&amp;quot;$ESSID\&amp;quot;&amp;quot;; then&lt;br /&gt;
      nmcli connection up id &amp;quot;$VPN_NAME&amp;quot; passwd-file /path/to/passwd-file&lt;br /&gt;
    fi&lt;br /&gt;
    ;;&lt;br /&gt;
  down)&lt;br /&gt;
    if iwgetid | grep -qs &amp;quot;:\&amp;quot;$ESSID\&amp;quot;&amp;quot;; then&lt;br /&gt;
      if nmcli connection show --active | grep &amp;quot;$VPN_NAME&amp;quot;; then&lt;br /&gt;
        nmcli connection down id &amp;quot;$VPN_NAME&amp;quot;&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
    ;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
2: Alternatively, change the {{ic|password-flags}} and put the password directly in the configuration file adding the section {{ic|vpn-secrets}}:&lt;br /&gt;
&lt;br /&gt;
  [vpn]&lt;br /&gt;
  ....&lt;br /&gt;
  password-flags=0&lt;br /&gt;
  &lt;br /&gt;
  [vpn-secrets]&lt;br /&gt;
  password=&#039;&#039;your_password&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{Note|It may now be necessary to re-open the NetworkManager connection editor and save the VPN passwords/secrets again.}}&lt;br /&gt;
&lt;br /&gt;
==== Use dispatcher to disable IPv6 on VPN provider connections ====&lt;br /&gt;
&lt;br /&gt;
Many [[:Category:VPN providers|commercial VPN providers]] support only IPv4. That means all IPv6 traffic bypasses the VPN and renders it virtually useless. To avoid this, dispatcher can be used to disable all IPv6 traffic for the time a VPN connection is up.&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/10-vpn-ipv6|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$2&amp;quot; in&lt;br /&gt;
	vpn-up)&lt;br /&gt;
		echo 1 &amp;gt; /proc/sys/net/ipv6/conf/all/disable_ipv6&lt;br /&gt;
		;;&lt;br /&gt;
	vpn-down)&lt;br /&gt;
		echo 0 &amp;gt; /proc/sys/net/ipv6/conf/all/disable_ipv6&lt;br /&gt;
		;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|The above script does not work for WireGuard since NetworkManager does not send the {{ic|vpn-up/down}} events for it. Instead you have to rely on generic events for your WireGuard interfaces as demonstrated in [https://gist.github.com/TheDcoder/85e1ec99a31180e20ba8e4896024f265].}}&lt;br /&gt;
&lt;br /&gt;
As an alternative, dispatcher can be used to temporarily set the IPv6 mode of the device used by the VPN connection to {{ic|link-local}}. This will avoid NetworkManager log spam about IPv6 being disabled. This script will not work if multiple devices or connections provide IPv6 connectivity, but could be adapted to iterate over multiple devices. Note that any change to the connection (using {{man|1|nmcli}} or a [[desktop environment]]) will reapply the entire connection to the device and re-enable IPv6 (if it is enabled in the connection).&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/10-vpn-ipv6|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$2&amp;quot; in&lt;br /&gt;
	vpn-up)&lt;br /&gt;
		nmcli device modify &amp;quot;${DEVICE_IFACE}&amp;quot; ipv6.method link-local&lt;br /&gt;
		;;&lt;br /&gt;
	vpn-down)&lt;br /&gt;
		nmcli device reapply &amp;quot;${DEVICE_IFACE}&amp;quot;&lt;br /&gt;
		;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
==== OpenNTPD ====&lt;br /&gt;
&lt;br /&gt;
See [[OpenNTPD#Using NetworkManager dispatcher]].&lt;br /&gt;
&lt;br /&gt;
==== Dynamically set NTP servers received via DHCP with systemd-timesyncd ====&lt;br /&gt;
&lt;br /&gt;
When roaming between different networks (e.g. a company&#039;s LAN, Wi-Fi at home, various other Wi-Fi now and then) you might want to set the NTP server(s) used by timesyncd to those provided by DHCP. However, NetworkManager itself is not capable to communicate with systemd-timesyncd to set the NTP server(s).&lt;br /&gt;
&lt;br /&gt;
The dispatcher can work around it. &lt;br /&gt;
&lt;br /&gt;
[[Create]] the overlay directory for your systemd-timesyncd configuration {{ic|/etc/systemd/timesyncd.conf.d}} if it does not already exist. Inside {{ic|/etc/NetworkManager/dispatcher.d}}, put the following: &lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/10-update-timesyncd|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
[ -z &amp;quot;$CONNECTION_UUID&amp;quot; ] &amp;amp;&amp;amp; exit 0&lt;br /&gt;
INTERFACE=&amp;quot;$1&amp;quot;&lt;br /&gt;
ACTION=&amp;quot;$2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
case $ACTION in&lt;br /&gt;
up | dhcp4-change | dhcp6-change)&lt;br /&gt;
	# `DHCP6_DHCP6_NTP_SERVERS` with double `DHCP6` is the correct variable name as varified by `printenv` as of NetworkManager 1.56.0-1&lt;br /&gt;
	set -- ${DHCP6_DHCP6_NTP_SERVERS-} ${DHCP4_NTP_SERVERS-}&lt;br /&gt;
	servers=$*&lt;br /&gt;
	[ -n &amp;quot;$servers&amp;quot; ] || exit 0&lt;br /&gt;
	mkdir -p /etc/systemd/timesyncd.conf.d&lt;br /&gt;
	cat &amp;lt;&amp;lt;-THE_END &amp;gt;&amp;quot;/etc/systemd/timesyncd.conf.d/${CONNECTION_UUID}.conf&amp;quot;&lt;br /&gt;
		[Time]&lt;br /&gt;
		NTP=$servers&lt;br /&gt;
	THE_END&lt;br /&gt;
	systemctl restart systemd-timesyncd.service&lt;br /&gt;
	;;&lt;br /&gt;
down)&lt;br /&gt;
	rm -f &amp;quot;/etc/systemd/timesyncd.conf.d/${CONNECTION_UUID}.conf&amp;quot;&lt;br /&gt;
	systemctl restart systemd-timesyncd.service&lt;br /&gt;
	;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Every time NetworkManager sets up a new network connection ({{ic|1=ACTION=up}}) or gets some update for an existing connection ({{ic|1=ACTION=dhcp4-change}} or {{ic|1=ACTION=dhcp6-change}}) and the provided connection data contains information about NTP server(s) ({{ic|DHCP6_DHCP6_NTP_SERVERS}} and {{ic|DHCP4_NTP_SERVERS}}), a connection specific overlay configuration file is written to {{ic|/etc/systemd/timesyncd.conf.d}}, containing the provided NTP server(s). Whenever a connection is taken down ({{ic|1=ACTION=down}}) the connection specific overlay file is removed. After each change to the configuration of systemd-timesyncd, this service is restarted to pick up the updated configuration. The use of connection specific configuration files is intentional so that when two or more connections are managed by NetworkManager in parallel the different NTP server names in the configuration are not overwritten as {{ic|up}}, {{ic|dhcp4-change}}, {{ic|dhcp6-change}} and {{ic|down}} actions might come in an arbitrary order.&lt;br /&gt;
&lt;br /&gt;
{{Note|{{ic|1=DHCP6_DHCP6_NTP_SERVERS}} with double {{ic|1=DHCP6}} is the correct variable name as varified by {{ic|1=printenv}} as of NetworkManager 1.56.0-1 }}&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
NetworkManager applets are designed to load upon login so no further configuration should be necessary for most users.  If you have already disabled your previous network settings and disconnected from your network, you can now test if NetworkManager will work. The first step is to [[start]] {{ic|NetworkManager.service}}.&lt;br /&gt;
&lt;br /&gt;
Some applets will provide you with a {{ic|.desktop}} file so that the NetworkManager applet can be loaded through the application menu.  If it does not, you are going to either have to discover the command to use or logout and login again to start the applet.  Once the applet is started, it will likely begin polling network connections with for auto-configuration with a DHCP server.&lt;br /&gt;
&lt;br /&gt;
To start the GNOME applet in non-xdg-compliant window managers like [[awesome]]:&lt;br /&gt;
&lt;br /&gt;
 nm-applet --sm-disable &amp;amp;&lt;br /&gt;
&lt;br /&gt;
For static IP addresses, you will have to configure NetworkManager to understand them.  The process usually involves right-clicking the applet and selecting something like &#039;Edit Connections&#039;.&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypted Wi-Fi passwords ===&lt;br /&gt;
&lt;br /&gt;
By default, NetworkManager stores passwords in clear text in the connection files at {{ic|/etc/NetworkManager/system-connections/}}. To print the stored passwords, use the following command:&lt;br /&gt;
&lt;br /&gt;
 # grep -r &#039;^psk=&#039; /etc/NetworkManager/system-connections/&lt;br /&gt;
&lt;br /&gt;
The passwords are accessible to the root user in the filesystem and to users with access to settings via the GUI (e.g. {{ic|nm-applet}}).&lt;br /&gt;
&lt;br /&gt;
It is preferable to save the passwords in encrypted form in a keyring instead of clear text. The downside to this is that the connections have to be set up for each user.&lt;br /&gt;
&lt;br /&gt;
In order to read and write to the keyring, there must be a secret agent available. This can be one of:&lt;br /&gt;
&lt;br /&gt;
* {{ic|nmcli}} with the {{ic|--ask}} option&lt;br /&gt;
* One of the graphical interfaces from [[#Front-ends]]&lt;br /&gt;
&lt;br /&gt;
If you make neither of these available, then authentication will fail with the error {{ic|no secrets: No agents were available for this request.}}&lt;br /&gt;
&lt;br /&gt;
==== Using GNOME Keyring ====&lt;br /&gt;
&lt;br /&gt;
The keyring daemon has to be started and the keyring needs to be unlocked for the following to work.&lt;br /&gt;
&lt;br /&gt;
Furthermore, NetworkManager needs to be configured not to store the password for all users. Using GNOME&#039;s {{Pkg|network-manager-applet}}, run {{ic|nm-connection-editor}} from a terminal, select a network connection, click &#039;&#039;Edit&#039;&#039;, select the &#039;&#039;Wi-Fi Security&#039;&#039; tab and click on the right icon of password and check &#039;&#039;Store the password only for this user&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Using KDE Wallet ====&lt;br /&gt;
&lt;br /&gt;
Using KDE&#039;s {{Pkg|plasma-nm}}, click the applet, click on the top right &#039;&#039;Settings&#039;&#039; icon, click on a network connection, in the &#039;&#039;General configuration&#039;&#039; tab, untick &#039;&#039;All users may connect to this network&#039;&#039;. If the option is ticked, the passwords will still be stored in clear text, even if a keyring daemon is running.&lt;br /&gt;
&lt;br /&gt;
If the option was selected previously and you un-tick it, you may have to use the {{ic|reset}} option first to make the password disappear from the file. Alternatively, delete the connection first and set it up again.&lt;br /&gt;
&lt;br /&gt;
=== Sharing internet connection over Wi-Fi ===&lt;br /&gt;
&lt;br /&gt;
You can share your internet connection (e.g. 3G or wired) with a few clicks.  Please note that a [[firewall]] may interfere with internet sharing.&lt;br /&gt;
&lt;br /&gt;
You will need a Wi-Fi card which supports AP mode, see [[Software access point#Wi-Fi device must support AP mode]] for details.&lt;br /&gt;
&lt;br /&gt;
[[Install]] the {{Pkg|dnsmasq}} package to be able to actually share the connection. Note that NetworkManager starts its own instance of &#039;&#039;dnsmasq&#039;&#039;, independent of {{ic|dnsmasq.service}}, as a DHCP server. See [[#dnsmasq]] for the caveats.&lt;br /&gt;
&lt;br /&gt;
Create the shared connection:&lt;br /&gt;
&lt;br /&gt;
* Click on applet and choose &#039;&#039;Create new wireless network&#039;&#039;.&lt;br /&gt;
* Follow wizard (choose WPA2 or higher, be sure to use at least 8 character long password, lower lengths will fail).&lt;br /&gt;
** Choose either [[Fedora:Features/RealHotspot|Hotspot]] or Ad-hoc as Wi-Fi mode.&lt;br /&gt;
&lt;br /&gt;
The connection will be saved and remain stored for the next time you need it.&lt;br /&gt;
&lt;br /&gt;
{{Note|Android does not support connecting to Ad-hoc networks. To share a connection with Android use infrastructure mode (i.e. set Wi-Fi mode to &amp;quot;Hotspot&amp;quot;).}}&lt;br /&gt;
&lt;br /&gt;
=== Sharing internet connection over Ethernet ===&lt;br /&gt;
&lt;br /&gt;
Scenario: your device has internet connection over Wi-Fi and you want to share the internet connection to other devices over Ethernet.&lt;br /&gt;
&lt;br /&gt;
Requirements:&lt;br /&gt;
&lt;br /&gt;
* [[Install]] the {{Pkg|dnsmasq}} and {{Pkg|nm-connection-editor}} packages to be able to actually share the connection. Note that NetworkManager starts its own instance of &#039;&#039;dnsmasq&#039;&#039;, independent of {{ic|dnsmasq.service}}, as a DHCP server. See [[#dnsmasq]] for the caveats.&lt;br /&gt;
* Your internet connected device and the other devices are connected over a suitable Ethernet cable (this usually means a cross over cable or a switch in between).&lt;br /&gt;
* Internet sharing is not blocked by a [[firewall]].&lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
&lt;br /&gt;
* Run {{ic|nm-connection-editor}} from terminal.&lt;br /&gt;
* Add a new Ethernet connection.&lt;br /&gt;
* Give it some sensible name. For example &amp;quot;Shared Internet&amp;quot;&lt;br /&gt;
* Go to &amp;quot;IPv4 Settings&amp;quot;.&lt;br /&gt;
* For &amp;quot;Method:&amp;quot; select &amp;quot;Shared to other computers&amp;quot;.&lt;br /&gt;
* Save&lt;br /&gt;
&lt;br /&gt;
Now you should have a new option &amp;quot;Shared Internet&amp;quot; under the Wired connections in NetworkManager.&lt;br /&gt;
&lt;br /&gt;
=== Checking if networking is up inside a cron job or script ===&lt;br /&gt;
&lt;br /&gt;
{{Out of date|&#039;&#039;nm-tool&#039;&#039; was removed from NetworkManager for long time now[https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commit/bb8c75bd536d4f8fb80a4366025a279078f0ec81]. &#039;&#039;nmcli&#039;&#039; should be used instead.}}&lt;br /&gt;
&lt;br /&gt;
Some &#039;&#039;cron&#039;&#039; jobs require networking to be up to succeed. You may wish to avoid running these jobs when the network is down. To accomplish this, add an &#039;&#039;&#039;if&#039;&#039;&#039; test for networking that queries NetworkManager&#039;s &#039;&#039;nm-tool&#039;&#039; and checks the state of networking. The test shown here succeeds if any interface is up, and fails if they are all down. This is convenient for laptops that might be hardwired, might be on wireless, or might be off the network.&lt;br /&gt;
&lt;br /&gt;
{{bc|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
if [ $(nm-tool|grep State|cut -f2 -d&#039; &#039;) == &amp;quot;connected&amp;quot; ]; then&lt;br /&gt;
    #Whatever you want to do if the network is online&lt;br /&gt;
else&lt;br /&gt;
    #Whatever you want to do if the network is offline - note, this and the else above are optional&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
This is useful for a {{ic|cron.hourly}} script that runs &#039;&#039;fpupdate&#039;&#039; for the F-Prot virus scanner signature update, as an example. Another way it might be useful, with a little modification, is to differentiate between networks using various parts of the output from &#039;&#039;nm-tool&#039;&#039;; for example, since the active wireless network is denoted with an asterisk, you could grep for the network name and then grep for a literal asterisk.&lt;br /&gt;
&lt;br /&gt;
=== Connect to network with secret on boot ===&lt;br /&gt;
&lt;br /&gt;
By default, NetworkManager will not connect to networks requiring a secret automatically on boot. This is because it locks such connections to the user who makes it by default, only connecting after they have logged in. To change this, do the following:&lt;br /&gt;
&lt;br /&gt;
# Right click on the {{ic|nm-applet}} icon in your panel and select Edit Connections and open the Wireless tab&lt;br /&gt;
# Select the connection you want to work with and click the Edit button&lt;br /&gt;
# Check the boxes “Connect Automatically” and “Available to all users”&lt;br /&gt;
# Additionally, ensure that under &amp;quot;Wi-Fi Security&amp;quot;, &amp;quot;Store password for all users (not encrypted)&amp;quot; is selected&lt;br /&gt;
&lt;br /&gt;
Log out and log back in to complete.&lt;br /&gt;
&lt;br /&gt;
=== OpenConnect with password in KWallet ===&lt;br /&gt;
&lt;br /&gt;
While you may type both values at connection time, {{Pkg|plasma-nm}} 0.9.3.2-1 and above are capable of retrieving OpenConnect username and password directly from [[KWallet]].&lt;br /&gt;
&lt;br /&gt;
Open &amp;quot;KDE Wallet Manager&amp;quot; and look up your OpenConnect VPN connection under &amp;quot;Network Management|Maps&amp;quot;. Click &amp;quot;Show values&amp;quot; and &lt;br /&gt;
enter your credentials in key &amp;quot;VpnSecrets&amp;quot; in this form (replace &#039;&#039;username&#039;&#039; and &#039;&#039;password&#039;&#039; accordingly):&lt;br /&gt;
&lt;br /&gt;
 form:main:username%SEP%&#039;&#039;username&#039;&#039;%SEP%form:main:password%SEP%&#039;&#039;password&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Next time you connect, username and password should appear in the &amp;quot;VPN secrets&amp;quot; dialog box.&lt;br /&gt;
&lt;br /&gt;
=== Ignore specific devices ===&lt;br /&gt;
&lt;br /&gt;
Sometimes it may be desired that NetworkManager ignores specific devices and does not try to configure addresses and routes for them. You can quickly and easily ignore devices by MAC or interface-name by using the following in {{ic|/etc/NetworkManager/conf.d/unmanaged.conf}}:&lt;br /&gt;
&lt;br /&gt;
 [keyfile]&lt;br /&gt;
 unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth0&lt;br /&gt;
&lt;br /&gt;
After editing the file, run {{ic|nmcli general reload}} as root. Afterwards you should be able to configure interfaces without NetworkManager altering what you have set.&lt;br /&gt;
&lt;br /&gt;
=== Configuring MAC address randomization ===&lt;br /&gt;
&lt;br /&gt;
{{Merge|NetworkManager/Privacy#MAC Randomization|There is a dedicated sub-page for Privacy now.}}&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|The [[iwd]] backend reportedly refuses MAC address randomisation due to open issues, and entry in [[iwd#Troubleshooting]] or link to [[MAC address spoofing#iwd]] might be suitable to account for it; see:|section=iwd backend doesn&#039;t support mac spoofing}}&lt;br /&gt;
&lt;br /&gt;
{{Note|1=Disabling MAC address randomization may be needed to get (stable) link connection [https://bbs.archlinux.org/viewtopic.php?id=220101] and/or networks that restrict devices based on their MAC Address or have a limit network capacity.}}&lt;br /&gt;
&lt;br /&gt;
{{Note| See [[#Using iwd as the Wi-Fi backend]] for iwd specific MAC randomization.}}&lt;br /&gt;
&lt;br /&gt;
MAC randomization can be used for increased privacy by not disclosing your real MAC address to the network.&lt;br /&gt;
&lt;br /&gt;
NetworkManager supports two types MAC Address Randomization: randomization during scanning, and for network connections. Both modes can be configured by modifying {{ic|/etc/NetworkManager/NetworkManager.conf}} or by creating a separate configuration file in {{ic|/etc/NetworkManager/conf.d/}} which is recommended since the aforementioned configuration file may be overwritten by NetworkManager.&lt;br /&gt;
&lt;br /&gt;
Randomization during Wi-Fi scanning is enabled by default, but it may be disabled by adding the following lines to {{ic|/etc/NetworkManager/NetworkManager.conf}} or a dedicated configuration file under {{ic|/etc/NetworkManager/conf.d}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/wifi_rand_mac.conf|2=&lt;br /&gt;
[device]&lt;br /&gt;
wifi.scan-rand-mac-address=no&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
MAC randomization for network connections can be set to different modes for both wireless and ethernet interfaces. See the [https://blogs.gnome.org/thaller/2016/08/26/mac-address-spoofing-in-networkmanager-1-4-0/ GNOME blog post] for more details on the different modes. &lt;br /&gt;
&lt;br /&gt;
In terms of MAC randomization the most important modes are {{ic|stable}} and {{ic|random}}. {{ic|stable}} generates a random MAC address when you connect to a new network and associates the two permanently. This means that you will use the same MAC address every time you connect to that network. In contrast, {{ic|random}} will generate a new MAC address every time you connect to a network, new or previously known. You can configure the MAC randomization by adding the desired configuration under {{ic|/etc/NetworkManager/conf.d}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/wifi_rand_mac.conf|2=&lt;br /&gt;
[device-mac-randomization]&lt;br /&gt;
# &amp;quot;yes&amp;quot; is already the default for scanning&lt;br /&gt;
wifi.scan-rand-mac-address=yes&lt;br /&gt;
 &lt;br /&gt;
[connection-mac-randomization]&lt;br /&gt;
# Randomize MAC for every ethernet connection&lt;br /&gt;
ethernet.cloned-mac-address=random&lt;br /&gt;
# Generate a random MAC for each Wi-Fi and associate the two permanently.&lt;br /&gt;
wifi.cloned-mac-address=stable&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To configure MAC randomization for a specific connection (for example, if the network does not like random MAC addresses), [[#Edit a connection|edit the connection]] to set {{ic|802-11-wireless.cloned-mac-address}} to one of the modes (e.g. {{ic|stable}} or {{ic|random}}).&lt;br /&gt;
&lt;br /&gt;
See the following [https://blogs.gnome.org/thaller/2016/08/26/mac-address-spoofing-in-networkmanager-1-4-0/ GNOME blog post] for more details.&lt;br /&gt;
&lt;br /&gt;
=== Turn off hostname sending ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager by default sends the hostname to the DHCP server.&lt;br /&gt;
&lt;br /&gt;
To disable sending your hostname to the DHCP server globally, set the {{ic|ipv4.dhcp-send-hostname{{=}}0}} and {{ic|ipv6.dhcp-send-hostname{{=}}0}} options with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}. E.g.:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/dhcp-send-hostname.conf|2=&lt;br /&gt;
[connection]&lt;br /&gt;
ipv4.dhcp-send-hostname=0&lt;br /&gt;
ipv6.dhcp-send-hostname=0&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To disable sending your hostname to the DHCP server for a specific connection (or alternatively, enable it for a connection if it is disabled globally), add the following to your network connection file:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/system-connections/&#039;&#039;your_connection_file&#039;&#039;.nmconnection|2=&lt;br /&gt;
...&lt;br /&gt;
[ipv4]&lt;br /&gt;
dhcp-send-hostname=false&lt;br /&gt;
...&lt;br /&gt;
[ipv6]&lt;br /&gt;
dhcp-send-hostname=false&lt;br /&gt;
...&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|These options are only honored by the default [[#DHCP client|internal DHCP client]]. To omit sending the hostname when using NetworkManager with dhcpcd, edit {{ic|/etc/dhcpcd.conf}} and insert {{ic|anonymous}} as the last line.}}&lt;br /&gt;
&lt;br /&gt;
=== Enable IPv6 Privacy Extensions ===&lt;br /&gt;
&lt;br /&gt;
See [[IPv6#NetworkManager]].&lt;br /&gt;
&lt;br /&gt;
=== Configure a unique DUID per connection ===&lt;br /&gt;
&lt;br /&gt;
The DHCPv6 Unique Identifier (DUID) is a value used by the DHCPv6 client to identify itself to DHCPv6 servers. NetworkManager supports 3 types of DUID:&lt;br /&gt;
&lt;br /&gt;
* DUID-UUID ([[RFC:6355|RFC 6355]]): generated from an Universally Unique IDentifier (UUID).&lt;br /&gt;
* DUID-LL ([[RFC:3315|RFC 3315]]): generated from the Link-Layer address (a.k.a. MAC address).&lt;br /&gt;
* DUID-LLT ([[RFC:3315|RFC 3315]]): generated from the Link-Layer address plus a timestamp.&lt;br /&gt;
&lt;br /&gt;
If the internal NetworkManager&#039;s DHCP client is in use (the default) it will identify itself with a global and permanent DUID-UUID generated from the machine-id ({{ic|/etc/machine-id}}). This means that all connections share the same UUID, which may be a privacy breach.&lt;br /&gt;
&lt;br /&gt;
Fortunately, NetworkManager is able to provide unique DUIDs per connection, derived from the connection&#039;s stable-id and a per-host unique key. You can enable that by adding the following configuration under {{ic|/etc/NetworkManager/conf.d}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/duid.conf|2=&lt;br /&gt;
[connection]&lt;br /&gt;
ipv6.dhcp-duid=stable-uuid&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The {{ic|stable-ll}} and {{ic|stable-llt}} values are also supported. For further information read the description for {{ic|dhcp-duid}} in {{man|5|nm-settings|ipv6 setting}}.&lt;br /&gt;
&lt;br /&gt;
=== Working with wired connections ===&lt;br /&gt;
&lt;br /&gt;
By default, NetworkManager generates a connection profile for each wired ethernet connection it finds. At the point when generating the connection, it does not know whether there will be more Ethernet adapters available. Hence, it calls the first wired connection &amp;quot;Wired connection 1&amp;quot;. You can avoid generating this connection, by configuring {{ic|no-auto-default}} (see {{man|5|NetworkManager.conf}}), or by simply deleting it. Then NetworkManager will remember not to generate a connection for this interface again.&lt;br /&gt;
&lt;br /&gt;
You can also edit the connection (and persist it to disk) or delete it. NetworkManager will not re-generate a new connection. Then you can change the name to whatever you want. You can use something like {{Pkg|nm-connection-editor}} for this task.&lt;br /&gt;
&lt;br /&gt;
=== Using iwd as the Wi-Fi backend ===&lt;br /&gt;
&lt;br /&gt;
{{Note|1=&amp;lt;nowiki/&amp;gt;&lt;br /&gt;
* Do not enable {{ic|iwd.service}} or manually configure [[iwd]]. NetworkManager will start and manage it itself.&lt;br /&gt;
* Consider [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues?scope=all&amp;amp;utf8=%E2%9C%93&amp;amp;state=opened&amp;amp;search=iwd existing issues] before switching to &#039;&#039;iwd&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
To enable the [https://archive.kernel.org/oldwiki/iwd.wiki.kernel.org/networkmanager.html experimental iwd backend], first [[install]] {{Pkg|iwd}} and then create the following configuration file:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/wifi_backend.conf|2=&lt;br /&gt;
[device]&lt;br /&gt;
wifi.backend=iwd&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To use MAC randomization with iwd see [[MAC address spoofing#iwd]].&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can install {{AUR|networkmanager-iwd}}, a modified package configured to build &#039;&#039;NetworkManager&#039;&#039; working exclusively with &#039;&#039;iwd&#039;&#039;, with the main difference being that &#039;&#039;iwd&#039;&#039; is required and &#039;&#039;wpa_supplicant&#039;&#039; can be uninstalled after building.&lt;br /&gt;
&lt;br /&gt;
{{Note|1=You may need to [https://archive.kernel.org/oldwiki/iwd.wiki.kernel.org/networkmanager.html#converting_network_profiles convert existing NetworkManager network profiles] after switching to &#039;&#039;iwd&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Running in a network namespace ===&lt;br /&gt;
&lt;br /&gt;
If you would like to run NetworkManager inside a network namespace (e.g., to manage a specific device which should be used by selected applications), bring the device down before moving it to the namespace:&lt;br /&gt;
&lt;br /&gt;
 $ ip link set dev &#039;&#039;MY_DEVICE&#039;&#039; down&lt;br /&gt;
 $ ip link set dev &#039;&#039;MY_DEVICE&#039;&#039; netns &#039;&#039;MY_NAMESPACE&#039;&#039;&lt;br /&gt;
 $ ip netns exec &#039;&#039;MY_NAMESPACE&#039;&#039; NetworkManager&lt;br /&gt;
 ...&lt;br /&gt;
 $ ip netns exec &#039;&#039;MY_NAMESPACE&#039;&#039; killall NetworkManager&lt;br /&gt;
&lt;br /&gt;
otherwise NetworkManager will later fail to establish the connection with a {{ic|device is strictly unmanaged}} error.&lt;br /&gt;
&lt;br /&gt;
=== Automatically connect to VPN ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager can be set to automatically connect to a VPN when connecting to the internet, on a per network basis. The VPN connection itself can be added in GNOME&#039;s NetworkManager front-end, but to make it automatically use the VPN {{ic|nmcli}} must be used. Other front-ends might not have this limitation.&lt;br /&gt;
&lt;br /&gt;
First, make sure to make the VPN connection available to all users. In the GNOME this is a matter of checking a box under the {{ic|details}} tab. Under the {{ic|Identity}} tab, in the password field, click the icon on the right side in the field, and set it to {{ic|Store the password for all users}}.&lt;br /&gt;
&lt;br /&gt;
Then find the UUID of the VPN connection, and add that to {{ic|connection.secondaries}} of the Internet connection:&lt;br /&gt;
&lt;br /&gt;
 # UUID=$(nmcli --get-values connection.uuid connection show &#039;&#039;name-of-VPN-connection&#039;&#039;)&lt;br /&gt;
 # nmcli connection modify &#039;&#039;name-of-Internet-connection&#039;&#039; connection.secondaries &amp;quot;$UUID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now when NetworkManager is restarted and you connect to the Internet connection you have configured, you should automatically get connected to the VPN.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== No prompt for password of secured Wi-Fi networks ===&lt;br /&gt;
&lt;br /&gt;
When trying to connect to a secured Wi-Fi network, no prompt for a password is shown and no connection is established. This happens when no keyring package is installed. An easy solution is to install {{Pkg|gnome-keyring}}. If you want the passwords to be stored in encrypted form, follow [[GNOME Keyring]] to set up the &#039;&#039;gnome-keyring-daemon&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Network management disabled ===&lt;br /&gt;
&lt;br /&gt;
When NetworkManager shuts down but the pid (state) file is not removed, you will see a {{ic|Network management disabled}} message. If this happens, remove the file manually:&lt;br /&gt;
&lt;br /&gt;
 # rm /var/lib/NetworkManager/NetworkManager.state&lt;br /&gt;
&lt;br /&gt;
=== Problems with internal DHCP client ===&lt;br /&gt;
&lt;br /&gt;
If you have problems with getting an IP address using the internal DHCP client, consider using another DHCP client, see [[#DHCP client]] for instructions. This workaround might solve problems in big wireless networks like eduroam.&lt;br /&gt;
&lt;br /&gt;
=== DHCP problems with dhclient ===&lt;br /&gt;
&lt;br /&gt;
If you have problems with getting an IP address via DHCP, try to add the following to your {{ic|/etc/dhclient.conf}}:&lt;br /&gt;
&lt;br /&gt;
  interface &amp;quot;eth0&amp;quot; {&lt;br /&gt;
    send dhcp-client-identifier 01:&#039;&#039;aa:bb:cc:dd:ee:ff&#039;&#039;;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Where {{ic|&#039;&#039;aa:bb:cc:dd:ee:ff&#039;&#039;}} is the MAC address of this NIC. The MAC address can be found using the {{ic|ip link show &#039;&#039;interface&#039;&#039;}} command from the {{Pkg|iproute2}} package.&lt;br /&gt;
&lt;br /&gt;
=== 3G modem not detected ===&lt;br /&gt;
&lt;br /&gt;
See [[Mobile broadband modem#NetworkManager]].&lt;br /&gt;
&lt;br /&gt;
=== Switching off WLAN on laptops ===&lt;br /&gt;
&lt;br /&gt;
Sometimes NetworkManager will not work when you disable your Wi-Fi adapter with a switch on your laptop and try to enable it again afterwards. This is often a problem with &#039;&#039;rfkill&#039;&#039;. To check if the driver notifies &#039;&#039;rfkill&#039;&#039; about the wireless adapter&#039;s status, use:&lt;br /&gt;
&lt;br /&gt;
 $ watch -n1 rfkill list all&lt;br /&gt;
&lt;br /&gt;
If one identifier stays blocked after you switch on the adapter you could try to manually unblock it with (where X is the number of the identifier provided by the above output):&lt;br /&gt;
&lt;br /&gt;
 # rfkill event unblock X&lt;br /&gt;
&lt;br /&gt;
=== Static IP address settings revert to DHCP ===&lt;br /&gt;
&lt;br /&gt;
{{Out of date|This section is [[Special:Diff/119236|added in 2010]] and describes an ancient version of &#039;&#039;nm-applet&#039;&#039;. Is this still relevant in 2024?}}&lt;br /&gt;
&lt;br /&gt;
Due to an unresolved bug, when changing default connections to a static IP address, {{ic|nm-applet}} may not properly store the configuration change, and will revert to automatic DHCP.&lt;br /&gt;
&lt;br /&gt;
To work around this issue you have to edit the default connection (e.g. &amp;quot;Auto eth0&amp;quot;) in {{ic|nm-applet}}, change the connection name (e.g. &amp;quot;my eth0&amp;quot;), uncheck the &amp;quot;Available to all users&amp;quot; checkbox, change your static IP address settings as desired, and click &#039;&#039;&#039;Apply&#039;&#039;&#039;.  This will save a new connection with the given name.&lt;br /&gt;
&lt;br /&gt;
Next, you will want to make the default connection not connect automatically.  To do so, run {{ic|nm-connection-editor}} (&#039;&#039;&#039;not&#039;&#039;&#039; as root). In the connection editor, edit the default connection (e.g. &amp;quot;Auto eth0&amp;quot;) and uncheck &amp;quot;Connect automatically&amp;quot;.  Click &#039;&#039;&#039;Apply&#039;&#039;&#039; and close the connection editor.&lt;br /&gt;
&lt;br /&gt;
=== Cannot edit connections as normal user ===&lt;br /&gt;
&lt;br /&gt;
See [[#Set up PolicyKit permissions]].&lt;br /&gt;
&lt;br /&gt;
=== Forget hidden wireless network ===&lt;br /&gt;
&lt;br /&gt;
Since hidden networks are not displayed in the selection list of the Wireless view, they cannot be forgotten (removed) with the GUI. You can delete one with the following command:&lt;br /&gt;
&lt;br /&gt;
 # rm /etc/NetworkManager/system-connections/&#039;&#039;SSID&#039;&#039;.nmconnection&lt;br /&gt;
&lt;br /&gt;
This also works for any other connection.&lt;br /&gt;
&lt;br /&gt;
=== VPN not working in GNOME ===&lt;br /&gt;
&lt;br /&gt;
When setting up OpenConnect or vpnc connections in NetworkManager while using GNOME, you will sometimes never see the dialog box pop up and the following error appears in {{ic|/var/log/errors.log}}:&lt;br /&gt;
&lt;br /&gt;
 localhost NetworkManager[399]: &amp;lt;error&amp;gt; [1361719690.10506] [nm-vpn-connection.c:1405] get_secrets_cb(): Failed to request VPN secrets #3: (6) No agents were available for this request.&lt;br /&gt;
&lt;br /&gt;
This is caused by the GNOME NetworkManager Applet expecting dialog scripts to be at {{ic|/usr/lib/gnome-shell}}, when NetworkManager&#039;s packages put them in {{ic|/usr/lib/networkmanager}}.&lt;br /&gt;
As a &amp;quot;temporary&amp;quot; fix (this bug has been around for a while now), make the following symlink(s):&lt;br /&gt;
&lt;br /&gt;
* For OpenConnect: {{ic|ln -s /usr/lib/nm-openconnect-auth-dialog /usr/lib/gnome-shell/}}&lt;br /&gt;
* For VPNC (i.e. Cisco VPN): {{ic|ln -s /usr/lib/nm-vpnc-auth-dialog /usr/lib/gnome-shell/}}&lt;br /&gt;
&lt;br /&gt;
This may need to be done for any other NetworkManager VPN plugins as well, but these are the two most common.&lt;br /&gt;
&lt;br /&gt;
=== Unable to connect to visible European wireless networks ===&lt;br /&gt;
&lt;br /&gt;
WLAN chips are shipped with a default [[Wireless network configuration#Respecting the regulatory domain|regulatory domain]]. If your access point does not operate within these limitations, you will not be able to connect to the network. Fixing this is easy:&lt;br /&gt;
&lt;br /&gt;
# [[Install]] {{Pkg|wireless-regdb}}.&lt;br /&gt;
# Uncomment the correct country code in {{ic|/etc/conf.d/wireless-regdom}}.&lt;br /&gt;
# Reboot the system, because the setting is only read on boot.&lt;br /&gt;
&lt;br /&gt;
=== Automatic connect to VPN on boot is not working ===&lt;br /&gt;
&lt;br /&gt;
The problem occurs when the system (i.e. NetworkManager running as the root user) tries to establish a VPN connection, but the password is not accessible because it is stored in the GNOME Keyring of a particular user. &lt;br /&gt;
&lt;br /&gt;
A solution is to keep the password to your VPN in plaintext, as described in step (2.) of [[#Use dispatcher to connect to a VPN after a network connection is established]]. &lt;br /&gt;
&lt;br /&gt;
You do not need to use the dispatcher described in step (1.) to auto-connect anymore, if you use the new &amp;quot;auto-connect VPN&amp;quot; option from the {{ic|nm-applet}} GUI.&lt;br /&gt;
&lt;br /&gt;
=== systemd bottleneck ===&lt;br /&gt;
&lt;br /&gt;
Over time the log files ({{ic|/var/log/journal}}) can become very large. This can have a big impact on boot performance when using NetworkManager, see: [[systemd#Boot time increasing over time]].&lt;br /&gt;
&lt;br /&gt;
=== Regular network disconnects, latency and lost packets (Wi-Fi) ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager does a scan every 2 minutes.&lt;br /&gt;
&lt;br /&gt;
Some Wi-Fi drivers have issues when scanning for base stations whilst connected/associated. Symptoms include VPN disconnects/reconnects and lost packets, web pages failing to load and then refresh fine.&lt;br /&gt;
&lt;br /&gt;
Running {{ic|journalctl -f}} as root will indicate that this is taking place, messages like the following will be contained in the logs at regular intervals.&lt;br /&gt;
&lt;br /&gt;
 NetworkManager[410]: &amp;lt;info&amp;gt;  (wlp3s0): roamed from BSSID 00:14:48:11:20:CF (my-wifi-name) to (none) ((none))&lt;br /&gt;
&lt;br /&gt;
If roaming is not important, the periodic scanning behavior can be disabled by locking the BSSID of the access point in the Wi-Fi connection profile.&lt;br /&gt;
&lt;br /&gt;
=== Unable to turn on Wi-Fi with Lenovo laptop (IdeaPad, Legion, etc.) ===&lt;br /&gt;
&lt;br /&gt;
There is an issue with the {{ic|ideapad_laptop}} module on some Lenovo models due to the Wi-Fi driver incorrectly reporting a soft block. The card can still be manipulated with {{ic|netctl}}, but managers like NetworkManager break. You can verify that this is the problem by checking the output of {{ic|rfkill list}} after toggling your hardware switch and seeing that the soft block persists.&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|Try to use {{ic|rfkill.default_state}} and {{ic|rfkill.master_switch_mode}} (see [https://docs.kernel.org/admin-guide/kernel-parameters.html kernel-parameters.html]) to fix the rfkill problem.}}&lt;br /&gt;
&lt;br /&gt;
[[modprobe|Unloading]] the {{ic|ideapad_laptop}} module should fix this. (&#039;&#039;&#039;warning&#039;&#039;&#039;: this may disable the laptop keyboard and touchpad also!).&lt;br /&gt;
&lt;br /&gt;
=== nm-applet disappears in i3wm ===&lt;br /&gt;
&lt;br /&gt;
If you use the {{ic|xfce4-notifyd.service}} for notifications you must [[edit]] the unit and add the following:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/systemd/user/xfce4-notifyd.service.d/display_env.conf|2=&lt;br /&gt;
[Service]&lt;br /&gt;
Environment=&amp;quot;DISPLAY=:0.0&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
After reloading the daemons [[restart]] {{ic|xfce4-notifyd.service}}. Exit i3 and start it back up again and the applet should show on the tray.&lt;br /&gt;
&lt;br /&gt;
=== Unit dbus-org.freedesktop.resolve1.service not found ===&lt;br /&gt;
&lt;br /&gt;
If {{ic|systemd-resolved.service}} is not started, NetworkManager will try to start it using D-Bus and fail:&lt;br /&gt;
&lt;br /&gt;
 dbus-daemon[991]: [system] Activating via systemd: service name=&#039;org.freedesktop.resolve1&#039; unit=&#039;dbus-org.freedesktop.resolve1.service&#039; requested by &#039;:1.23&#039; (uid=0 pid=1012 comm=&amp;quot;/usr/bin/NetworkManager --no-daemon &amp;quot;)&lt;br /&gt;
 dbus-daemon[991]: [system] Activation via systemd failed for unit &#039;dbus-org.freedesktop.resolve1.service&#039;: Unit dbus-org.freedesktop.resolve1.service not found.&lt;br /&gt;
 dbus-daemon[991]: [system] Activating via systemd: service name=&#039;org.freedesktop.resolve1&#039; unit=&#039;dbus-org.freedesktop.resolve1.service&#039; requested by &#039;:1.23&#039; (uid=0 pid=1012 comm=&amp;quot;/usr/bin/NetworkManager --no-daemon &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
This is because NetworkManager will try to send DNS information to [[systemd-resolved]] regardless of the {{ic|1=main.dns=}} setting in {{man|5|NetworkManager.conf}}.[https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commit/d4eb4cb45f41b1751cacf71da558bf8f0988f383]&lt;br /&gt;
&lt;br /&gt;
This can be disabled with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/no-systemd-resolved.conf|2=&lt;br /&gt;
[main]&lt;br /&gt;
systemd-resolved=false&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
See {{Bug|62138}}.&lt;br /&gt;
&lt;br /&gt;
=== Secrets were required, but not provided ===&lt;br /&gt;
&lt;br /&gt;
If you received the following error when attempting to connect to a network: &lt;br /&gt;
&lt;br /&gt;
{{hc|$ nmcli device wifi connect &#039;&#039;SSID&#039;&#039; password &#039;&#039;password&#039;&#039;|&lt;br /&gt;
Error: Connection activation failed: (7) Secrets were required, but not provided&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This error can have numerous causes and you should read the [[journal]] (filter it with {{ic|-u NetworkManager}}). For example, if NetworkManager took too long to establish connection, it will believe that the password is incorrect:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
NetworkManager[1372]: &amp;lt;warn&amp;gt;  [1643991888.3808] device (wlan0): Activation: (wifi) association took too long&lt;br /&gt;
NetworkManager[1372]: &amp;lt;info&amp;gt;  [1643991888.3809] device (wlan0): state change: config -&amp;gt; need-auth (reason &#039;none&#039;, sys-iface-state: &#039;managed&#039;)&lt;br /&gt;
NetworkManager[1372]: &amp;lt;warn&amp;gt;  [1643991888.3838] device (wlan0): Activation: (wifi) asking for new secrets&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can try deleting the connection profile and creating a new one:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection delete &#039;&#039;SSID&#039;&#039;&lt;br /&gt;
 $ nmcli device wifi connect &#039;&#039;SSID&#039;&#039; password &#039;&#039;password&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can also try disabling MAC address randomization:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/wifi_rand_mac.conf|2=&lt;br /&gt;
[device]&lt;br /&gt;
wifi.scan-rand-mac-address=no&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== WPA Enterprise connection with iwd ===&lt;br /&gt;
&lt;br /&gt;
If you try to connect to an WPA Enterprise network like &#039;eduroam&#039; with NetworkManager with the [[#Using iwd as the Wi-Fi backend|iwd backend]] then you will get the following error from NetworkManager:&lt;br /&gt;
&lt;br /&gt;
  Connection &#039;eduroam&#039; is not avialable on device wlan0 because profile is not compatible with device (802.1x connections must have IWD provisioning files)&lt;br /&gt;
&lt;br /&gt;
This is because NetworkManager can not configure a WPA Enterprise network. Therefore you have to configure it using an iwd configuration file {{ic|/var/lib/iwd/&#039;&#039;essid&#039;&#039;.8021x}} like described in [[iwd#WPA Enterprise]].&lt;br /&gt;
&lt;br /&gt;
=== Failed to request VPN secrets ===&lt;br /&gt;
&lt;br /&gt;
If you get this error:&lt;br /&gt;
 Failed to request VPN secrets #1: No agents were available for this request.&lt;br /&gt;
&lt;br /&gt;
It is either because the password is empty or you have to [[#Set up PolicyKit permissions|set up PolicyKit permissions]].&lt;br /&gt;
&lt;br /&gt;
=== OpenVPN connections fail with &amp;quot;secrets: failed to request VPN secrets&amp;quot; warn ===&lt;br /&gt;
&lt;br /&gt;
{{Remove|This does not warrant a troubleshooting section. Optional dependencies are pointed out by pacman, if this is not clear enough it should be covered in [[#VPN support]].|section=Remove unnecessary section 8.22}}&lt;br /&gt;
&lt;br /&gt;
The package {{Pkg|networkmanager-openvpn}} requires {{Pkg|libnma-gtk4}} and optionally {{Pkg|libnma}} (Gtk3) when integrated within the GNOME-Shell. If {{Pkg|libnma}} is required but not installed a message will be  printed to the system log:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
NetworkManager[642]: &amp;lt;warn&amp;gt;  [...] vpn[...&amp;quot;name_of_vpn_profile VPN&amp;quot;]: secrets: failed to request VPN secrets #3: No agents were available for this request.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== OpenVPN connections fail with OpenSSL &amp;quot;ca md too weak&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
Since {{Pkg|openssl}} was updated to version 3, certificates generated with legacy cryptographic algorithms are rejected by default. Attempting to use {{Pkg|networkmanager-openvpn}} with such a setup can result in the following error in the logs:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
nm-openvpn[14359]: OpenSSL: error:0A00018E:SSL routines::ca md too weak&lt;br /&gt;
nm-openvpn[14359]: Cannot load certificate file /home/archie/.local/share/networkmanagement/certificates/my_issued_cert.crt&lt;br /&gt;
nm-openvpn[14359]: Exiting due to fatal error&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The correct approach is to have the OpenVPN server administrator generate and re-issue more secure certificates. However, as an immediate work-around, OpenVPN requires {{ic|1=tls-cipher &amp;quot;DEFAULT:@SECLEVEL=0&amp;quot;}}. This may not be possible through the plugin GUI, but it is possible with &#039;&#039;nmcli&#039;&#039;. Separately, you will also need to enable the &#039;&#039;legacy&#039;&#039; provider in OpenSSL.&lt;br /&gt;
&lt;br /&gt;
Firstly, obtain the name of the VPN connection with the issue, from the output of the following:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection show&lt;br /&gt;
&lt;br /&gt;
Assuming the connection name is &#039;&#039;vpn.example.com&#039;&#039;, use &#039;&#039;nmcli&#039;&#039; like so:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection modify vpn.example.com +vpn.data tls-cipher=DEFAULT:@SECLEVEL=0&lt;br /&gt;
&lt;br /&gt;
The change should instantly be reflected in {{ic|/etc/NetworkManager/system-connections/vpn.example.com.nmconnection}}.&lt;br /&gt;
&lt;br /&gt;
As for OpenSSL, edit {{ic|/etc/ssl/openssl.cnf}} as described on the [https://wiki.openssl.org/index.php/OpenSSL_3.0#Providers OpenSSL wiki].&lt;br /&gt;
&lt;br /&gt;
Specifically, at the end of the {{ic|[provider_sect]}} section add {{ic|1=legacy = legacy_sect}}. Under {{ic|[default_sect]}} uncomment {{ic|1=activate = 1}}. Lastly, add a new section {{ic|[legacy_sect]}} that also contains the line {{ic|1=activate = 1}}. Excluding most other preexisting configuration sections, the end result will look something like:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/ssl/openssl.cnf|2=&lt;br /&gt;
openssl_conf = openssl_init&lt;br /&gt;
&lt;br /&gt;
[openssl_init]&lt;br /&gt;
providers = provider_sect&lt;br /&gt;
&lt;br /&gt;
[provider_sect]&lt;br /&gt;
default = default_sect&lt;br /&gt;
legacy = legacy_sect&lt;br /&gt;
&lt;br /&gt;
[default_sect]&lt;br /&gt;
activate = 1&lt;br /&gt;
&lt;br /&gt;
[legacy_sect]&lt;br /&gt;
activate = 1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Finally, [[restart]] the {{ic|NetworkManager.service}} to have the new OpenSSL configuration take effect.&lt;br /&gt;
&lt;br /&gt;
=== WPA Enterprise connections fail to authenticate with OpenSSL &amp;quot;unsupported protocol&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
Since {{Pkg|openssl}} was updated to version 3, &amp;quot;SSL 3, TLS 1.0, TLS 1.1, and DTLS 1.0 only work at security level 0&amp;quot; [https://www.openssl.org/news/openssl-3.0-notes.html by default]. Attempting to authenticate to a Wi-Fi network only supporting older standards results in the following error in the logs:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
wpa_supplicant[3320]: SSL: SSL3 alert: write (local SSL3 detected an error):fatal:protocol version&lt;br /&gt;
wpa_supplicant[3320]: OpenSSL: openssl_handshake - SSL_connect error:0A000102:SSL routines::unsupported protocol&lt;br /&gt;
wpa_supplicant[3320]: wlp3s0: CTRL-EVENT-EAP-FAILURE EAP authentication failed&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The correct approach is to convince the institution&#039;s administrator to upgrade the encrypted networking tunnel protocol to TLS 1.3 and optionally drop support for deprecated security standards, including TLS 1.0/1.1, DTLS 1.0 and SSL 1-3. However, as an immediate workaround, there are multiple ways to allow TLS 1.0 and/or 1.1 by default. One way would be to manually patch or revert the breaking changes in OpenSSL ([https://github.com/openssl/openssl/commit/7bf2e4d7f0c7ae19b7a8c416910886a7171e9820]). As this also lowers security for all other programs using OpenSSL level 1, it is not recommended. Instead, one can directly set the level used by wpa_supplicant, like described in [https://bbs.archlinux.org/viewtopic.php?id=286417#p2104492 BBS#286417]. To only change the affected connection, it is possible to set {{ic|1=phase1-auth-flags=32}} or {{ic|1=phase1-auth-flags=64}} in the {{ic|1=[802-1x]}} section of the connection&#039;s configuration file. This may not be possible through GUIs, but it is possible with &#039;&#039;nmcli&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Firstly, obtain the name of the Wi-Fi connection with the issue, from the output of the following:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection show&lt;br /&gt;
&lt;br /&gt;
Assuming the connection uses TLS 1.0 and its name is &#039;&#039;Example Wi-Fi&#039;&#039;, use &#039;&#039;nmcli&#039;&#039; like so:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection modify &#039;Example Wi-Fi&#039; 802-1x.phase1-auth-flags 32&lt;br /&gt;
&lt;br /&gt;
And for a TLS 1.1 connection, type &amp;quot;64&amp;quot; instead:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection modify &#039;Example Wi-Fi&#039; 802-1x.phase1-auth-flags 64&lt;br /&gt;
&lt;br /&gt;
{{Note|1=The number you type in refers to the number you get from raising 2 to the power of &#039;&#039;&#039;n&#039;&#039;&#039;. Here, &#039;&#039;&#039;n&#039;&#039;&#039; is the index of the network authentication bit octet, read from right to left. Flipping the fifth bit enables TLS 1.0 &#039;&#039;&#039;[log(2) 32]&#039;&#039;&#039; and flipping the sixth bit enables TLS 1.1 &#039;&#039;&#039;[log(2) 64]&#039;&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
The change should instantly be reflected in {{ic|/etc/NetworkManager/system-connections/Example Wi-Fi.nmconnection}}.&lt;br /&gt;
&lt;br /&gt;
Finally, [[restart]] the {{ic|NetworkManager.service}} to have the new OpenSSL configuration take effect.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://blogs.gnome.org/dcbw/2015/02/16/networkmanager-for-administrators-part-1/ NetworkManager for Administrators Part 1]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=NetworkManager&amp;diff=873282</id>
		<title>NetworkManager</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=NetworkManager&amp;diff=873282"/>
		<updated>2026-05-08T09:47:10Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Configuring MAC address randomization */ add accuracy template with references in  Talk:NetworkManager#iwd backend doesn&amp;#039;t support mac spoofing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Network managers]]&lt;br /&gt;
[[Category:DHCP]]&lt;br /&gt;
[[ar:Networkmanager]]&lt;br /&gt;
[[de:Networkmanager]]&lt;br /&gt;
[[fr:NetworkManager]]&lt;br /&gt;
[[hu:NetworkManager]]&lt;br /&gt;
[[ja:NetworkManager]]&lt;br /&gt;
[[pt:NetworkManager]]&lt;br /&gt;
[[ru:NetworkManager]]&lt;br /&gt;
[[zh-hans:NetworkManager]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|NetworkManager/Privacy}}&lt;br /&gt;
{{Related|Network configuration}}&lt;br /&gt;
{{Related|Wireless network configuration}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:NetworkManager|NetworkManager]] is a program for providing detection and configuration for systems to automatically connect to networks.&lt;br /&gt;
&lt;br /&gt;
[https://networkmanager.dev/ NetworkManager] can be useful for both wireless and wired networks. For wireless networks, NetworkManager prefers known wireless networks and has the ability to switch to the most reliable network.  NetworkManager-aware applications can switch from online and offline mode.&lt;br /&gt;
&lt;br /&gt;
NetworkManager also prefers wired connections over wireless ones, has support for modem connections and certain types of VPN.&lt;br /&gt;
&lt;br /&gt;
{{Warning|By default, secrets—e.g. Wi-Fi passwords—are accessible to the root user in the filesystem and to users with access to settings via the GUI (e.g. via [[#nm-applet]]). For more information, see [[#Encrypted Wi-Fi passwords]].}}&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
NetworkManager can be [[install]]ed with the package {{Pkg|networkmanager}}, which contains a daemon, a command line interface (&#039;&#039;nmcli&#039;&#039;) and a curses‐based interface (&#039;&#039;nmtui&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
=== Enable NetworkManager ===&lt;br /&gt;
&lt;br /&gt;
After installation, you should [[start/enable]] {{ic|NetworkManager.service}}. Once the NetworkManager daemon is started, it will automatically connect to any available &amp;quot;system connections&amp;quot; that have already been configured. Any &amp;quot;user connections&amp;quot; or unconfigured connections will need &#039;&#039;nmcli&#039;&#039; or an applet to configure and connect.&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* Each network interface should be managed by only one [[Network configuration#Network managers|DHCP client or network manager]], so it is advised to run only one DHCP client or network manager on the system. Find a list of the currently running services with {{ic|1=systemctl --type=service}} and then [[stop]] or reconfigure those that conflict.&lt;br /&gt;
* If [[systemd-resolved]] is not [[started]], an error message will start flooding your logs. See [[#Unit dbus-org.freedesktop.resolve1.service not found]] for more info.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Additional interfaces ===&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|nm-connection-editor}} for a graphical user interface,&lt;br /&gt;
* {{Pkg|network-manager-applet}} for a system tray applet (see the [[#nm-applet]] section).&lt;br /&gt;
&lt;br /&gt;
=== Mobile broadband support ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager uses [[ModemManager]] for mobile broadband connection support.&lt;br /&gt;
&lt;br /&gt;
[[Install]] {{Pkg|modemmanager}} and {{Pkg|usb_modeswitch}}. Afterwards [[enable]] and [[start]] {{ic|ModemManager.service}}.&lt;br /&gt;
&lt;br /&gt;
It may be necessary to [[restart]] {{ic|NetworkManager.service}} for it to detect ModemManager. After you restart it, re-plug the modem again and it should be recognized. &lt;br /&gt;
&lt;br /&gt;
Add connections from a front-end (e.g. {{Pkg|nm-connection-editor}}) and select mobile broadband as the connection type. After selecting your ISP and billing plan, [[Wikipedia:Access Point Name|APN]] and other settings should be filled in automatically using information from {{Pkg|mobile-broadband-provider-info}}.&lt;br /&gt;
&lt;br /&gt;
=== PPPoE / DSL support ===&lt;br /&gt;
&lt;br /&gt;
[[Install]] {{Pkg|ppp}} package for PPPoE / DSL connection support. To actually add PPPoE connection, use {{ic|1=nm-connection-editor}} and add new DSL/PPPoE connection.&lt;br /&gt;
&lt;br /&gt;
=== VPN support ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager since version 1.16 has native support for [[WireGuard]], all it needs is the {{ic|wireguard}} kernel module. Read the [https://blogs.gnome.org/thaller/2019/03/15/wireguard-in-networkmanager/ WireGuard in NetworkManager blog post] for details.&lt;br /&gt;
&lt;br /&gt;
Support for other VPN types is based on a plug-in system. They are provided in the following packages:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|networkmanager-openconnect}} for [[OpenConnect]]&lt;br /&gt;
* {{Pkg|networkmanager-openvpn}} for [[OpenVPN]]&lt;br /&gt;
* {{Pkg|networkmanager-pptp}} for [[PPTP Client]]&lt;br /&gt;
* {{Pkg|networkmanager-strongswan}} for [[strongSwan]]&lt;br /&gt;
* {{Pkg|networkmanager-vpnc}}&lt;br /&gt;
* {{AUR|networkmanager-fortisslvpn}}&lt;br /&gt;
* {{AUR|networkmanager-iodine-git}}&lt;br /&gt;
* {{AUR|networkmanager-libreswan}}&lt;br /&gt;
* {{Pkg|networkmanager-l2tp}}&lt;br /&gt;
* {{AUR|networkmanager-ssh}}&lt;br /&gt;
* {{Pkg|network-manager-sstp}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|1=There are a lot of [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues?search=VPN&amp;amp;state=opened bugs] related to VPN support. Check the daemon processes options set via the GUI correctly and double-check with each package release.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* To have fully functioning DNS resolution when using VPN, you should set up [[#DNS caching and conditional forwarding|conditional forwarding]].&lt;br /&gt;
* These plug-ins may not have a documented command line interface, or may not work at all without an applet running. This is not an issue if you are using a regular desktop environment; if you are not, you should run [[#nm-applet]] while configuring or activating the connection so that you get the necessary dialogues. [https://bbs.archlinux.org/viewtopic.php?id{{=}}246698]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
NetworkManager comes with {{man|1|nmcli}} and {{man|1|nmtui}}.&lt;br /&gt;
&lt;br /&gt;
=== nmcli examples ===&lt;br /&gt;
&lt;br /&gt;
List nearby Wi-Fi networks:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli device wifi list&lt;br /&gt;
&lt;br /&gt;
Connect to a Wi-Fi network:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli device wifi connect &#039;&#039;SSID_or_BSSID&#039;&#039; password &#039;&#039;password&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Connect to a hidden Wi-Fi network:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli device wifi connect &#039;&#039;SSID_or_BSSID&#039;&#039; password &#039;&#039;password&#039;&#039; hidden yes&lt;br /&gt;
&lt;br /&gt;
Connect to a Wi-Fi on the {{ic|wlan1}} interface:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli device wifi connect &#039;&#039;SSID_or_BSSID&#039;&#039; password &#039;&#039;password&#039;&#039; ifname wlan1 &#039;&#039;profile_name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Disconnect an interface:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli device disconnect ifname eth0&lt;br /&gt;
&lt;br /&gt;
Get a list of connections with their names, UUIDs, types and backing devices:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection show&lt;br /&gt;
&lt;br /&gt;
Activate a connection (i.e. connect to a network with an existing profile):&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection up &#039;&#039;name_or_uuid&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Delete a connection:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection delete &#039;&#039;name_or_uuid&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See a list of network devices and their state:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli device&lt;br /&gt;
&lt;br /&gt;
Turn off Wi-Fi:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli radio wifi off&lt;br /&gt;
&lt;br /&gt;
=== Edit a connection ===&lt;br /&gt;
&lt;br /&gt;
For a comprehensive list of settings, see {{man|5|nm-settings}}.&lt;br /&gt;
&lt;br /&gt;
Firstly, you need to get a list of connections:&lt;br /&gt;
&lt;br /&gt;
{{hc|$ nmcli connection|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
NAME                UUID                                  TYPE      DEVICE&lt;br /&gt;
Wired connection 2  e7054040-a421-3bef-965d-bb7d60b7cecf  ethernet  enp5s0&lt;br /&gt;
Wired connection 1  997f2782-f0fc-301d-bfba-15421a2735d8  ethernet  enp0s25&lt;br /&gt;
MY-HOME-WIFI-5G     92a0f7b3-2eba-49ab-a899-24d83978f308  wifi       --&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Here you can use the first column as connection-id used later. In this example, we pick {{ic|Wired connection 2}} as a connection-id.&lt;br /&gt;
&lt;br /&gt;
You have three methods to configure a connection {{ic|Wired connection 2}} after it has been created:&lt;br /&gt;
&lt;br /&gt;
; nmcli interactive editor&lt;br /&gt;
: {{ic|nmcli connection edit &#039;Wired connection 2&#039;}}.&amp;lt;br&amp;gt; Usage is well documented from the editor.&lt;br /&gt;
&lt;br /&gt;
; nmcli command line interface&lt;br /&gt;
: {{ic|nmcli connection modify &#039;Wired connection 2&#039; &#039;&#039;setting&#039;&#039;.&#039;&#039;property&#039;&#039; &#039;&#039;value&#039;&#039;}}. See {{man|1|nmcli}} for usage. For example, you can change its IPv4 route metric to 200 using {{ic|nmcli connection modify &#039;Wired connection 2&#039; ipv4.route-metric 200}} command.&lt;br /&gt;
To remove a setting, pass an empty field (&amp;quot;&amp;quot;) to it like this:&lt;br /&gt;
: {{ic|nmcli connection modify &#039;Wired connection 2&#039; &#039;&#039;setting&#039;&#039;.&#039;&#039;property&#039;&#039; &amp;quot;&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
; Connection file&lt;br /&gt;
: In {{ic|/etc/NetworkManager/system-connections/}}, modify the corresponding {{ic|Wired connection 2.nmconnection}} file .&amp;lt;br&amp;gt; Do not forget to reload the configuration file with {{ic|nmcli connection reload}}.&lt;br /&gt;
&lt;br /&gt;
=== nmtui ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager ships a text user interface (TUI) for managing connections, the system hostname and radio switches. It can be launched by running {{ic|nmtui}}.&lt;br /&gt;
&lt;br /&gt;
== Front-ends ==&lt;br /&gt;
&lt;br /&gt;
To provide integration with a [[desktop environment]], most users will want to install an applet. This not only provides easy access to network selection and configuration, but also provides the agent necessary for securely storing secrets. Various desktop environments have their own applet; otherwise, you can use [[#nm-applet]].&lt;br /&gt;
&lt;br /&gt;
=== GNOME ===&lt;br /&gt;
&lt;br /&gt;
[[GNOME]] has a built-in tool, accessible from the Network settings.&lt;br /&gt;
&lt;br /&gt;
=== KDE Plasma ===&lt;br /&gt;
&lt;br /&gt;
[[Install]] the {{Pkg|plasma-nm}} package. After that, add it to the KDE taskbar via the &#039;&#039;Panel options &amp;gt; Add widgets &amp;gt; Networks&#039;&#039; menu.&lt;br /&gt;
&lt;br /&gt;
=== nm-applet ===&lt;br /&gt;
&lt;br /&gt;
{{Pkg|network-manager-applet}} is a GTK 3 front-end which works under Xorg environments with a systray.&lt;br /&gt;
&lt;br /&gt;
To store connection secrets install and configure an application which implements the [https://specifications.freedesktop.org/secret-service-spec/latest/ Secret Service D-Bus API] such as [[GNOME/Keyring]], [[KDE Wallet]], or [[KeePassXC]].&lt;br /&gt;
&lt;br /&gt;
Be aware that after enabling the tick-box option {{ic|Make available to other users}} for a connection, NetworkManager stores the password in plain-text, though the respective file is accessible only to root (or other users via {{ic|nm-applet}}). See [[#Encrypted Wi-Fi passwords]].&lt;br /&gt;
&lt;br /&gt;
In order to run {{ic|nm-applet}} without a systray, you can use {{AUR|trayer}} or {{Pkg|stalonetray}}. For example, you can add a script like this one in your path:&lt;br /&gt;
&lt;br /&gt;
{{hc|nmgui|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
nm-applet    2&amp;gt;&amp;amp;1 &amp;gt; /dev/null &amp;amp;&lt;br /&gt;
stalonetray  2&amp;gt;&amp;amp;1 &amp;gt; /dev/null&lt;br /&gt;
killall nm-applet&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
When you close the &#039;&#039;stalonetray&#039;&#039; window, it closes {{ic|nm-applet}} too, so no extra memory is used once you are done with network settings.&lt;br /&gt;
&lt;br /&gt;
The applet can show notifications for events such as connecting to or disconnecting from a Wi-Fi network. For these notifications to display, ensure that you have a notification server installed - see [[Desktop notifications]]. If you use the applet without a notification server, you might see some messages in stdout/stderr, and the applet might hang. See [https://bugzilla.gnome.org/show_bug.cgi?id=788313].&lt;br /&gt;
&lt;br /&gt;
In order to run {{ic|nm-applet}} with such notifications disabled, start the applet with the following command:&lt;br /&gt;
&lt;br /&gt;
 $ nm-applet --no-agent&lt;br /&gt;
&lt;br /&gt;
{{Tip|{{ic|nm-applet}} might be started automatically with a [[XDG Autostart|autostart desktop file]], to add the {{ic|--no-agent}} option modify the Exec line there, i.e.&lt;br /&gt;
&lt;br /&gt;
{{bc|1=Exec=nm-applet --no-agent}}&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|On [[i3]], if nm-applet is started with the {{ic|--no-agent}} option, it is not possible to connect to a new encrypted Wi-Fi network by clicking on the item list because no password input dialogue window will pop out. [[journal]] will show {{ic|no secrets: No agents were available for this request}}.}}&lt;br /&gt;
&lt;br /&gt;
==== Appindicator ====&lt;br /&gt;
&lt;br /&gt;
As of version 1.18.0 Appindicator support is [https://gitlab.archlinux.org/archlinux/packaging/packages/network-manager-applet/-/commit/527448fb2a87d85055f504f463dfe961dccd75c3 available] in the official {{Pkg|network-manager-applet}} package. To use nm-applet in an Appindicator environment start the applet with the following command:&lt;br /&gt;
&lt;br /&gt;
 $ nm-applet --indicator&lt;br /&gt;
&lt;br /&gt;
=== networkmanager-dmenu ===&lt;br /&gt;
&lt;br /&gt;
Alternatively there is {{Pkg|networkmanager-dmenu}} which is a small script to manage NetworkManager connections with [[dmenu]] or [[rofi]] instead of {{ic|nm-applet}}. It provides all essential features such as connection to existing NetworkManager Wi-Fi or wired connections, connect to new Wi-Fi connections, requests passphrase if required, connect to existing VPN connections, enable/disable networking, launch &#039;&#039;nm-connection-editor&#039;&#039; GUI, connect to Bluetooth networks.&lt;br /&gt;
&lt;br /&gt;
=== switchboard ===&lt;br /&gt;
&lt;br /&gt;
Pantheon&#039;s {{Pkg|switchboard}} offers a desktop environment-agnostic way to configure NetworkManager when combined with {{Pkg|switchboard-plug-network}} and {{Pkg|nm-connection-editor}}. It can be ran with the following command:&lt;br /&gt;
&lt;br /&gt;
 $ io.elementary.settings&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
NetworkManager may require some additional steps to be able run properly. Make sure you have configured {{ic|/etc/hosts}} as described in [[Network configuration#Set the hostname]] section.&lt;br /&gt;
&lt;br /&gt;
NetworkManager has a global configuration file at {{ic|/etc/NetworkManager/NetworkManager.conf}}. Additional configuration files can be placed in {{ic|/etc/NetworkManager/conf.d/}}. Usually no configuration needs to be done to the global defaults.&lt;br /&gt;
&lt;br /&gt;
After editing a configuration file, the changes can be applied by running:&lt;br /&gt;
&lt;br /&gt;
 # nmcli general reload&lt;br /&gt;
&lt;br /&gt;
=== NetworkManager-wait-online ===&lt;br /&gt;
&lt;br /&gt;
Enabling {{ic|NetworkManager.service}} also enables {{ic|NetworkManager-wait-online.service}}, which is a oneshot system service that waits for the network to be configured. The latter has {{ic|1=WantedBy=network-online.target}}, so it will finish only when {{ic|network-online.target}} itself is enabled or pulled in by some other unit. See also [[systemd#Running services after the network is up]].&lt;br /&gt;
&lt;br /&gt;
By default, {{ic|NetworkManager-wait-online.service}} waits for NetworkManager startup to complete, rather than waiting for network connectivity specifically (see {{man|1|nm-online}}). If {{ic|NetworkManager-wait-online.service}} finishes before the network is really up, resulting in failed services on boot, [[extend the unit]] to remove the {{ic|-s}} from the {{ic|ExecStart}} line:&lt;br /&gt;
&lt;br /&gt;
 [Service]&lt;br /&gt;
 ExecStart=&lt;br /&gt;
 ExecStart=/usr/bin/nm-online -q&lt;br /&gt;
&lt;br /&gt;
Be aware that this can cause [https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org/thread/EGC324JD3HJCGVN7J55WYPRLFDA3TP7N/ other issues].&lt;br /&gt;
&lt;br /&gt;
In some cases, the service will still fail to start successfully on boot due to the timeout setting being too short. [[Edit]] the service to change {{ic|NM_ONLINE_TIMEOUT}} from {{ic|60}} to a higher value.&lt;br /&gt;
&lt;br /&gt;
=== Set up PolicyKit permissions ===&lt;br /&gt;
&lt;br /&gt;
By default, all users in active local sessions are allowed to change most network settings without a password. See [[General troubleshooting#Session permissions]] to check your session type. In most cases, everything should work out of the box.&lt;br /&gt;
&lt;br /&gt;
Some actions (such as changing the system hostname) require an administrator password. In this case, you need to [[Users and groups#Group management|add]] yourself to the {{ic|wheel}} group and run a [[Polkit#Authentication agents|Polkit authentication agent]] which will prompt for your password.&lt;br /&gt;
&lt;br /&gt;
For remote sessions (e.g. [[TigerVNC#Running vncserver for virtual (headless) sessions|headless VNC]]), you have several options for obtaining the necessary privileges to use NetworkManager:&lt;br /&gt;
&lt;br /&gt;
# [[Users and groups#Group management|Add]] yourself to the {{ic|wheel}} group. You will have to enter your password for every action. Note that your user account may be granted other permissions as well, such as the ability to use [[sudo]] without entering the root password.&lt;br /&gt;
# [[Users and groups#Group management|Add]] yourself to the {{ic|network}} group and create {{ic|/etc/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules}} with the following content: {{bc|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
polkit.addRule(function(action, subject) {&lt;br /&gt;
  if (action.id.indexOf(&amp;quot;org.freedesktop.NetworkManager.&amp;quot;) == 0 &amp;amp;&amp;amp; subject.isInGroup(&amp;quot;network&amp;quot;)) {&lt;br /&gt;
    return polkit.Result.YES;&lt;br /&gt;
  }&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}} All users in the {{ic|network}} group will be able to add and remove networks without a password (which means you do not have to run a Polkit authentication agent, so this option will also work in SSH sessions).&lt;br /&gt;
&lt;br /&gt;
=== Proxy settings ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager does support some proxy settings. While they can not be directly modified using &#039;&#039;nmtui&#039;&#039;, &#039;&#039;nm-applet&#039;&#039; and &#039;&#039;nmcli&#039;&#039; support those.&lt;br /&gt;
See the proxy settings in {{man|5|nm-settings-nmcli}}.&lt;br /&gt;
&lt;br /&gt;
Additionally, custom proxy commands can always be run using dispatcher scripts, see [[#Dispatcher examples]].&lt;br /&gt;
&lt;br /&gt;
See also [[Proxy settings]].&lt;br /&gt;
&lt;br /&gt;
=== Checking connectivity ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager can try to reach a webserver after connecting to a network in order to determine if it is e.g behind a captive portal. The default host (configured in {{ic|/usr/lib/NetworkManager/conf.d/20-connectivity.conf}}) is [https://ping.archlinux.org ping.archlinux.org] (a CNAME alias of redirect.archlinux.org). To use a different webserver or to disable connectivity checking, create {{ic|/etc/NetworkManager/conf.d/20-connectivity.conf}}, see {{man|5|NetworkManager.conf|CONNECTIVITY SECTION}}. Below is an example of using GNOME servers (it does not require the use of [[GNOME]]):&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/20-connectivity.conf|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
[connectivity]&lt;br /&gt;
uri=http://nmcheck.gnome.org/check_network_status.txt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
To disable NetworkManager&#039;s connectivity check, use the following configuration. This can be useful when connected to a VPN that blocks connectivity checks.&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/20-connectivity.conf|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
[connectivity]&lt;br /&gt;
enabled=false&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Although automatic connectivity checks are a potential privacy leak, Arch Linux&#039;s default connectivity URL is committed to not logging any access. See [https://gitlab.archlinux.org/archlinux/infrastructure/-/commit/fabccd0f61e5dea3925e8a0c6a46d56d5750c121#a4f34381bbb18ea77bfb3dd11a8aeca707078fca_0_26] [https://gitlab.archlinux.org/archlinux/infrastructure/-/blob/master/roles/ping/templates/nginx.d.conf.j2].}}&lt;br /&gt;
&lt;br /&gt;
=== Captive portals ===&lt;br /&gt;
&lt;br /&gt;
{{Style|Complex scripts should not be maintained on the wiki.}}&lt;br /&gt;
&lt;br /&gt;
For those behind a [[Wikipedia:Captive portal|captive portal]], the desktop manager may automatically open a window asking for credentials. If your desktop does not, you can use {{Pkg|capnet-assist}} package (however, it currently has a broken NetworkManager dispatcher script). Alternatively, you can create a NetworkManager dispatcher script with the following content:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/90-open_captive_portal|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh -e&lt;br /&gt;
# Script to dispatch NetworkManager events&lt;br /&gt;
#&lt;br /&gt;
# Runs shows a login webpage on walled garden networks.&lt;br /&gt;
# See NetworkManager(8) for further documentation of the dispatcher events.&lt;br /&gt;
&lt;br /&gt;
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&lt;br /&gt;
&lt;br /&gt;
if [ -x &amp;quot;/usr/bin/logger&amp;quot; ]; then&lt;br /&gt;
    logger=&amp;quot;/usr/bin/logger -s -t captive-portal&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
    logger=&amp;quot;:&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
wait_for_process() {&lt;br /&gt;
    PNAME=$1&lt;br /&gt;
    while [ -z &amp;quot;$(/usr/bin/pgrep $PNAME)&amp;quot; ]; do&lt;br /&gt;
        sleep 3;&lt;br /&gt;
    done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#launch the browser, but on boot we need to wait that nm-applet starts&lt;br /&gt;
start_browser() {&lt;br /&gt;
    local user=&amp;quot;$1&amp;quot;&lt;br /&gt;
    local display=&amp;quot;$2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    export DISPLAY=&amp;quot;$display&amp;quot;&lt;br /&gt;
    wait_for_process nm-applet&lt;br /&gt;
&lt;br /&gt;
    export XAUTHORITY=&amp;quot;/home/$user/.Xauthority&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    $logger &amp;quot;Running browser as &#039;$user&#039; with display &#039;$display&#039; to login in captive portal&amp;quot;&lt;br /&gt;
    sudo -u &amp;quot;$user&amp;quot; --preserve-env=DISPLAY,XAUTHORITY -H xdg-open http://capnet.elementary.io 2&amp;gt;&amp;amp;1 &amp;gt; /dev/null&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Run the right scripts&lt;br /&gt;
case &amp;quot;$2&amp;quot; in&lt;br /&gt;
    connectivity-change)&lt;br /&gt;
    $logger -p user.debug &amp;quot;dispatcher script triggered on connectivity change: $CONNECTIVITY_STATE&amp;quot;&lt;br /&gt;
    if [ &amp;quot;$CONNECTIVITY_STATE&amp;quot; = &amp;quot;PORTAL&amp;quot; ]; then&lt;br /&gt;
        # Match last column of who&#039;s output with &#039; :[at least one digit] &#039;&lt;br /&gt;
        who | awk &#039;$NF ~ /\(:[0-9]+\)/ { print $1 &amp;quot; &amp;quot; substr($NF, 2, length($NF)-2) };&#039; | \&lt;br /&gt;
        while read user display; do&lt;br /&gt;
            start_browser $user $display || $logger -p user.err &amp;quot;Failed for user: &#039;$user&#039; display: &#039;$display&#039;&amp;quot;&lt;br /&gt;
        done&lt;br /&gt;
    fi&lt;br /&gt;
    ;;&lt;br /&gt;
    *)&lt;br /&gt;
    # In a down phase&lt;br /&gt;
    exit 0&lt;br /&gt;
    ;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Make the script [[executable]]. But that script assumes you use X and simply opens http page. It might not work for everyone.&lt;br /&gt;
&lt;br /&gt;
You will need to [[restart]] {{ic|NetworkManager.service}} or reboot for this to start working. Once you do, the dispatcher script should open a login window once it detects you are behind a captive portal.&lt;br /&gt;
&lt;br /&gt;
Simple solution is [https://github.com/Seme4eg/captive-portal-sh captive-portal-sh] - shell script that obtains captive portal URL and opens it in your default browser (for Wayland users only).&lt;br /&gt;
&lt;br /&gt;
Another solution is {{AUR|captive-browser-git}} based on Google Chrome.&lt;br /&gt;
&lt;br /&gt;
==== iwd support for captive portal support on legacy hardware ====&lt;br /&gt;
&lt;br /&gt;
Some older Wi-Fi chips (e.g. Broadcom BCM4360) require the proprietary {{ic|wl}} driver, which lacks support for the OWE/Elliptic-Curve handshake that many captive-portal hotspots use before presenting a login page. By switching NetworkManager’s Wi-Fi backend to {{ic|iwd}} (see [[#Using iwd as the Wi-Fi backend]]), which implements the full OWE key exchange in userspace over the existing driver, you can complete the encrypted association, obtain a DHCP lease, and trigger the portal “PORTAL” state. Once that is done, any dispatcher script or browser-launcher will reliably pop up the login page on hardware that otherwise could never fully connect.&lt;br /&gt;
&lt;br /&gt;
=== DHCP client ===&lt;br /&gt;
&lt;br /&gt;
By default NetworkManager uses its internal DHCP client. The internal DHCPv4 plugin is based on the [https://nettools.github.io/n-dhcp4/ nettools&#039; n-dhcp4] library, while the internal DHCPv6 plugin is made from code based on systemd-networkd.&lt;br /&gt;
&lt;br /&gt;
To use a different DHCP client [[install]] one of the alternatives:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|dhcpcd}} - [[dhcpcd]]&lt;br /&gt;
* {{Pkg|dhclient}} - [[dhclient]]&lt;br /&gt;
&lt;br /&gt;
To change the DHCP client backend, set the option {{ic|1=main.dhcp=&#039;&#039;dhcp_client_name&#039;&#039;}} with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}. E.g.:&lt;br /&gt;
&lt;br /&gt;
{{hc|1=/etc/NetworkManager/conf.d/dhcp-client.conf|2=&lt;br /&gt;
[main]&lt;br /&gt;
dhcp=dhcpcd&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
Do not enable the systemd units shipped with the {{Pkg|dhclient}} and {{Pkg|dhcpcd}} packages. They will conflict with NetworkManager, see the note in [[#Installation]] for details.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== DNS management ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager&#039;s DNS management is described in the GNOME project&#039;s wiki page—[https://wiki.gnome.org/Projects/NetworkManager/DNS Projects/NetworkManager/DNS].&lt;br /&gt;
&lt;br /&gt;
==== DNS caching and conditional forwarding ====&lt;br /&gt;
&lt;br /&gt;
NetworkManager has a plugin to enable DNS caching and conditional forwarding ([https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/143 previously] called &amp;quot;split DNS&amp;quot; in NetworkManager&#039;s documentation) using [[dnsmasq]] or [[systemd-resolved]]. The advantages of this setup is that DNS lookups will be cached, shortening resolve times, and DNS lookups of VPN hosts will be routed to the relevant VPN&#039;s DNS servers. This is especially useful if you are connected to more than one VPN.&lt;br /&gt;
&lt;br /&gt;
{{Note|If {{ic|/etc/resolv.conf}} is a symlink to {{ic|/run/systemd/resolve/stub-resolv.conf}}, {{ic|/run/systemd/resolve/resolv.conf}},{{ic|/lib/systemd/resolv.conf}} or {{ic|/usr/lib/systemd/resolv.conf}}, NetworkManager will choose systemd-resolved automatically. To use dnsmasq, you must first remove that symlink, then restart NetworkManager.}}&lt;br /&gt;
&lt;br /&gt;
===== dnsmasq =====&lt;br /&gt;
&lt;br /&gt;
Make sure {{Pkg|dnsmasq}} has been installed. Then set {{ic|1=main.dns=dnsmasq}} with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/dns.conf|2=&lt;br /&gt;
[main]&lt;br /&gt;
dns=dnsmasq&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Now run {{ic|nmcli general reload}} as root. NetworkManager will automatically start dnsmasq and add {{ic|127.0.0.1}} to {{ic|/etc/resolv.conf}}. The original DNS servers can be found in {{ic|/run/NetworkManager/no-stub-resolv.conf}}. You can verify dnsmasq is being used by doing the same DNS lookup twice with {{ic|drill example.com}} and verifying the server and query times.&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* You do not need to start {{ic|dnsmasq.service}} or edit {{ic|/etc/dnsmasq.conf}}. NetworkManager will start dnsmasq without using the systemd service and without reading the dnsmasq&#039;s default configuration file(s).&lt;br /&gt;
* The dnsmasq instance started by NetworkManager will bind to {{ic|127.0.0.1:53}}, you cannot run any other software (including {{ic|dnsmasq.service}}) on the same address and port.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====== Custom dnsmasq configuration ======&lt;br /&gt;
&lt;br /&gt;
Custom configurations can be created for &#039;&#039;dnsmasq&#039;&#039; by creating configuration files in {{ic|/etc/NetworkManager/dnsmasq.d/}}. For example, to change the size of the DNS cache (which is stored in RAM):&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dnsmasq.d/cache.conf|2=&lt;br /&gt;
cache-size=1000&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can check the configuration file syntax with:&lt;br /&gt;
&lt;br /&gt;
 $ dnsmasq --test --conf-file=/dev/null --conf-dir=/etc/NetworkManager/dnsmasq.d&lt;br /&gt;
&lt;br /&gt;
See {{man|8|dnsmasq}} for all available options.&lt;br /&gt;
&lt;br /&gt;
====== IPv6 ======&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|This does not solve the issue because NetworkManager does not add {{ic|::1}} to {{ic|/etc/resolv.conf}}. Unless {{ic|@::1}} is manually passed to drill, it will still fail with {{ic|Error: error sending query: No (valid) nameservers defined in the resolver}}.}}&lt;br /&gt;
&lt;br /&gt;
Enabling {{ic|dnsmasq}} in NetworkManager may break IPv6-only DNS lookups (i.e. {{ic|drill -6 [hostname]}}) which would otherwise work. In order to resolve this, creating the following file will configure &#039;&#039;dnsmasq&#039;&#039; to also listen to the IPv6 loopback:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dnsmasq.d/ipv6-listen.conf|2=&lt;br /&gt;
listen-address=::1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
In addition, {{ic|dnsmasq}} also does not prioritize upstream IPv6 DNS. Unfortunately NetworkManager does not do this ([https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/936712 Ubuntu Bug]). A workaround would be to disable IPv4 DNS in the NetworkManager config, assuming one exists.&lt;br /&gt;
&lt;br /&gt;
====== DNSSEC ======&lt;br /&gt;
&lt;br /&gt;
The dnsmasq instance started by NetworkManager by default will not validate [[DNSSEC]]. To enable DNSSEC validation, thus breaking DNS resolution with name servers that do not support it, create the following configuration file:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dnsmasq.d/dnssec.conf|2=&lt;br /&gt;
conf-file=/usr/share/dnsmasq/trust-anchors.conf&lt;br /&gt;
dnssec&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== systemd-resolved =====&lt;br /&gt;
&lt;br /&gt;
{{Expansion|NetworkManager 1.16 adds a new setting {{ic|main.systemd-resolved}}[https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commit/d4eb4cb45f41b1751cacf71da558bf8f0988f383] (enabled by default). It unconditionally sends DNS configuration to systemd-resolved. Related to &amp;quot;Preserving resolv.conf&amp;quot; from [[systemd-resolved#DNS]]?}}&lt;br /&gt;
&lt;br /&gt;
NetworkManager can use [[systemd-resolved]] as a DNS resolver and cache. Make sure that &#039;&#039;systemd-resolved&#039;&#039; is properly configured and that {{ic|systemd-resolved.service}} is [[started]] before using it.&lt;br /&gt;
&lt;br /&gt;
systemd-resolved will be used automatically if {{ic|/etc/resolv.conf}} is a [[systemd-resolved#DNS|symlink]] to {{ic|/run/systemd/resolve/stub-resolv.conf}}, {{ic|/run/systemd/resolve/resolv.conf}} or {{ic|/usr/lib/systemd/resolv.conf}}.&lt;br /&gt;
&lt;br /&gt;
You can enable it explicitly by setting {{ic|1=main.dns=systemd-resolved}} with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/dns.conf|2=&lt;br /&gt;
[main]&lt;br /&gt;
dns=systemd-resolved&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== DNS resolver with an openresolv subscriber =====&lt;br /&gt;
&lt;br /&gt;
If [[openresolv]] has a subscriber for your local [[DNS resolver]], set up the subscriber and [[#Use openresolv|configure NetworkManager to use openresolv]].&lt;br /&gt;
&lt;br /&gt;
Because NetworkManager advertises a single &amp;quot;interface&amp;quot; to &#039;&#039;resolvconf&#039;&#039;, it is not possible to implement conditional forwarding between two NetworkManager connections. See [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/153 NetworkManager issue 153].&lt;br /&gt;
&lt;br /&gt;
This can be partially mitigated if you set {{ic|1=private_interfaces=&amp;quot;*&amp;quot;}} in {{ic|/etc/resolvconf.conf}}[https://roy.marples.name/projects/openresolv/configuration/]. Any queries for domains that are not in search domain list will not get forwarded. They will be handled according to the local resolver&#039;s configuration, for example, forwarded to another DNS server or resolved recursively from the DNS root.&lt;br /&gt;
&lt;br /&gt;
==== Custom DNS servers ====&lt;br /&gt;
&lt;br /&gt;
===== Setting custom global DNS servers =====&lt;br /&gt;
&lt;br /&gt;
To set DNS servers for all connections, specify them in {{man|5|NetworkManager.conf}} using the syntax {{ic|1=servers=&#039;&#039;serveripaddress1&#039;&#039;,&#039;&#039;serveripaddress2&#039;&#039;,&#039;&#039;serveripaddress3&#039;&#039;}} in a section named {{ic|[global-dns-domain-*]}}. For example:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/dns-servers.conf|2=&lt;br /&gt;
[global-dns-domain-*]&lt;br /&gt;
servers=::1,127.0.0.1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* If you use [[#DNS caching and conditional forwarding|NetworkManager&#039;s dnsmasq or systemd-resolved plugin]] or [[#DNS resolver with an openresolv subscriber|openresolv subscribers]], then do not specify loopback addresses with the {{ic|1=servers=}} option, it can break DNS resolution.&lt;br /&gt;
* The specified servers do not get sent to [[systemd-resolved]], the connection&#039;s DNS servers are used instead. See [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1366 NetworkManager issue 1366] and [https://github.com/systemd/systemd/issues/33754 systemd issue 33754].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== Setting custom DNS servers in a connection =====&lt;br /&gt;
&lt;br /&gt;
====== Setting custom DNS servers in a connection (GUI) ======&lt;br /&gt;
&lt;br /&gt;
Setup will depend on the type of front-end used; the process usually involves right-clicking on the applet, editing (or creating) a profile, and then choosing DHCP type as &#039;&#039;Automatic (specify addresses)&#039;&#039;. The DNS addresses will need to be entered and are usually in this form: {{ic|127.0.0.1, &#039;&#039;DNS-server-one&#039;&#039;, ...}}.&lt;br /&gt;
&lt;br /&gt;
====== Setting custom DNS servers in a connection (nmcli / connection file) ======&lt;br /&gt;
&lt;br /&gt;
To set up DNS Servers per connection, you change the {{ic|ipv4.dns}} and {{ic|ipv6.dns}} settings (and their associated {{ic|dns-search}} and {{ic|dns-options}}) in the [[#Edit a connection|connection settings]].&lt;br /&gt;
&lt;br /&gt;
If {{ic|method}} is set to {{ic|auto}} (when you use DHCP/RA), you need to set {{ic|ignore-auto-dns}} to {{ic|yes}}.&lt;br /&gt;
&lt;br /&gt;
To use DNS over TLS ([[#systemd-resolved|requires systemd-resolved]]), specify the DNS servers using the syntax {{ic|1=dns=&#039;&#039;ip.address&#039;&#039;#&#039;&#039;servername&#039;&#039;;}} and additionally set the {{ic|connection.dns-over-tls}} setting to {{ic|2}}. For example, to use Quad9:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/system-connections/Example Wi-Fi.nmconnection|2=&lt;br /&gt;
...&lt;br /&gt;
[connection]&lt;br /&gt;
...&lt;br /&gt;
dns-over-tls=2&lt;br /&gt;
&lt;br /&gt;
[ipv4]&lt;br /&gt;
...&lt;br /&gt;
dns=9.9.9.9#dns.quad9.net;149.112.112.112#dns.quad9.net;&lt;br /&gt;
ignore-auto-dns=true&lt;br /&gt;
&lt;br /&gt;
[ipv6]&lt;br /&gt;
...&lt;br /&gt;
dns=2620:fe::fe#dns.quad9.net;2620:fe::9#dns.quad9.net;&lt;br /&gt;
ignore-auto-dns=true&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|This example uses Quad9. Replace it with a DNS resolver you trust. See [[Domain name resolution#Third-party DNS services]].}}&lt;br /&gt;
&lt;br /&gt;
==== /etc/resolv.conf ====&lt;br /&gt;
&lt;br /&gt;
NetworkManager&#039;s {{ic|/etc/resolv.conf}} management mode is configured with the {{ic|main.rc-manager}} setting. {{Pkg|networkmanager}} sets it to {{ic|symlink}} as opposed to the upstream default {{ic|auto}}. The setting and its values are documented in the {{man|5|NetworkManager.conf}} man page.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Using openresolv allows NetworkManager to coexist with other &#039;&#039;resolvconf&#039;&#039; supporting software or, for example, to run a local DNS caching and split-DNS resolver for which openresolv has a [[openresolv#Subscribers|subscriber]]. Note that conditional forwarding is [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/153 not yet fully supported] when using NetworkManager with openresolv.}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NetworkManager&#039;&#039; also offers hooks via so called dispatcher scripts that can be used to alter the {{ic|/etc/resolv.conf}} after network changes. See [[#Network services with NetworkManager dispatcher]] and {{man|8|NetworkManager}} for more information.&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* If NetworkManager is configured to use either [[#dnsmasq|dnsmasq]] or [[#systemd-resolved|systemd-resolved]], then the appropriate loopback addresses will be written to {{ic|/etc/resolv.conf}}.&lt;br /&gt;
* The {{ic|resolv.conf}} file NetworkManager writes or would write to {{ic|/etc/resolv.conf}} can be found at {{ic|/run/NetworkManager/resolv.conf}}.&lt;br /&gt;
* A {{ic|resolv.conf}} file with the acquired name servers and search domains can be found at {{ic|/run/NetworkManager/no-stub-resolv.conf}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== Unmanaged /etc/resolv.conf =====&lt;br /&gt;
&lt;br /&gt;
To stop NetworkManager from touching {{ic|/etc/resolv.conf}}, set {{ic|1=main.dns=none}} with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/dns.conf|2=&lt;br /&gt;
[main]&lt;br /&gt;
dns=none&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|You might also want to set {{ic|1=main.systemd-resolved=false}}, so that NetworkManager does not send the DNS configuration to [[systemd-resolved]].}}&lt;br /&gt;
&lt;br /&gt;
{{Note|See [[#DNS caching and conditional forwarding]], to configure NetworkManager using other DNS backends like [[dnsmasq]] and [[systemd-resolved]], instead of using {{ic|1=main.dns=none}}.}}&lt;br /&gt;
&lt;br /&gt;
After that {{ic|/etc/resolv.conf}} might be a broken symlink that you will need to remove. Then, just create a new {{ic|/etc/resolv.conf}} file.&lt;br /&gt;
&lt;br /&gt;
===== Use openresolv =====&lt;br /&gt;
&lt;br /&gt;
{{Note|NetworkManager does not support using systemd-resolved&#039;s &#039;&#039;resolvconf&#039;&#039; interface ({{man|1|resolvectl|COMPATIBILITY WITH RESOLVCONF(8)}}) which is provided by {{Pkg|systemd-resolvconf}}.&lt;br /&gt;
* Do not set {{ic|1=main.rc-manager=resolvconf}} when using [[systemd-resolved]], instead make sure to [[systemd-resolved#DNS|correctly create the /etc/resolv.conf symlink]] or [[#systemd-resolved|configure NetworkManager to use systemd-resolved explicitly]].&lt;br /&gt;
* Make sure the {{Pkg|systemd-resolvconf}} package is not installed when systemd-resolved is not used. Unless {{ic|systemd-resolved.service}} started, it will break all networking software (not just NetworkManager) that use resolvconf.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To configure NetworkManager to use [[openresolv]], set {{ic|1=main.rc-manager=resolvconf}} with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/rc-manager.conf|2=&lt;br /&gt;
[main]&lt;br /&gt;
rc-manager=resolvconf&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Firewall ===&lt;br /&gt;
&lt;br /&gt;
You can [[Firewalld#Using NetworkManager to manage zones|assign a firewalld zone]] based on your current connection. For example a restrictive firewall when at work, and a less restrictive one when at home.&lt;br /&gt;
&lt;br /&gt;
This can also be done with [[#Network services with NetworkManager dispatcher|NetworkManager dispatcher]].&lt;br /&gt;
&lt;br /&gt;
== Network services with NetworkManager dispatcher ==&lt;br /&gt;
&lt;br /&gt;
There are quite a few network services that you will not want running until NetworkManager brings up an interface. NetworkManager has the ability to start services when you connect to a network and stop them when you disconnect (e.g. when using [[NFS]], [[SMB]] and [[NTPd]]).&lt;br /&gt;
&lt;br /&gt;
To activate the feature you need to [[enable]] and [[start]] the {{ic|NetworkManager-dispatcher.service}}.&lt;br /&gt;
&lt;br /&gt;
Once the service is active, scripts can be added to the {{ic|/etc/NetworkManager/dispatcher.d}} directory.&lt;br /&gt;
&lt;br /&gt;
Scripts must be owned by &#039;&#039;&#039;root&#039;&#039;&#039;, otherwise the dispatcher will not execute them. For added security, set group [[ownership]] to root as well:&lt;br /&gt;
&lt;br /&gt;
 # chown root:root /etc/NetworkManager/dispatcher.d/&#039;&#039;10-script.sh&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Make sure the file is [[executable]]. &lt;br /&gt;
&lt;br /&gt;
The scripts will be run in alphabetical order at connection time, and in reverse alphabetical order at disconnect time. To ensure what order they come up in, it is common to use numerical characters prior to the name of the script (e.g. {{ic|10-portmap}} or {{ic|30-netfs}} (which ensures that the &#039;&#039;portmapper&#039;&#039; is up before NFS mounts are attempted).&lt;br /&gt;
&lt;br /&gt;
Scripts will receive the following arguments:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Interface name:&#039;&#039;&#039; e.g. {{ic|eth0}}&lt;br /&gt;
* &#039;&#039;&#039;Action:&#039;&#039;&#039; &#039;&#039;up&#039;&#039;, &#039;&#039;down&#039;&#039;, &#039;&#039;vpn-up&#039;&#039;, &#039;&#039;vpn-down&#039;&#039;, ... (see {{man|8|NetworkManager-dispatcher}} for the complete list)&lt;br /&gt;
&lt;br /&gt;
{{Warning|If you connect to foreign or public networks, be aware of what services you are starting and what servers you expect to be available for them to connect to. You could make a security hole by starting the wrong services while connected to a public network.}}&lt;br /&gt;
&lt;br /&gt;
=== Avoiding the dispatcher timeout ===&lt;br /&gt;
&lt;br /&gt;
If the above is working, then this section is not relevant. However, there is a general problem related to running dispatcher scripts which take longer to be executed. Initially an internal timeout of three seconds only was used. If the called script did not complete in time, it was killed. Later the timeout was extended to about 20 seconds (see the [https://bugzilla.redhat.com/show_bug.cgi?id=982734 Bugtracker] for more information). If the timeout still creates the problem, a work around may be to use a [[drop-in file]] for the {{ic|NetworkManager-dispatcher.service}} to remain active after exit: &lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/systemd/system/NetworkManager-dispatcher.service.d/remain_after_exit.conf|2=&lt;br /&gt;
[Service]&lt;br /&gt;
RemainAfterExit=yes&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Now start and enable the modified {{ic|NetworkManager-dispatcher}} service.&lt;br /&gt;
&lt;br /&gt;
{{Warning|Adding the {{ic|RemainAfterExit}} line to it will prevent the dispatcher from closing. Unfortunately, the dispatcher &#039;&#039;&#039;has&#039;&#039;&#039; to close before it can run your scripts again. With it the dispatcher will not time out but it also will not close, which means that the scripts will only run once per boot. Therefore, do not add the line unless the timeout is definitely causing a problem.}}&lt;br /&gt;
&lt;br /&gt;
=== Dispatcher examples ===&lt;br /&gt;
&lt;br /&gt;
==== Automatically set the timezone ====&lt;br /&gt;
&lt;br /&gt;
Create a [[#Network services with NetworkManager dispatcher|NetworkManager dispatcher script]] and make it [[executable]]:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/09-timezone|&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
case &amp;quot;$2&amp;quot; in&lt;br /&gt;
    up)&lt;br /&gt;
        timedatectl set-timezone &amp;quot;$(curl --fail &amp;lt;nowiki&amp;gt;https://ipapi.co/timezone&amp;lt;/nowiki&amp;gt;)&amp;quot;&lt;br /&gt;
    ;;&lt;br /&gt;
esac&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|Using {{ic|connectivity-change}} instead of {{ic|up}} can prevent timezone changes when connecting to VPNs with clients such as [[OpenConnect]].}}&lt;br /&gt;
&lt;br /&gt;
Alternatively, the tool {{aur|tzupdate}} automatically sets the timezone based on the geolocation of the IP address. This [https://medium.com/@ipdata_co/what-is-the-best-commercial-ip-geolocation-api-d8195cda7027 comparison of the most popular IP geolocation apis] may be helpful in deciding which API to use in production.&lt;br /&gt;
&lt;br /&gt;
==== Mount remote directory with sshfs ====&lt;br /&gt;
&lt;br /&gt;
As the script is run in a very restrictive environment, you have to export {{ic|SSH_AUTH_SOCK}} in order to connect to your SSH agent. There are different ways to accomplish this, see [https://bbs.archlinux.org/viewtopic.php?pid=1042030#p1042030 this message] for more information. The example below works with [[GNOME Keyring]], and will ask you for the password if not unlocked already. In case NetworkManager connects automatically on login, it is likely &#039;&#039;gnome-keyring&#039;&#039; has not yet started and the export will fail (hence the sleep). The {{ic|UUID}} to match can be found with the command {{ic|nmcli connection status}} or {{ic|nmcli connection list}}.     &lt;br /&gt;
&lt;br /&gt;
{{bc|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
USER=&#039;username&#039;&lt;br /&gt;
REMOTE=&#039;user@host:/remote/path&#039;&lt;br /&gt;
LOCAL=&#039;/local/path&#039;&lt;br /&gt;
&lt;br /&gt;
interface=$1 status=$2&lt;br /&gt;
if [ &amp;quot;$CONNECTION_UUID&amp;quot; = &amp;quot;&amp;lt;/nowiki&amp;gt;&#039;&#039;uuid&#039;&#039;&amp;lt;nowiki&amp;gt;&amp;quot; ]; then&lt;br /&gt;
  case $status in&lt;br /&gt;
    up)&lt;br /&gt;
      # sleep 10&lt;br /&gt;
      SSH_AUTH_SOCK=$(find /tmp -maxdepth 1 -type s -user &amp;quot;$USER&amp;quot; -name &#039;ssh&#039;)&lt;br /&gt;
      export SSH_AUTH_SOCK&lt;br /&gt;
      su &amp;quot;$USER&amp;quot; -c &amp;quot;sshfs $REMOTE $LOCAL&amp;quot;&lt;br /&gt;
      ;;&lt;br /&gt;
    down)&lt;br /&gt;
      fusermount -u &amp;quot;$LOCAL&amp;quot;&lt;br /&gt;
      ;;&lt;br /&gt;
  esac&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
==== Mounting of SMB shares ====&lt;br /&gt;
&lt;br /&gt;
Some [[SMB]] shares are only available on certain networks or locations (e.g. at home). You can use the dispatcher to only mount SMB shares that are present at your current location.&lt;br /&gt;
&lt;br /&gt;
The following script will check if we connected to a specific network and mount shares accordingly:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/30-mount-smb.sh|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# Find the connection UUID with &amp;quot;nmcli connection show&amp;quot; in terminal.&lt;br /&gt;
# All NetworkManager connection types are supported: wireless, VPN, wired...&lt;br /&gt;
if [ &amp;quot;$2&amp;quot; = &amp;quot;up&amp;quot; ]; then&lt;br /&gt;
  if [ &amp;quot;$CONNECTION_UUID&amp;quot; = &amp;quot;uuid&amp;quot; ]; then&lt;br /&gt;
    mount /your/mount/point &amp;amp; &lt;br /&gt;
    # add more shares as needed&lt;br /&gt;
  fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
The following script will unmount all SMB shares before a software initiated disconnect from a specific network:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/pre-down.d/30-umount-smb.sh|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$CONNECTION_UUID&amp;quot; = &amp;quot;uuid&amp;quot; ]; then&lt;br /&gt;
  umount -a -l -t cifs&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Make sure this script is located in the {{ic|pre-down.d}} sub-directory as shown above, otherwise it will unmount all shares on any connection state change.}}&lt;br /&gt;
&lt;br /&gt;
The following script will attempt to unmount all SMB shares following an unexpected disconnect from a specific network:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/40-umount-smb.sh|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$CONNECTION_UUID&amp;quot; = &amp;quot;uuid&amp;quot; ]; then&lt;br /&gt;
  if [ &amp;quot;$2&amp;quot; = &amp;quot;down&amp;quot; ]; then&lt;br /&gt;
    umount -a -l -t cifs&lt;br /&gt;
  fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* Since NetworkManager 0.9.8, the &#039;&#039;pre-down&#039;&#039; and &#039;&#039;down&#039;&#039; events are not executed on shutdown or restart, see [https://bugzilla.gnome.org/show_bug.cgi?id&amp;amp;#61;701242 this bug report] for more info.&lt;br /&gt;
* The previous &#039;&#039;umount&#039;&#039; scripts are still prone to leaving applications actually accessing the mount to &#039;hang&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
An alternative is to use the script as seen in [[NFS#Using a NetworkManager dispatcher]]:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/30-smb.sh|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
# Find the connection UUID with &amp;quot;nmcli con show&amp;quot; in terminal.&lt;br /&gt;
# All NetworkManager connection types are supported: wireless, VPN, wired...&lt;br /&gt;
WANTED_CON_UUID=&amp;quot;CHANGE-ME-NOW-9c7eff15-010a-4b1c-a786-9b4efa218ba9&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$CONNECTION_UUID&amp;quot; = &amp;quot;$WANTED_CON_UUID&amp;quot; ]; then&lt;br /&gt;
    &lt;br /&gt;
    # Script parameter $1: network interface name, not used&lt;br /&gt;
    # Script parameter $2: dispatched event&lt;br /&gt;
    &lt;br /&gt;
    case &amp;quot;$2&amp;quot; in&lt;br /&gt;
        &amp;quot;up&amp;quot;)&lt;br /&gt;
            mount -a -t cifs&lt;br /&gt;
            ;;&lt;br /&gt;
        &amp;quot;down&amp;quot;|&amp;quot;pre-down&amp;quot;|&amp;quot;vpn-pre-down&amp;quot;)&lt;br /&gt;
            umount -l -a -t cifs &amp;gt;/dev/null&lt;br /&gt;
            ;;&lt;br /&gt;
    esac&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|This script ignores mounts with the {{ic|noauto}} option, remove this mount option or use {{ic|auto}} to allow the dispatcher to manage these mounts.}}&lt;br /&gt;
&lt;br /&gt;
Create a symlink inside {{ic|/etc/NetworkManager/dispatcher.d/pre-down/}} to catch the {{ic|pre-down}} events:&lt;br /&gt;
&lt;br /&gt;
 # ln -s ../30-smb.sh /etc/NetworkManager/dispatcher.d/pre-down.d/30-smb.sh&lt;br /&gt;
&lt;br /&gt;
==== Mounting of NFS shares ====&lt;br /&gt;
&lt;br /&gt;
See [[NFS#Using a NetworkManager dispatcher]].&lt;br /&gt;
&lt;br /&gt;
==== Use dispatcher to automatically toggle wireless depending on LAN cable being plugged in ====&lt;br /&gt;
&lt;br /&gt;
The idea is to only turn Wi-Fi on when the LAN cable is unplugged (for example when detaching from a laptop dock), and for Wi-Fi to be automatically disabled, once a LAN cable is plugged in again.&lt;br /&gt;
&lt;br /&gt;
Create the following dispatcher script[https://superuser.com/questions/233448/disable-wlan-if-wired-cable-network-is-available], replacing {{ic|&#039;&#039;Your_Ethernet_Interface&#039;&#039;}} with your ethernet interface&#039;s device name.&lt;br /&gt;
&lt;br /&gt;
{{Note|You can get a list of interfaces using [[#nmcli examples|nmcli]] ({{ic|nmcli d {{!}} grep ethernet}}). The Ethernet interfaces start with {{ic|en}} or {{ic|eth}}, e.g. {{ic|enp0s5}} or {{ic|eth0}}.}}&lt;br /&gt;
&lt;br /&gt;
Remember to make the script [[executable]]. You can verify that it works by [[restart]]ing {{ic|NetworkManager.service}}, running {{ic|ip a}}, and checking that {{ic|wlp3s0}} (or whatever your Wi-Fi interface is called) is in {{ic|state DOWN}}. If you encounter unexpected behavior, check the [[journal]] of {{ic|NetworkManager-dispatcher.service}}.&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/99-wifi-auto-toggle.sh|2=&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
LOG_PREFIX=&amp;quot;WiFi Auto-Toggle&amp;quot;&lt;br /&gt;
ETHERNET_INTERFACE=&amp;quot;&#039;&#039;Your_Ethernet_Interface&#039;&#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$1&amp;quot; = &amp;quot;$ETHERNET_INTERFACE&amp;quot; ]; then&lt;br /&gt;
    case &amp;quot;$2&amp;quot; in&lt;br /&gt;
        up)&lt;br /&gt;
            echo &amp;quot;$LOG_PREFIX ethernet up&amp;quot;&lt;br /&gt;
            nmcli radio wifi off&lt;br /&gt;
            ;;&lt;br /&gt;
        down)&lt;br /&gt;
            echo &amp;quot;$LOG_PREFIX ethernet down&amp;quot;&lt;br /&gt;
            nmcli radio wifi on&lt;br /&gt;
            ;;&lt;br /&gt;
    esac&lt;br /&gt;
elif [ &amp;quot;$(nmcli -g GENERAL.STATE device show $ETHERNET_INTERFACE)&amp;quot; = &amp;quot;20 (unavailable)&amp;quot; ]; then&lt;br /&gt;
    echo &amp;quot;$LOG_PREFIX failsafe&amp;quot;&lt;br /&gt;
    nmcli radio wifi on&lt;br /&gt;
fi&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|There is a fail-safe for the case when the LAN interface was connected when the computer was last on, and then disconnected while the computer was off. That would mean the radio would still be off when the computer is turned back on, and with a disconnected LAN interface, you would have no network.}}&lt;br /&gt;
&lt;br /&gt;
==== Use dispatcher to connect to a VPN after a network connection is established ====&lt;br /&gt;
&lt;br /&gt;
In this example we want to connect automatically to a previously defined VPN connection after connecting to a specific Wi-Fi network. First thing to do is to create the dispatcher script that defines what to do after we are connected to the network.&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|A scripting without {{ic|iwgetid}} does work too and may be more reliable?|section=Fixes for automatic VPN dispatcher script}}&lt;br /&gt;
&lt;br /&gt;
{{Note|This script will require {{Pkg|wireless_tools}} in order to use {{ic|iwgetid}}.}}&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/vpn-up|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
VPN_NAME=&amp;quot;name of VPN connection defined in NetworkManager&amp;quot;&lt;br /&gt;
ESSID=&amp;quot;Wi-Fi network ESSID (not connection name)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
interface=$1 status=$2&lt;br /&gt;
case $status in&lt;br /&gt;
  up|vpn-down)&lt;br /&gt;
    if iwgetid | grep -qs &amp;quot;:\&amp;quot;$ESSID\&amp;quot;&amp;quot;; then&lt;br /&gt;
      nmcli connection up id &amp;quot;$VPN_NAME&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
    ;;&lt;br /&gt;
  down)&lt;br /&gt;
    if iwgetid | grep -qs &amp;quot;:\&amp;quot;$ESSID\&amp;quot;&amp;quot;; then&lt;br /&gt;
      if nmcli connection show --active | grep &amp;quot;$VPN_NAME&amp;quot;; then&lt;br /&gt;
        nmcli connection down id &amp;quot;$VPN_NAME&amp;quot;&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
    ;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
If you would like to attempt to automatically connect to VPN for all Wi-Fi networks, you can use the following definition of the ESSID: {{ic|1=ESSID=$(iwgetid -r)}}. Remember to set the script&#039;s permissions [[#Network services with NetworkManager dispatcher|accordingly]]. &lt;br /&gt;
&lt;br /&gt;
Trying to connect with the above script may still fail with {{ic|NetworkManager-dispatcher.service}} complaining about &#039;no valid VPN secrets&#039;, because of [https://developer.gnome.org/NetworkManager/0.9/secrets-flags.html the way VPN secrets are stored]. Fortunately, there are different options to give the above script access to your VPN password.&lt;br /&gt;
&lt;br /&gt;
1: One of them requires editing the VPN connection configuration file to make NetworkManager store the secrets by itself rather than inside a keyring [https://bugzilla.redhat.com/show_bug.cgi?id=710552 that will be inaccessible for root]: open up {{ic|/etc/NetworkManager/system-connections/&#039;&#039;name of your VPN connection&#039;&#039;.nmconnection}} and change the {{ic|password-flags}} and {{ic|secret-flags}} from {{ic|1}} to {{ic|0}}.&lt;br /&gt;
&lt;br /&gt;
If that alone does not work, you may have to create a {{ic|passwd-file}} in a safe location with the same permissions and ownership as the dispatcher script, containing the following:&lt;br /&gt;
&lt;br /&gt;
{{hc|/path/to/passwd-file|&lt;br /&gt;
vpn.secrets.password:YOUR_PASSWORD&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The script must be changed accordingly, so that it gets the password from the file:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/vpn-up|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
VPN_NAME=&amp;quot;name of VPN connection defined in NetworkManager&amp;quot;&lt;br /&gt;
ESSID=&amp;quot;Wi-Fi network ESSID (not connection name)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
interface=$1 status=$2&lt;br /&gt;
case $status in&lt;br /&gt;
  up|vpn-down)&lt;br /&gt;
    if iwgetid | grep -qs &amp;quot;:\&amp;quot;$ESSID\&amp;quot;&amp;quot;; then&lt;br /&gt;
      nmcli connection up id &amp;quot;$VPN_NAME&amp;quot; passwd-file /path/to/passwd-file&lt;br /&gt;
    fi&lt;br /&gt;
    ;;&lt;br /&gt;
  down)&lt;br /&gt;
    if iwgetid | grep -qs &amp;quot;:\&amp;quot;$ESSID\&amp;quot;&amp;quot;; then&lt;br /&gt;
      if nmcli connection show --active | grep &amp;quot;$VPN_NAME&amp;quot;; then&lt;br /&gt;
        nmcli connection down id &amp;quot;$VPN_NAME&amp;quot;&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
    ;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
2: Alternatively, change the {{ic|password-flags}} and put the password directly in the configuration file adding the section {{ic|vpn-secrets}}:&lt;br /&gt;
&lt;br /&gt;
  [vpn]&lt;br /&gt;
  ....&lt;br /&gt;
  password-flags=0&lt;br /&gt;
  &lt;br /&gt;
  [vpn-secrets]&lt;br /&gt;
  password=&#039;&#039;your_password&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{Note|It may now be necessary to re-open the NetworkManager connection editor and save the VPN passwords/secrets again.}}&lt;br /&gt;
&lt;br /&gt;
==== Use dispatcher to disable IPv6 on VPN provider connections ====&lt;br /&gt;
&lt;br /&gt;
Many [[:Category:VPN providers|commercial VPN providers]] support only IPv4. That means all IPv6 traffic bypasses the VPN and renders it virtually useless. To avoid this, dispatcher can be used to disable all IPv6 traffic for the time a VPN connection is up.&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/10-vpn-ipv6|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$2&amp;quot; in&lt;br /&gt;
	vpn-up)&lt;br /&gt;
		echo 1 &amp;gt; /proc/sys/net/ipv6/conf/all/disable_ipv6&lt;br /&gt;
		;;&lt;br /&gt;
	vpn-down)&lt;br /&gt;
		echo 0 &amp;gt; /proc/sys/net/ipv6/conf/all/disable_ipv6&lt;br /&gt;
		;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Note|The above script does not work for WireGuard since NetworkManager does not send the {{ic|vpn-up/down}} events for it. Instead you have to rely on generic events for your WireGuard interfaces as demonstrated in [https://gist.github.com/TheDcoder/85e1ec99a31180e20ba8e4896024f265].}}&lt;br /&gt;
&lt;br /&gt;
As an alternative, dispatcher can be used to temporarily set the IPv6 mode of the device used by the VPN connection to {{ic|link-local}}. This will avoid NetworkManager log spam about IPv6 being disabled. This script will not work if multiple devices or connections provide IPv6 connectivity, but could be adapted to iterate over multiple devices. Note that any change to the connection (using {{man|1|nmcli}} or a [[desktop environment]]) will reapply the entire connection to the device and re-enable IPv6 (if it is enabled in the connection).&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/10-vpn-ipv6|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$2&amp;quot; in&lt;br /&gt;
	vpn-up)&lt;br /&gt;
		nmcli device modify &amp;quot;${DEVICE_IFACE}&amp;quot; ipv6.method link-local&lt;br /&gt;
		;;&lt;br /&gt;
	vpn-down)&lt;br /&gt;
		nmcli device reapply &amp;quot;${DEVICE_IFACE}&amp;quot;&lt;br /&gt;
		;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
==== OpenNTPD ====&lt;br /&gt;
&lt;br /&gt;
See [[OpenNTPD#Using NetworkManager dispatcher]].&lt;br /&gt;
&lt;br /&gt;
==== Dynamically set NTP servers received via DHCP with systemd-timesyncd ====&lt;br /&gt;
&lt;br /&gt;
When roaming between different networks (e.g. a company&#039;s LAN, Wi-Fi at home, various other Wi-Fi now and then) you might want to set the NTP server(s) used by timesyncd to those provided by DHCP. However, NetworkManager itself is not capable to communicate with systemd-timesyncd to set the NTP server(s).&lt;br /&gt;
&lt;br /&gt;
The dispatcher can work around it. &lt;br /&gt;
&lt;br /&gt;
[[Create]] the overlay directory for your systemd-timesyncd configuration {{ic|/etc/systemd/timesyncd.conf.d}} if it does not already exist. Inside {{ic|/etc/NetworkManager/dispatcher.d}}, put the following: &lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/dispatcher.d/10-update-timesyncd|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
[ -z &amp;quot;$CONNECTION_UUID&amp;quot; ] &amp;amp;&amp;amp; exit 0&lt;br /&gt;
INTERFACE=&amp;quot;$1&amp;quot;&lt;br /&gt;
ACTION=&amp;quot;$2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
case $ACTION in&lt;br /&gt;
up | dhcp4-change | dhcp6-change)&lt;br /&gt;
	# `DHCP6_DHCP6_NTP_SERVERS` with double `DHCP6` is the correct variable name as varified by `printenv` as of NetworkManager 1.56.0-1&lt;br /&gt;
	set -- ${DHCP6_DHCP6_NTP_SERVERS-} ${DHCP4_NTP_SERVERS-}&lt;br /&gt;
	servers=$*&lt;br /&gt;
	[ -n &amp;quot;$servers&amp;quot; ] || exit 0&lt;br /&gt;
	mkdir -p /etc/systemd/timesyncd.conf.d&lt;br /&gt;
	cat &amp;lt;&amp;lt;-THE_END &amp;gt;&amp;quot;/etc/systemd/timesyncd.conf.d/${CONNECTION_UUID}.conf&amp;quot;&lt;br /&gt;
		[Time]&lt;br /&gt;
		NTP=$servers&lt;br /&gt;
	THE_END&lt;br /&gt;
	systemctl restart systemd-timesyncd.service&lt;br /&gt;
	;;&lt;br /&gt;
down)&lt;br /&gt;
	rm -f &amp;quot;/etc/systemd/timesyncd.conf.d/${CONNECTION_UUID}.conf&amp;quot;&lt;br /&gt;
	systemctl restart systemd-timesyncd.service&lt;br /&gt;
	;;&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Every time NetworkManager sets up a new network connection ({{ic|1=ACTION=up}}) or gets some update for an existing connection ({{ic|1=ACTION=dhcp4-change}} or {{ic|1=ACTION=dhcp6-change}}) and the provided connection data contains information about NTP server(s) ({{ic|DHCP6_DHCP6_NTP_SERVERS}} and {{ic|DHCP4_NTP_SERVERS}}), a connection specific overlay configuration file is written to {{ic|/etc/systemd/timesyncd.conf.d}}, containing the provided NTP server(s). Whenever a connection is taken down ({{ic|1=ACTION=down}}) the connection specific overlay file is removed. After each change to the configuration of systemd-timesyncd, this service is restarted to pick up the updated configuration. The use of connection specific configuration files is intentional so that when two or more connections are managed by NetworkManager in parallel the different NTP server names in the configuration are not overwritten as {{ic|up}}, {{ic|dhcp4-change}}, {{ic|dhcp6-change}} and {{ic|down}} actions might come in an arbitrary order.&lt;br /&gt;
&lt;br /&gt;
{{Note|{{ic|1=DHCP6_DHCP6_NTP_SERVERS}} with double {{ic|1=DHCP6}} is the correct variable name as varified by {{ic|1=printenv}} as of NetworkManager 1.56.0-1 }}&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
NetworkManager applets are designed to load upon login so no further configuration should be necessary for most users.  If you have already disabled your previous network settings and disconnected from your network, you can now test if NetworkManager will work. The first step is to [[start]] {{ic|NetworkManager.service}}.&lt;br /&gt;
&lt;br /&gt;
Some applets will provide you with a {{ic|.desktop}} file so that the NetworkManager applet can be loaded through the application menu.  If it does not, you are going to either have to discover the command to use or logout and login again to start the applet.  Once the applet is started, it will likely begin polling network connections with for auto-configuration with a DHCP server.&lt;br /&gt;
&lt;br /&gt;
To start the GNOME applet in non-xdg-compliant window managers like [[awesome]]:&lt;br /&gt;
&lt;br /&gt;
 nm-applet --sm-disable &amp;amp;&lt;br /&gt;
&lt;br /&gt;
For static IP addresses, you will have to configure NetworkManager to understand them.  The process usually involves right-clicking the applet and selecting something like &#039;Edit Connections&#039;.&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Encrypted Wi-Fi passwords ===&lt;br /&gt;
&lt;br /&gt;
By default, NetworkManager stores passwords in clear text in the connection files at {{ic|/etc/NetworkManager/system-connections/}}. To print the stored passwords, use the following command:&lt;br /&gt;
&lt;br /&gt;
 # grep -r &#039;^psk=&#039; /etc/NetworkManager/system-connections/&lt;br /&gt;
&lt;br /&gt;
The passwords are accessible to the root user in the filesystem and to users with access to settings via the GUI (e.g. {{ic|nm-applet}}).&lt;br /&gt;
&lt;br /&gt;
It is preferable to save the passwords in encrypted form in a keyring instead of clear text. The downside to this is that the connections have to be set up for each user.&lt;br /&gt;
&lt;br /&gt;
In order to read and write to the keyring, there must be a secret agent available. This can be one of:&lt;br /&gt;
&lt;br /&gt;
* {{ic|nmcli}} with the {{ic|--ask}} option&lt;br /&gt;
* One of the graphical interfaces from [[#Front-ends]]&lt;br /&gt;
&lt;br /&gt;
If you make neither of these available, then authentication will fail with the error {{ic|no secrets: No agents were available for this request.}}&lt;br /&gt;
&lt;br /&gt;
==== Using GNOME Keyring ====&lt;br /&gt;
&lt;br /&gt;
The keyring daemon has to be started and the keyring needs to be unlocked for the following to work.&lt;br /&gt;
&lt;br /&gt;
Furthermore, NetworkManager needs to be configured not to store the password for all users. Using GNOME&#039;s {{Pkg|network-manager-applet}}, run {{ic|nm-connection-editor}} from a terminal, select a network connection, click &#039;&#039;Edit&#039;&#039;, select the &#039;&#039;Wi-Fi Security&#039;&#039; tab and click on the right icon of password and check &#039;&#039;Store the password only for this user&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Using KDE Wallet ====&lt;br /&gt;
&lt;br /&gt;
Using KDE&#039;s {{Pkg|plasma-nm}}, click the applet, click on the top right &#039;&#039;Settings&#039;&#039; icon, click on a network connection, in the &#039;&#039;General configuration&#039;&#039; tab, untick &#039;&#039;All users may connect to this network&#039;&#039;. If the option is ticked, the passwords will still be stored in clear text, even if a keyring daemon is running.&lt;br /&gt;
&lt;br /&gt;
If the option was selected previously and you un-tick it, you may have to use the {{ic|reset}} option first to make the password disappear from the file. Alternatively, delete the connection first and set it up again.&lt;br /&gt;
&lt;br /&gt;
=== Sharing internet connection over Wi-Fi ===&lt;br /&gt;
&lt;br /&gt;
You can share your internet connection (e.g. 3G or wired) with a few clicks.  Please note that a [[firewall]] may interfere with internet sharing.&lt;br /&gt;
&lt;br /&gt;
You will need a Wi-Fi card which supports AP mode, see [[Software access point#Wi-Fi device must support AP mode]] for details.&lt;br /&gt;
&lt;br /&gt;
[[Install]] the {{Pkg|dnsmasq}} package to be able to actually share the connection. Note that NetworkManager starts its own instance of &#039;&#039;dnsmasq&#039;&#039;, independent of {{ic|dnsmasq.service}}, as a DHCP server. See [[#dnsmasq]] for the caveats.&lt;br /&gt;
&lt;br /&gt;
Create the shared connection:&lt;br /&gt;
&lt;br /&gt;
* Click on applet and choose &#039;&#039;Create new wireless network&#039;&#039;.&lt;br /&gt;
* Follow wizard (choose WPA2 or higher, be sure to use at least 8 character long password, lower lengths will fail).&lt;br /&gt;
** Choose either [[Fedora:Features/RealHotspot|Hotspot]] or Ad-hoc as Wi-Fi mode.&lt;br /&gt;
&lt;br /&gt;
The connection will be saved and remain stored for the next time you need it.&lt;br /&gt;
&lt;br /&gt;
{{Note|Android does not support connecting to Ad-hoc networks. To share a connection with Android use infrastructure mode (i.e. set Wi-Fi mode to &amp;quot;Hotspot&amp;quot;).}}&lt;br /&gt;
&lt;br /&gt;
=== Sharing internet connection over Ethernet ===&lt;br /&gt;
&lt;br /&gt;
Scenario: your device has internet connection over Wi-Fi and you want to share the internet connection to other devices over Ethernet.&lt;br /&gt;
&lt;br /&gt;
Requirements:&lt;br /&gt;
&lt;br /&gt;
* [[Install]] the {{Pkg|dnsmasq}} and {{Pkg|nm-connection-editor}} packages to be able to actually share the connection. Note that NetworkManager starts its own instance of &#039;&#039;dnsmasq&#039;&#039;, independent of {{ic|dnsmasq.service}}, as a DHCP server. See [[#dnsmasq]] for the caveats.&lt;br /&gt;
* Your internet connected device and the other devices are connected over a suitable Ethernet cable (this usually means a cross over cable or a switch in between).&lt;br /&gt;
* Internet sharing is not blocked by a [[firewall]].&lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
&lt;br /&gt;
* Run {{ic|nm-connection-editor}} from terminal.&lt;br /&gt;
* Add a new Ethernet connection.&lt;br /&gt;
* Give it some sensible name. For example &amp;quot;Shared Internet&amp;quot;&lt;br /&gt;
* Go to &amp;quot;IPv4 Settings&amp;quot;.&lt;br /&gt;
* For &amp;quot;Method:&amp;quot; select &amp;quot;Shared to other computers&amp;quot;.&lt;br /&gt;
* Save&lt;br /&gt;
&lt;br /&gt;
Now you should have a new option &amp;quot;Shared Internet&amp;quot; under the Wired connections in NetworkManager.&lt;br /&gt;
&lt;br /&gt;
=== Checking if networking is up inside a cron job or script ===&lt;br /&gt;
&lt;br /&gt;
{{Out of date|&#039;&#039;nm-tool&#039;&#039; was removed from NetworkManager for long time now[https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commit/bb8c75bd536d4f8fb80a4366025a279078f0ec81]. &#039;&#039;nmcli&#039;&#039; should be used instead.}}&lt;br /&gt;
&lt;br /&gt;
Some &#039;&#039;cron&#039;&#039; jobs require networking to be up to succeed. You may wish to avoid running these jobs when the network is down. To accomplish this, add an &#039;&#039;&#039;if&#039;&#039;&#039; test for networking that queries NetworkManager&#039;s &#039;&#039;nm-tool&#039;&#039; and checks the state of networking. The test shown here succeeds if any interface is up, and fails if they are all down. This is convenient for laptops that might be hardwired, might be on wireless, or might be off the network.&lt;br /&gt;
&lt;br /&gt;
{{bc|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
if [ $(nm-tool|grep State|cut -f2 -d&#039; &#039;) == &amp;quot;connected&amp;quot; ]; then&lt;br /&gt;
    #Whatever you want to do if the network is online&lt;br /&gt;
else&lt;br /&gt;
    #Whatever you want to do if the network is offline - note, this and the else above are optional&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
This is useful for a {{ic|cron.hourly}} script that runs &#039;&#039;fpupdate&#039;&#039; for the F-Prot virus scanner signature update, as an example. Another way it might be useful, with a little modification, is to differentiate between networks using various parts of the output from &#039;&#039;nm-tool&#039;&#039;; for example, since the active wireless network is denoted with an asterisk, you could grep for the network name and then grep for a literal asterisk.&lt;br /&gt;
&lt;br /&gt;
=== Connect to network with secret on boot ===&lt;br /&gt;
&lt;br /&gt;
By default, NetworkManager will not connect to networks requiring a secret automatically on boot. This is because it locks such connections to the user who makes it by default, only connecting after they have logged in. To change this, do the following:&lt;br /&gt;
&lt;br /&gt;
# Right click on the {{ic|nm-applet}} icon in your panel and select Edit Connections and open the Wireless tab&lt;br /&gt;
# Select the connection you want to work with and click the Edit button&lt;br /&gt;
# Check the boxes “Connect Automatically” and “Available to all users”&lt;br /&gt;
# Additionally, ensure that under &amp;quot;Wi-Fi Security&amp;quot;, &amp;quot;Store password for all users (not encrypted)&amp;quot; is selected&lt;br /&gt;
&lt;br /&gt;
Log out and log back in to complete.&lt;br /&gt;
&lt;br /&gt;
=== OpenConnect with password in KWallet ===&lt;br /&gt;
&lt;br /&gt;
While you may type both values at connection time, {{Pkg|plasma-nm}} 0.9.3.2-1 and above are capable of retrieving OpenConnect username and password directly from [[KWallet]].&lt;br /&gt;
&lt;br /&gt;
Open &amp;quot;KDE Wallet Manager&amp;quot; and look up your OpenConnect VPN connection under &amp;quot;Network Management|Maps&amp;quot;. Click &amp;quot;Show values&amp;quot; and &lt;br /&gt;
enter your credentials in key &amp;quot;VpnSecrets&amp;quot; in this form (replace &#039;&#039;username&#039;&#039; and &#039;&#039;password&#039;&#039; accordingly):&lt;br /&gt;
&lt;br /&gt;
 form:main:username%SEP%&#039;&#039;username&#039;&#039;%SEP%form:main:password%SEP%&#039;&#039;password&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Next time you connect, username and password should appear in the &amp;quot;VPN secrets&amp;quot; dialog box.&lt;br /&gt;
&lt;br /&gt;
=== Ignore specific devices ===&lt;br /&gt;
&lt;br /&gt;
Sometimes it may be desired that NetworkManager ignores specific devices and does not try to configure addresses and routes for them. You can quickly and easily ignore devices by MAC or interface-name by using the following in {{ic|/etc/NetworkManager/conf.d/unmanaged.conf}}:&lt;br /&gt;
&lt;br /&gt;
 [keyfile]&lt;br /&gt;
 unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth0&lt;br /&gt;
&lt;br /&gt;
After editing the file, run {{ic|nmcli general reload}} as root. Afterwards you should be able to configure interfaces without NetworkManager altering what you have set.&lt;br /&gt;
&lt;br /&gt;
=== Configuring MAC address randomization ===&lt;br /&gt;
&lt;br /&gt;
{{Merge|NetworkManager/Privacy#MAC Randomization|There is a dedicated sub-page for Privacy now.}}&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|The [[iwd]] backend reportedly refuses MAC address randomisation due to open issues, and entry in [[iwd#Troubleshooting]] with link might be suitable to account for it; see:|section=iwd backend doesn&#039;t support mac spoofing}}&lt;br /&gt;
&lt;br /&gt;
{{Note|1=Disabling MAC address randomization may be needed to get (stable) link connection [https://bbs.archlinux.org/viewtopic.php?id=220101] and/or networks that restrict devices based on their MAC Address or have a limit network capacity.}}&lt;br /&gt;
&lt;br /&gt;
{{Note| See [[#Using iwd as the Wi-Fi backend]] for iwd specific MAC randomization.}}&lt;br /&gt;
&lt;br /&gt;
MAC randomization can be used for increased privacy by not disclosing your real MAC address to the network.&lt;br /&gt;
&lt;br /&gt;
NetworkManager supports two types MAC Address Randomization: randomization during scanning, and for network connections. Both modes can be configured by modifying {{ic|/etc/NetworkManager/NetworkManager.conf}} or by creating a separate configuration file in {{ic|/etc/NetworkManager/conf.d/}} which is recommended since the aforementioned configuration file may be overwritten by NetworkManager.&lt;br /&gt;
&lt;br /&gt;
Randomization during Wi-Fi scanning is enabled by default, but it may be disabled by adding the following lines to {{ic|/etc/NetworkManager/NetworkManager.conf}} or a dedicated configuration file under {{ic|/etc/NetworkManager/conf.d}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/wifi_rand_mac.conf|2=&lt;br /&gt;
[device]&lt;br /&gt;
wifi.scan-rand-mac-address=no&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
MAC randomization for network connections can be set to different modes for both wireless and ethernet interfaces. See the [https://blogs.gnome.org/thaller/2016/08/26/mac-address-spoofing-in-networkmanager-1-4-0/ GNOME blog post] for more details on the different modes. &lt;br /&gt;
&lt;br /&gt;
In terms of MAC randomization the most important modes are {{ic|stable}} and {{ic|random}}. {{ic|stable}} generates a random MAC address when you connect to a new network and associates the two permanently. This means that you will use the same MAC address every time you connect to that network. In contrast, {{ic|random}} will generate a new MAC address every time you connect to a network, new or previously known. You can configure the MAC randomization by adding the desired configuration under {{ic|/etc/NetworkManager/conf.d}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/wifi_rand_mac.conf|2=&lt;br /&gt;
[device-mac-randomization]&lt;br /&gt;
# &amp;quot;yes&amp;quot; is already the default for scanning&lt;br /&gt;
wifi.scan-rand-mac-address=yes&lt;br /&gt;
 &lt;br /&gt;
[connection-mac-randomization]&lt;br /&gt;
# Randomize MAC for every ethernet connection&lt;br /&gt;
ethernet.cloned-mac-address=random&lt;br /&gt;
# Generate a random MAC for each Wi-Fi and associate the two permanently.&lt;br /&gt;
wifi.cloned-mac-address=stable&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To configure MAC randomization for a specific connection (for example, if the network does not like random MAC addresses), [[#Edit a connection|edit the connection]] to set {{ic|802-11-wireless.cloned-mac-address}} to one of the modes (e.g. {{ic|stable}} or {{ic|random}}).&lt;br /&gt;
&lt;br /&gt;
See the following [https://blogs.gnome.org/thaller/2016/08/26/mac-address-spoofing-in-networkmanager-1-4-0/ GNOME blog post] for more details.&lt;br /&gt;
&lt;br /&gt;
=== Turn off hostname sending ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager by default sends the hostname to the DHCP server.&lt;br /&gt;
&lt;br /&gt;
To disable sending your hostname to the DHCP server globally, set the {{ic|ipv4.dhcp-send-hostname{{=}}0}} and {{ic|ipv6.dhcp-send-hostname{{=}}0}} options with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}. E.g.:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/dhcp-send-hostname.conf|2=&lt;br /&gt;
[connection]&lt;br /&gt;
ipv4.dhcp-send-hostname=0&lt;br /&gt;
ipv6.dhcp-send-hostname=0&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To disable sending your hostname to the DHCP server for a specific connection (or alternatively, enable it for a connection if it is disabled globally), add the following to your network connection file:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/system-connections/&#039;&#039;your_connection_file&#039;&#039;.nmconnection|2=&lt;br /&gt;
...&lt;br /&gt;
[ipv4]&lt;br /&gt;
dhcp-send-hostname=false&lt;br /&gt;
...&lt;br /&gt;
[ipv6]&lt;br /&gt;
dhcp-send-hostname=false&lt;br /&gt;
...&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|These options are only honored by the default [[#DHCP client|internal DHCP client]]. To omit sending the hostname when using NetworkManager with dhcpcd, edit {{ic|/etc/dhcpcd.conf}} and insert {{ic|anonymous}} as the last line.}}&lt;br /&gt;
&lt;br /&gt;
=== Enable IPv6 Privacy Extensions ===&lt;br /&gt;
&lt;br /&gt;
See [[IPv6#NetworkManager]].&lt;br /&gt;
&lt;br /&gt;
=== Configure a unique DUID per connection ===&lt;br /&gt;
&lt;br /&gt;
The DHCPv6 Unique Identifier (DUID) is a value used by the DHCPv6 client to identify itself to DHCPv6 servers. NetworkManager supports 3 types of DUID:&lt;br /&gt;
&lt;br /&gt;
* DUID-UUID ([[RFC:6355|RFC 6355]]): generated from an Universally Unique IDentifier (UUID).&lt;br /&gt;
* DUID-LL ([[RFC:3315|RFC 3315]]): generated from the Link-Layer address (a.k.a. MAC address).&lt;br /&gt;
* DUID-LLT ([[RFC:3315|RFC 3315]]): generated from the Link-Layer address plus a timestamp.&lt;br /&gt;
&lt;br /&gt;
If the internal NetworkManager&#039;s DHCP client is in use (the default) it will identify itself with a global and permanent DUID-UUID generated from the machine-id ({{ic|/etc/machine-id}}). This means that all connections share the same UUID, which may be a privacy breach.&lt;br /&gt;
&lt;br /&gt;
Fortunately, NetworkManager is able to provide unique DUIDs per connection, derived from the connection&#039;s stable-id and a per-host unique key. You can enable that by adding the following configuration under {{ic|/etc/NetworkManager/conf.d}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/duid.conf|2=&lt;br /&gt;
[connection]&lt;br /&gt;
ipv6.dhcp-duid=stable-uuid&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The {{ic|stable-ll}} and {{ic|stable-llt}} values are also supported. For further information read the description for {{ic|dhcp-duid}} in {{man|5|nm-settings|ipv6 setting}}.&lt;br /&gt;
&lt;br /&gt;
=== Working with wired connections ===&lt;br /&gt;
&lt;br /&gt;
By default, NetworkManager generates a connection profile for each wired ethernet connection it finds. At the point when generating the connection, it does not know whether there will be more Ethernet adapters available. Hence, it calls the first wired connection &amp;quot;Wired connection 1&amp;quot;. You can avoid generating this connection, by configuring {{ic|no-auto-default}} (see {{man|5|NetworkManager.conf}}), or by simply deleting it. Then NetworkManager will remember not to generate a connection for this interface again.&lt;br /&gt;
&lt;br /&gt;
You can also edit the connection (and persist it to disk) or delete it. NetworkManager will not re-generate a new connection. Then you can change the name to whatever you want. You can use something like {{Pkg|nm-connection-editor}} for this task.&lt;br /&gt;
&lt;br /&gt;
=== Using iwd as the Wi-Fi backend ===&lt;br /&gt;
&lt;br /&gt;
{{Note|1=&amp;lt;nowiki/&amp;gt;&lt;br /&gt;
* Do not enable {{ic|iwd.service}} or manually configure [[iwd]]. NetworkManager will start and manage it itself.&lt;br /&gt;
* Consider [https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues?scope=all&amp;amp;utf8=%E2%9C%93&amp;amp;state=opened&amp;amp;search=iwd existing issues] before switching to &#039;&#039;iwd&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
To enable the [https://archive.kernel.org/oldwiki/iwd.wiki.kernel.org/networkmanager.html experimental iwd backend], first [[install]] {{Pkg|iwd}} and then create the following configuration file:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/wifi_backend.conf|2=&lt;br /&gt;
[device]&lt;br /&gt;
wifi.backend=iwd&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To use MAC randomization with iwd see [[MAC address spoofing#iwd]].&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can install {{AUR|networkmanager-iwd}}, a modified package configured to build &#039;&#039;NetworkManager&#039;&#039; working exclusively with &#039;&#039;iwd&#039;&#039;, with the main difference being that &#039;&#039;iwd&#039;&#039; is required and &#039;&#039;wpa_supplicant&#039;&#039; can be uninstalled after building.&lt;br /&gt;
&lt;br /&gt;
{{Note|1=You may need to [https://archive.kernel.org/oldwiki/iwd.wiki.kernel.org/networkmanager.html#converting_network_profiles convert existing NetworkManager network profiles] after switching to &#039;&#039;iwd&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
=== Running in a network namespace ===&lt;br /&gt;
&lt;br /&gt;
If you would like to run NetworkManager inside a network namespace (e.g., to manage a specific device which should be used by selected applications), bring the device down before moving it to the namespace:&lt;br /&gt;
&lt;br /&gt;
 $ ip link set dev &#039;&#039;MY_DEVICE&#039;&#039; down&lt;br /&gt;
 $ ip link set dev &#039;&#039;MY_DEVICE&#039;&#039; netns &#039;&#039;MY_NAMESPACE&#039;&#039;&lt;br /&gt;
 $ ip netns exec &#039;&#039;MY_NAMESPACE&#039;&#039; NetworkManager&lt;br /&gt;
 ...&lt;br /&gt;
 $ ip netns exec &#039;&#039;MY_NAMESPACE&#039;&#039; killall NetworkManager&lt;br /&gt;
&lt;br /&gt;
otherwise NetworkManager will later fail to establish the connection with a {{ic|device is strictly unmanaged}} error.&lt;br /&gt;
&lt;br /&gt;
=== Automatically connect to VPN ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager can be set to automatically connect to a VPN when connecting to the internet, on a per network basis. The VPN connection itself can be added in GNOME&#039;s NetworkManager front-end, but to make it automatically use the VPN {{ic|nmcli}} must be used. Other front-ends might not have this limitation.&lt;br /&gt;
&lt;br /&gt;
First, make sure to make the VPN connection available to all users. In the GNOME this is a matter of checking a box under the {{ic|details}} tab. Under the {{ic|Identity}} tab, in the password field, click the icon on the right side in the field, and set it to {{ic|Store the password for all users}}.&lt;br /&gt;
&lt;br /&gt;
Then find the UUID of the VPN connection, and add that to {{ic|connection.secondaries}} of the Internet connection:&lt;br /&gt;
&lt;br /&gt;
 # UUID=$(nmcli --get-values connection.uuid connection show &#039;&#039;name-of-VPN-connection&#039;&#039;)&lt;br /&gt;
 # nmcli connection modify &#039;&#039;name-of-Internet-connection&#039;&#039; connection.secondaries &amp;quot;$UUID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now when NetworkManager is restarted and you connect to the Internet connection you have configured, you should automatically get connected to the VPN.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== No prompt for password of secured Wi-Fi networks ===&lt;br /&gt;
&lt;br /&gt;
When trying to connect to a secured Wi-Fi network, no prompt for a password is shown and no connection is established. This happens when no keyring package is installed. An easy solution is to install {{Pkg|gnome-keyring}}. If you want the passwords to be stored in encrypted form, follow [[GNOME Keyring]] to set up the &#039;&#039;gnome-keyring-daemon&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Network management disabled ===&lt;br /&gt;
&lt;br /&gt;
When NetworkManager shuts down but the pid (state) file is not removed, you will see a {{ic|Network management disabled}} message. If this happens, remove the file manually:&lt;br /&gt;
&lt;br /&gt;
 # rm /var/lib/NetworkManager/NetworkManager.state&lt;br /&gt;
&lt;br /&gt;
=== Problems with internal DHCP client ===&lt;br /&gt;
&lt;br /&gt;
If you have problems with getting an IP address using the internal DHCP client, consider using another DHCP client, see [[#DHCP client]] for instructions. This workaround might solve problems in big wireless networks like eduroam.&lt;br /&gt;
&lt;br /&gt;
=== DHCP problems with dhclient ===&lt;br /&gt;
&lt;br /&gt;
If you have problems with getting an IP address via DHCP, try to add the following to your {{ic|/etc/dhclient.conf}}:&lt;br /&gt;
&lt;br /&gt;
  interface &amp;quot;eth0&amp;quot; {&lt;br /&gt;
    send dhcp-client-identifier 01:&#039;&#039;aa:bb:cc:dd:ee:ff&#039;&#039;;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Where {{ic|&#039;&#039;aa:bb:cc:dd:ee:ff&#039;&#039;}} is the MAC address of this NIC. The MAC address can be found using the {{ic|ip link show &#039;&#039;interface&#039;&#039;}} command from the {{Pkg|iproute2}} package.&lt;br /&gt;
&lt;br /&gt;
=== 3G modem not detected ===&lt;br /&gt;
&lt;br /&gt;
See [[Mobile broadband modem#NetworkManager]].&lt;br /&gt;
&lt;br /&gt;
=== Switching off WLAN on laptops ===&lt;br /&gt;
&lt;br /&gt;
Sometimes NetworkManager will not work when you disable your Wi-Fi adapter with a switch on your laptop and try to enable it again afterwards. This is often a problem with &#039;&#039;rfkill&#039;&#039;. To check if the driver notifies &#039;&#039;rfkill&#039;&#039; about the wireless adapter&#039;s status, use:&lt;br /&gt;
&lt;br /&gt;
 $ watch -n1 rfkill list all&lt;br /&gt;
&lt;br /&gt;
If one identifier stays blocked after you switch on the adapter you could try to manually unblock it with (where X is the number of the identifier provided by the above output):&lt;br /&gt;
&lt;br /&gt;
 # rfkill event unblock X&lt;br /&gt;
&lt;br /&gt;
=== Static IP address settings revert to DHCP ===&lt;br /&gt;
&lt;br /&gt;
{{Out of date|This section is [[Special:Diff/119236|added in 2010]] and describes an ancient version of &#039;&#039;nm-applet&#039;&#039;. Is this still relevant in 2024?}}&lt;br /&gt;
&lt;br /&gt;
Due to an unresolved bug, when changing default connections to a static IP address, {{ic|nm-applet}} may not properly store the configuration change, and will revert to automatic DHCP.&lt;br /&gt;
&lt;br /&gt;
To work around this issue you have to edit the default connection (e.g. &amp;quot;Auto eth0&amp;quot;) in {{ic|nm-applet}}, change the connection name (e.g. &amp;quot;my eth0&amp;quot;), uncheck the &amp;quot;Available to all users&amp;quot; checkbox, change your static IP address settings as desired, and click &#039;&#039;&#039;Apply&#039;&#039;&#039;.  This will save a new connection with the given name.&lt;br /&gt;
&lt;br /&gt;
Next, you will want to make the default connection not connect automatically.  To do so, run {{ic|nm-connection-editor}} (&#039;&#039;&#039;not&#039;&#039;&#039; as root). In the connection editor, edit the default connection (e.g. &amp;quot;Auto eth0&amp;quot;) and uncheck &amp;quot;Connect automatically&amp;quot;.  Click &#039;&#039;&#039;Apply&#039;&#039;&#039; and close the connection editor.&lt;br /&gt;
&lt;br /&gt;
=== Cannot edit connections as normal user ===&lt;br /&gt;
&lt;br /&gt;
See [[#Set up PolicyKit permissions]].&lt;br /&gt;
&lt;br /&gt;
=== Forget hidden wireless network ===&lt;br /&gt;
&lt;br /&gt;
Since hidden networks are not displayed in the selection list of the Wireless view, they cannot be forgotten (removed) with the GUI. You can delete one with the following command:&lt;br /&gt;
&lt;br /&gt;
 # rm /etc/NetworkManager/system-connections/&#039;&#039;SSID&#039;&#039;.nmconnection&lt;br /&gt;
&lt;br /&gt;
This also works for any other connection.&lt;br /&gt;
&lt;br /&gt;
=== VPN not working in GNOME ===&lt;br /&gt;
&lt;br /&gt;
When setting up OpenConnect or vpnc connections in NetworkManager while using GNOME, you will sometimes never see the dialog box pop up and the following error appears in {{ic|/var/log/errors.log}}:&lt;br /&gt;
&lt;br /&gt;
 localhost NetworkManager[399]: &amp;lt;error&amp;gt; [1361719690.10506] [nm-vpn-connection.c:1405] get_secrets_cb(): Failed to request VPN secrets #3: (6) No agents were available for this request.&lt;br /&gt;
&lt;br /&gt;
This is caused by the GNOME NetworkManager Applet expecting dialog scripts to be at {{ic|/usr/lib/gnome-shell}}, when NetworkManager&#039;s packages put them in {{ic|/usr/lib/networkmanager}}.&lt;br /&gt;
As a &amp;quot;temporary&amp;quot; fix (this bug has been around for a while now), make the following symlink(s):&lt;br /&gt;
&lt;br /&gt;
* For OpenConnect: {{ic|ln -s /usr/lib/nm-openconnect-auth-dialog /usr/lib/gnome-shell/}}&lt;br /&gt;
* For VPNC (i.e. Cisco VPN): {{ic|ln -s /usr/lib/nm-vpnc-auth-dialog /usr/lib/gnome-shell/}}&lt;br /&gt;
&lt;br /&gt;
This may need to be done for any other NetworkManager VPN plugins as well, but these are the two most common.&lt;br /&gt;
&lt;br /&gt;
=== Unable to connect to visible European wireless networks ===&lt;br /&gt;
&lt;br /&gt;
WLAN chips are shipped with a default [[Wireless network configuration#Respecting the regulatory domain|regulatory domain]]. If your access point does not operate within these limitations, you will not be able to connect to the network. Fixing this is easy:&lt;br /&gt;
&lt;br /&gt;
# [[Install]] {{Pkg|wireless-regdb}}.&lt;br /&gt;
# Uncomment the correct country code in {{ic|/etc/conf.d/wireless-regdom}}.&lt;br /&gt;
# Reboot the system, because the setting is only read on boot.&lt;br /&gt;
&lt;br /&gt;
=== Automatic connect to VPN on boot is not working ===&lt;br /&gt;
&lt;br /&gt;
The problem occurs when the system (i.e. NetworkManager running as the root user) tries to establish a VPN connection, but the password is not accessible because it is stored in the GNOME Keyring of a particular user. &lt;br /&gt;
&lt;br /&gt;
A solution is to keep the password to your VPN in plaintext, as described in step (2.) of [[#Use dispatcher to connect to a VPN after a network connection is established]]. &lt;br /&gt;
&lt;br /&gt;
You do not need to use the dispatcher described in step (1.) to auto-connect anymore, if you use the new &amp;quot;auto-connect VPN&amp;quot; option from the {{ic|nm-applet}} GUI.&lt;br /&gt;
&lt;br /&gt;
=== systemd bottleneck ===&lt;br /&gt;
&lt;br /&gt;
Over time the log files ({{ic|/var/log/journal}}) can become very large. This can have a big impact on boot performance when using NetworkManager, see: [[systemd#Boot time increasing over time]].&lt;br /&gt;
&lt;br /&gt;
=== Regular network disconnects, latency and lost packets (Wi-Fi) ===&lt;br /&gt;
&lt;br /&gt;
NetworkManager does a scan every 2 minutes.&lt;br /&gt;
&lt;br /&gt;
Some Wi-Fi drivers have issues when scanning for base stations whilst connected/associated. Symptoms include VPN disconnects/reconnects and lost packets, web pages failing to load and then refresh fine.&lt;br /&gt;
&lt;br /&gt;
Running {{ic|journalctl -f}} as root will indicate that this is taking place, messages like the following will be contained in the logs at regular intervals.&lt;br /&gt;
&lt;br /&gt;
 NetworkManager[410]: &amp;lt;info&amp;gt;  (wlp3s0): roamed from BSSID 00:14:48:11:20:CF (my-wifi-name) to (none) ((none))&lt;br /&gt;
&lt;br /&gt;
If roaming is not important, the periodic scanning behavior can be disabled by locking the BSSID of the access point in the Wi-Fi connection profile.&lt;br /&gt;
&lt;br /&gt;
=== Unable to turn on Wi-Fi with Lenovo laptop (IdeaPad, Legion, etc.) ===&lt;br /&gt;
&lt;br /&gt;
There is an issue with the {{ic|ideapad_laptop}} module on some Lenovo models due to the Wi-Fi driver incorrectly reporting a soft block. The card can still be manipulated with {{ic|netctl}}, but managers like NetworkManager break. You can verify that this is the problem by checking the output of {{ic|rfkill list}} after toggling your hardware switch and seeing that the soft block persists.&lt;br /&gt;
&lt;br /&gt;
{{Accuracy|Try to use {{ic|rfkill.default_state}} and {{ic|rfkill.master_switch_mode}} (see [https://docs.kernel.org/admin-guide/kernel-parameters.html kernel-parameters.html]) to fix the rfkill problem.}}&lt;br /&gt;
&lt;br /&gt;
[[modprobe|Unloading]] the {{ic|ideapad_laptop}} module should fix this. (&#039;&#039;&#039;warning&#039;&#039;&#039;: this may disable the laptop keyboard and touchpad also!).&lt;br /&gt;
&lt;br /&gt;
=== nm-applet disappears in i3wm ===&lt;br /&gt;
&lt;br /&gt;
If you use the {{ic|xfce4-notifyd.service}} for notifications you must [[edit]] the unit and add the following:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/systemd/user/xfce4-notifyd.service.d/display_env.conf|2=&lt;br /&gt;
[Service]&lt;br /&gt;
Environment=&amp;quot;DISPLAY=:0.0&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
After reloading the daemons [[restart]] {{ic|xfce4-notifyd.service}}. Exit i3 and start it back up again and the applet should show on the tray.&lt;br /&gt;
&lt;br /&gt;
=== Unit dbus-org.freedesktop.resolve1.service not found ===&lt;br /&gt;
&lt;br /&gt;
If {{ic|systemd-resolved.service}} is not started, NetworkManager will try to start it using D-Bus and fail:&lt;br /&gt;
&lt;br /&gt;
 dbus-daemon[991]: [system] Activating via systemd: service name=&#039;org.freedesktop.resolve1&#039; unit=&#039;dbus-org.freedesktop.resolve1.service&#039; requested by &#039;:1.23&#039; (uid=0 pid=1012 comm=&amp;quot;/usr/bin/NetworkManager --no-daemon &amp;quot;)&lt;br /&gt;
 dbus-daemon[991]: [system] Activation via systemd failed for unit &#039;dbus-org.freedesktop.resolve1.service&#039;: Unit dbus-org.freedesktop.resolve1.service not found.&lt;br /&gt;
 dbus-daemon[991]: [system] Activating via systemd: service name=&#039;org.freedesktop.resolve1&#039; unit=&#039;dbus-org.freedesktop.resolve1.service&#039; requested by &#039;:1.23&#039; (uid=0 pid=1012 comm=&amp;quot;/usr/bin/NetworkManager --no-daemon &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
This is because NetworkManager will try to send DNS information to [[systemd-resolved]] regardless of the {{ic|1=main.dns=}} setting in {{man|5|NetworkManager.conf}}.[https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commit/d4eb4cb45f41b1751cacf71da558bf8f0988f383]&lt;br /&gt;
&lt;br /&gt;
This can be disabled with a configuration file in {{ic|/etc/NetworkManager/conf.d/}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/no-systemd-resolved.conf|2=&lt;br /&gt;
[main]&lt;br /&gt;
systemd-resolved=false&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
See {{Bug|62138}}.&lt;br /&gt;
&lt;br /&gt;
=== Secrets were required, but not provided ===&lt;br /&gt;
&lt;br /&gt;
If you received the following error when attempting to connect to a network: &lt;br /&gt;
&lt;br /&gt;
{{hc|$ nmcli device wifi connect &#039;&#039;SSID&#039;&#039; password &#039;&#039;password&#039;&#039;|&lt;br /&gt;
Error: Connection activation failed: (7) Secrets were required, but not provided&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This error can have numerous causes and you should read the [[journal]] (filter it with {{ic|-u NetworkManager}}). For example, if NetworkManager took too long to establish connection, it will believe that the password is incorrect:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
NetworkManager[1372]: &amp;lt;warn&amp;gt;  [1643991888.3808] device (wlan0): Activation: (wifi) association took too long&lt;br /&gt;
NetworkManager[1372]: &amp;lt;info&amp;gt;  [1643991888.3809] device (wlan0): state change: config -&amp;gt; need-auth (reason &#039;none&#039;, sys-iface-state: &#039;managed&#039;)&lt;br /&gt;
NetworkManager[1372]: &amp;lt;warn&amp;gt;  [1643991888.3838] device (wlan0): Activation: (wifi) asking for new secrets&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can try deleting the connection profile and creating a new one:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection delete &#039;&#039;SSID&#039;&#039;&lt;br /&gt;
 $ nmcli device wifi connect &#039;&#039;SSID&#039;&#039; password &#039;&#039;password&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can also try disabling MAC address randomization:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/NetworkManager/conf.d/wifi_rand_mac.conf|2=&lt;br /&gt;
[device]&lt;br /&gt;
wifi.scan-rand-mac-address=no&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== WPA Enterprise connection with iwd ===&lt;br /&gt;
&lt;br /&gt;
If you try to connect to an WPA Enterprise network like &#039;eduroam&#039; with NetworkManager with the [[#Using iwd as the Wi-Fi backend|iwd backend]] then you will get the following error from NetworkManager:&lt;br /&gt;
&lt;br /&gt;
  Connection &#039;eduroam&#039; is not avialable on device wlan0 because profile is not compatible with device (802.1x connections must have IWD provisioning files)&lt;br /&gt;
&lt;br /&gt;
This is because NetworkManager can not configure a WPA Enterprise network. Therefore you have to configure it using an iwd configuration file {{ic|/var/lib/iwd/&#039;&#039;essid&#039;&#039;.8021x}} like described in [[iwd#WPA Enterprise]].&lt;br /&gt;
&lt;br /&gt;
=== Failed to request VPN secrets ===&lt;br /&gt;
&lt;br /&gt;
If you get this error:&lt;br /&gt;
 Failed to request VPN secrets #1: No agents were available for this request.&lt;br /&gt;
&lt;br /&gt;
It is either because the password is empty or you have to [[#Set up PolicyKit permissions|set up PolicyKit permissions]].&lt;br /&gt;
&lt;br /&gt;
=== OpenVPN connections fail with &amp;quot;secrets: failed to request VPN secrets&amp;quot; warn ===&lt;br /&gt;
&lt;br /&gt;
{{Remove|This does not warrant a troubleshooting section. Optional dependencies are pointed out by pacman, if this is not clear enough it should be covered in [[#VPN support]].|section=Remove unnecessary section 8.22}}&lt;br /&gt;
&lt;br /&gt;
The package {{Pkg|networkmanager-openvpn}} requires {{Pkg|libnma-gtk4}} and optionally {{Pkg|libnma}} (Gtk3) when integrated within the GNOME-Shell. If {{Pkg|libnma}} is required but not installed a message will be  printed to the system log:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
NetworkManager[642]: &amp;lt;warn&amp;gt;  [...] vpn[...&amp;quot;name_of_vpn_profile VPN&amp;quot;]: secrets: failed to request VPN secrets #3: No agents were available for this request.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== OpenVPN connections fail with OpenSSL &amp;quot;ca md too weak&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
Since {{Pkg|openssl}} was updated to version 3, certificates generated with legacy cryptographic algorithms are rejected by default. Attempting to use {{Pkg|networkmanager-openvpn}} with such a setup can result in the following error in the logs:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
nm-openvpn[14359]: OpenSSL: error:0A00018E:SSL routines::ca md too weak&lt;br /&gt;
nm-openvpn[14359]: Cannot load certificate file /home/archie/.local/share/networkmanagement/certificates/my_issued_cert.crt&lt;br /&gt;
nm-openvpn[14359]: Exiting due to fatal error&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The correct approach is to have the OpenVPN server administrator generate and re-issue more secure certificates. However, as an immediate work-around, OpenVPN requires {{ic|1=tls-cipher &amp;quot;DEFAULT:@SECLEVEL=0&amp;quot;}}. This may not be possible through the plugin GUI, but it is possible with &#039;&#039;nmcli&#039;&#039;. Separately, you will also need to enable the &#039;&#039;legacy&#039;&#039; provider in OpenSSL.&lt;br /&gt;
&lt;br /&gt;
Firstly, obtain the name of the VPN connection with the issue, from the output of the following:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection show&lt;br /&gt;
&lt;br /&gt;
Assuming the connection name is &#039;&#039;vpn.example.com&#039;&#039;, use &#039;&#039;nmcli&#039;&#039; like so:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection modify vpn.example.com +vpn.data tls-cipher=DEFAULT:@SECLEVEL=0&lt;br /&gt;
&lt;br /&gt;
The change should instantly be reflected in {{ic|/etc/NetworkManager/system-connections/vpn.example.com.nmconnection}}.&lt;br /&gt;
&lt;br /&gt;
As for OpenSSL, edit {{ic|/etc/ssl/openssl.cnf}} as described on the [https://wiki.openssl.org/index.php/OpenSSL_3.0#Providers OpenSSL wiki].&lt;br /&gt;
&lt;br /&gt;
Specifically, at the end of the {{ic|[provider_sect]}} section add {{ic|1=legacy = legacy_sect}}. Under {{ic|[default_sect]}} uncomment {{ic|1=activate = 1}}. Lastly, add a new section {{ic|[legacy_sect]}} that also contains the line {{ic|1=activate = 1}}. Excluding most other preexisting configuration sections, the end result will look something like:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/ssl/openssl.cnf|2=&lt;br /&gt;
openssl_conf = openssl_init&lt;br /&gt;
&lt;br /&gt;
[openssl_init]&lt;br /&gt;
providers = provider_sect&lt;br /&gt;
&lt;br /&gt;
[provider_sect]&lt;br /&gt;
default = default_sect&lt;br /&gt;
legacy = legacy_sect&lt;br /&gt;
&lt;br /&gt;
[default_sect]&lt;br /&gt;
activate = 1&lt;br /&gt;
&lt;br /&gt;
[legacy_sect]&lt;br /&gt;
activate = 1&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Finally, [[restart]] the {{ic|NetworkManager.service}} to have the new OpenSSL configuration take effect.&lt;br /&gt;
&lt;br /&gt;
=== WPA Enterprise connections fail to authenticate with OpenSSL &amp;quot;unsupported protocol&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
Since {{Pkg|openssl}} was updated to version 3, &amp;quot;SSL 3, TLS 1.0, TLS 1.1, and DTLS 1.0 only work at security level 0&amp;quot; [https://www.openssl.org/news/openssl-3.0-notes.html by default]. Attempting to authenticate to a Wi-Fi network only supporting older standards results in the following error in the logs:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
wpa_supplicant[3320]: SSL: SSL3 alert: write (local SSL3 detected an error):fatal:protocol version&lt;br /&gt;
wpa_supplicant[3320]: OpenSSL: openssl_handshake - SSL_connect error:0A000102:SSL routines::unsupported protocol&lt;br /&gt;
wpa_supplicant[3320]: wlp3s0: CTRL-EVENT-EAP-FAILURE EAP authentication failed&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The correct approach is to convince the institution&#039;s administrator to upgrade the encrypted networking tunnel protocol to TLS 1.3 and optionally drop support for deprecated security standards, including TLS 1.0/1.1, DTLS 1.0 and SSL 1-3. However, as an immediate workaround, there are multiple ways to allow TLS 1.0 and/or 1.1 by default. One way would be to manually patch or revert the breaking changes in OpenSSL ([https://github.com/openssl/openssl/commit/7bf2e4d7f0c7ae19b7a8c416910886a7171e9820]). As this also lowers security for all other programs using OpenSSL level 1, it is not recommended. Instead, one can directly set the level used by wpa_supplicant, like described in [https://bbs.archlinux.org/viewtopic.php?id=286417#p2104492 BBS#286417]. To only change the affected connection, it is possible to set {{ic|1=phase1-auth-flags=32}} or {{ic|1=phase1-auth-flags=64}} in the {{ic|1=[802-1x]}} section of the connection&#039;s configuration file. This may not be possible through GUIs, but it is possible with &#039;&#039;nmcli&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Firstly, obtain the name of the Wi-Fi connection with the issue, from the output of the following:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection show&lt;br /&gt;
&lt;br /&gt;
Assuming the connection uses TLS 1.0 and its name is &#039;&#039;Example Wi-Fi&#039;&#039;, use &#039;&#039;nmcli&#039;&#039; like so:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection modify &#039;Example Wi-Fi&#039; 802-1x.phase1-auth-flags 32&lt;br /&gt;
&lt;br /&gt;
And for a TLS 1.1 connection, type &amp;quot;64&amp;quot; instead:&lt;br /&gt;
&lt;br /&gt;
 $ nmcli connection modify &#039;Example Wi-Fi&#039; 802-1x.phase1-auth-flags 64&lt;br /&gt;
&lt;br /&gt;
{{Note|1=The number you type in refers to the number you get from raising 2 to the power of &#039;&#039;&#039;n&#039;&#039;&#039;. Here, &#039;&#039;&#039;n&#039;&#039;&#039; is the index of the network authentication bit octet, read from right to left. Flipping the fifth bit enables TLS 1.0 &#039;&#039;&#039;[log(2) 32]&#039;&#039;&#039; and flipping the sixth bit enables TLS 1.1 &#039;&#039;&#039;[log(2) 64]&#039;&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
The change should instantly be reflected in {{ic|/etc/NetworkManager/system-connections/Example Wi-Fi.nmconnection}}.&lt;br /&gt;
&lt;br /&gt;
Finally, [[restart]] the {{ic|NetworkManager.service}} to have the new OpenSSL configuration take effect.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://blogs.gnome.org/dcbw/2015/02/16/networkmanager-for-administrators-part-1/ NetworkManager for Administrators Part 1]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=GNOME&amp;diff=873243</id>
		<title>GNOME</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=GNOME&amp;diff=873243"/>
		<updated>2026-05-07T15:00:37Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Device Security Settings */ remove old release number; apply sentence case to section and update menu path&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:GNOME]]&lt;br /&gt;
[[cs:GNOME]]&lt;br /&gt;
[[de:GNOME]]&lt;br /&gt;
[[es:GNOME]]&lt;br /&gt;
[[it:GNOME]]&lt;br /&gt;
[[hu:GNOME]]&lt;br /&gt;
[[ja:GNOME]]&lt;br /&gt;
[[pt:GNOME]]&lt;br /&gt;
[[ru:GNOME]]&lt;br /&gt;
[[zh-hans:GNOME]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|Desktop environment}}&lt;br /&gt;
{{Related|GTK}}&lt;br /&gt;
{{Related|GDM}}&lt;br /&gt;
{{Related|GNOME/Tips and tricks}}&lt;br /&gt;
{{Related|GNOME/Troubleshooting}}&lt;br /&gt;
{{Related|GNOME/Files}}&lt;br /&gt;
{{Related|GNOME/Gedit}}&lt;br /&gt;
{{Related|GNOME/Web}}&lt;br /&gt;
{{Related|GNOME/Evolution}}&lt;br /&gt;
{{Related|GNOME/Flashback}}&lt;br /&gt;
{{Related|GNOME/Keyring}}&lt;br /&gt;
{{Related|GNOME/Document viewer}}&lt;br /&gt;
{{Related|Official repositories#gnome-unstable}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:GNOME|GNOME]] (/(ɡ)noʊm/) is a [[desktop environment]] that aims to be simple and easy to use. It is designed by [[Wikipedia:The GNOME Project|The GNOME Project]] and is composed entirely of free and open-source software. It uses [[Wayland]], and the available sessions are&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;GNOME&#039;&#039;&#039;, the default, runs GNOME Shell on [[Wayland]]. Traditional X applications are run through Xwayland.&lt;br /&gt;
* &#039;&#039;&#039;GNOME Classic&#039;&#039;&#039; provides a &amp;quot;[https://help.gnome.org/users/gnome-help/stable/gnome-classic.html.en traditional desktop experience]&amp;quot; (with an interface similar to GNOME 2) by using [https://web.archive.org/web/20190503163814/http://www.worldofgnome.org/welcome-to-gnome-3-8-flintstones-mode/ certain extensions and values]. Thus, it is a customized form of GNOME Shell rather than a truly distinct mode.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
The following [[package group]]s are available:&lt;br /&gt;
&lt;br /&gt;
* {{Grp|gnome}} contains the base GNOME desktop and the well-integrated [https://apps.gnome.org/#core core applications];&lt;br /&gt;
* {{Grp|gnome-circle}} contains various [https://apps.gnome.org/#circle extra applications] extending the GNOME ecosystem.&lt;br /&gt;
* {{Grp|gnome-extra}} contains [https://apps.gnome.org/#development development tools] as well as some further applications and games that fits well into GNOME.&lt;br /&gt;
&lt;br /&gt;
The base desktop consists of [[Wikipedia:GNOME Shell|GNOME Shell]], a plugin for the [[Wikipedia:Mutter (software)|Mutter]] window manager. It can be installed separately with {{Pkg|gnome-shell}}.&lt;br /&gt;
&lt;br /&gt;
{{Note|&#039;&#039;mutter&#039;&#039; acts as a composite manager for the desktop, employing hardware graphics acceleration to provide effects aimed at reducing screen clutter. The GNOME session manager automatically detects if your video driver is capable of running GNOME Shell and if not, falls back to software rendering using &#039;&#039;llvmpipe&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
Unstable releases can also be used, see [[Official repositories#gnome-unstable]].&lt;br /&gt;
&lt;br /&gt;
== Starting ==&lt;br /&gt;
&lt;br /&gt;
GNOME can be started either graphically with a [[display manager]] or manually from the console (some features may be missing). The display manager included in {{Grp|gnome}} is [[GDM]].&lt;br /&gt;
&lt;br /&gt;
{{Note|Support for screen locking (and more) in GNOME is provided by GDM. If GNOME is not started with GDM, another screen locker may be used. See [[List of applications/Security#Screen lockers]].}}&lt;br /&gt;
&lt;br /&gt;
=== Graphically ===&lt;br /&gt;
&lt;br /&gt;
If you installed the {{Grp|gnome}} group and want GNOME to start automatically on next boot, [[enable]] {{ic|gdm.service}}. You can then select the desired session: &#039;&#039;GNOME&#039;&#039; or &#039;&#039;GNOME Classic&#039;&#039; (only displayed if {{Pkg|gnome-shell-extensions}} is installed) from the display manager&#039;s session menu.&lt;br /&gt;
&lt;br /&gt;
If you prefer to start GNOME right away, thereby avoiding a reboot, [[start]] the aforementioned {{ic|gdm.service}} from a graphically unoccupied tty instead.&lt;br /&gt;
&lt;br /&gt;
=== Manually ===&lt;br /&gt;
&lt;br /&gt;
{{Note|An X server is still necessary to run applications that have not yet been ported to [[Wayland]], see [[Wayland#Xwayland]] for details. Applications using certain graphics libraries, such as Qt, can be forced to use Wayland by setting environment variables. See [[Wayland#GUI libraries]] for more information.}}&lt;br /&gt;
&lt;br /&gt;
==== Session type ====&lt;br /&gt;
&lt;br /&gt;
GNOME session inherits session type from systemd. Systemd session type is determined from {{ic|XDG_SESSION_TYPE}} environment variable when the session is started, and can only be changed by the controller of that session afterwards. See the systemd issue on [https://github.com/systemd/systemd/issues/14489 Github].&lt;br /&gt;
&lt;br /&gt;
Therefore merely setting {{ic|XDG_SESSION_TYPE}} after login does not work. Instead, create a systemd drop-in file to set environment for getty :&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/systemd/system/getty@tty1.service.d/wayland.conf&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
[Service]&lt;br /&gt;
Environment=XDG_SESSION_TYPE=wayland&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
To show session type after reload:&lt;br /&gt;
 $ loginctl session-status&lt;br /&gt;
&lt;br /&gt;
==== Start session ====&lt;br /&gt;
&lt;br /&gt;
After {{ic|XDG_SESSION_TYPE}} and login session type is set correctly, manually starting a Wayland session is possible with:&lt;br /&gt;
 $ gnome-session&lt;br /&gt;
&lt;br /&gt;
Running {{ic|gnome-shell --wayland}} directly is not recommended, because it lacks session management.&lt;br /&gt;
&lt;br /&gt;
Note that manual invocation of Gnome does &#039;&#039;&#039;not&#039;&#039;&#039; require {{ic|gdm}} (consequently also the accompanying {{ic|gdm.service}}) at all and is thus also accessible for users with a (possibly very) minimal installation of Gnome composing of a selected few packages included in the more inclusive {{ic|gnome}} group in accordance to personal preference.&lt;br /&gt;
&lt;br /&gt;
To start on login to tty1, add to your {{ic|.bash_profile}}:&lt;br /&gt;
{{bc|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
gnome-session --no-reexec&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
The {{ic|--no-reexec}} flag prevents gnome-session from starting a login shell which sources the profile again and loops.&lt;br /&gt;
&lt;br /&gt;
Firefox and QT applications do not respect {{ic|XDG_SESSION_TYPE}}, so add variables for them as well:&lt;br /&gt;
&lt;br /&gt;
{{bc|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
if [[ -z $DISPLAY &amp;amp;&amp;amp; $(tty) == /dev/tty1 &amp;amp;&amp;amp; $XDG_SESSION_TYPE == wayland ]]; then&lt;br /&gt;
  MOZ_ENABLE_WAYLAND=1 QT_QPA_PLATFORM=wayland exec gnome-session --no-reexec&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== GNOME applications in Wayland ===&lt;br /&gt;
&lt;br /&gt;
When the &#039;&#039;GNOME&#039;&#039; session is used, GNOME applications will be run using Wayland. For debugging cases, https://docs.gtk.org/gtk3/running.html and https://docs.gtk.org/gtk4/running.html list options and environment variables.&lt;br /&gt;
&lt;br /&gt;
== Navigation ==&lt;br /&gt;
&lt;br /&gt;
To learn how to use the GNOME shell effectively, read the [https://wiki.gnome.org/Projects/GnomeShell/CheatSheet GNOME Shell Cheat Sheet]; it highlights GNOME shell features and keyboard shortcuts. Features include task switching, keyboard use, window control, the panel, overview mode, and more. A few of the shortcuts are:&lt;br /&gt;
&lt;br /&gt;
* {{ic|Super+m}}: show notification list&lt;br /&gt;
* {{ic|Super+a}}: show application grid&lt;br /&gt;
* {{ic|Alt+Tab}}: cycle active applications&lt;br /&gt;
* {{ic|Alt+`}} (the key above {{ic|Tab}} on US keyboard layouts): cycle windows of the application in the foreground&lt;br /&gt;
* {{ic|Alt+F2}}, then enter {{ic|r}} or {{ic|restart}}: restart the shell in case of graphical shell problems (only in X/legacy mode, not in Wayland mode).&lt;br /&gt;
&lt;br /&gt;
See [[/Tips and tricks#Navigation]] for changes to the default configuration making the window-switching resemble that of Windows.&lt;br /&gt;
&lt;br /&gt;
See [https://help.gnome.org/users/gnome-help/stable/keyboard-nav.html.en Keyboard navigation] for more shortcuts.&lt;br /&gt;
&lt;br /&gt;
== Legacy names ==&lt;br /&gt;
&lt;br /&gt;
{{Note|Some GNOME programs have undergone name changes where the application&#039;s name in documentation and about dialogs has been changed but the executable name has not. A few such applications are listed in the table below.}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|Searching for the legacy name of an application in the Shell search bar will successfully return the application in question. For instance, searching for &#039;&#039;nautilus&#039;&#039; will return &#039;&#039;Files&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Legacy&lt;br /&gt;
! Current&lt;br /&gt;
|-&lt;br /&gt;
| Baobab&lt;br /&gt;
| Disk Usage Analyzer&lt;br /&gt;
|-&lt;br /&gt;
| Decibels&lt;br /&gt;
| Audio Player&lt;br /&gt;
|-&lt;br /&gt;
| Epiphany&lt;br /&gt;
| [[GNOME/Web|Web]]&lt;br /&gt;
|-&lt;br /&gt;
| Loupe&lt;br /&gt;
| Image Viewer&lt;br /&gt;
|-&lt;br /&gt;
| Nautilus&lt;br /&gt;
| [[GNOME/Files|Files]]&lt;br /&gt;
|-&lt;br /&gt;
| Papers&lt;br /&gt;
| Document Viewer&lt;br /&gt;
|-&lt;br /&gt;
| Showtime&lt;br /&gt;
| Video Player&lt;br /&gt;
|-&lt;br /&gt;
| Simple Scan&lt;br /&gt;
| Document Scanner&lt;br /&gt;
|-&lt;br /&gt;
| Snapshot&lt;br /&gt;
| Camera&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
GNOME Settings (&#039;&#039;gnome-control-center&#039;&#039;) and GNOME applications use the [[wikipedia:Dconf|dconf]] configuration system to store their settings.&lt;br /&gt;
&lt;br /&gt;
You can directly access the dconf database using the {{man|1|gsettings}} command line tool. This also allows you to configure settings not exposed by the user interfaces. Command line tool {{man|1|dconf}} can directly modify the underlying database, bypassing validation. The configuration keys of gsettings and dconf are equivalent, but in a slightly different format: {{ic|gsettings set mygroup.mysubgroup mysetting myvalue}} in gsettings would be {{ic|dconf write /mygroup/mysubgroup/mysetting myvalue}} in dconf.&lt;br /&gt;
&lt;br /&gt;
Up until GNOME 3.24, settings were applied by the GNOME settings daemon (located at {{ic|/usr/lib/gnome-settings-daemon/gnome-settings-daemon}}), which could be run outside of a GNOME session.&lt;br /&gt;
&lt;br /&gt;
GNOME 3.24, however, replaced the GNOME settings daemon with several separate settings plugins {{ic|/usr/lib/gnome-settings-daemon/gsd-*}} which were later moved to {{ic|/usr/lib/gsd-*}}. These plugins are now controlled via desktop files under {{ic|/etc/xdg/autostart/}} (matching {{ic|org.gnome.SettingsDaemon.*.desktop}}). To run these plugins outside of a GNOME session, you will now need to copy/edit the appropriate [[desktop entries]] to {{ic|~/.config/autostart}}.&lt;br /&gt;
&lt;br /&gt;
The configuration is usually performed user-specific; this section does not cover how to create configuration templates for multiple users.&lt;br /&gt;
&lt;br /&gt;
=== System settings ===&lt;br /&gt;
&lt;br /&gt;
==== Color ====&lt;br /&gt;
&lt;br /&gt;
The daemon {{ic|colord}} reads the display&#039;s EDID and extracts the appropriate color profile. Most color profiles are accurate and no setup is required; however, for those that are not accurate, or for older displays, color profiles can be put in {{ic|~/.local/share/icc/}} and directed to.&lt;br /&gt;
&lt;br /&gt;
==== Night Light ====&lt;br /&gt;
&lt;br /&gt;
GNOME comes with a built-in blue light filter similar to [[Redshift]]. You can enable and customise the time you want to enable Night Light from the display settings menu. Furthermore, you can tweak the kelvin temperature with the following {{Pkg|dconf}} setting, where 5000 is an example value:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.settings-daemon.plugins.color night-light-temperature 5000&lt;br /&gt;
&lt;br /&gt;
{{Tip|To change the daytime temperature in a Wayland session, install the [https://extensions.gnome.org/extension/1276/night-light-slider/ Night Light Slider extension].}}&lt;br /&gt;
{{Note| Night Light works on NVIDIA cards in Wayland sessions since version 545.29.02 }}&lt;br /&gt;
&lt;br /&gt;
==== Date &amp;amp; time ====&lt;br /&gt;
&lt;br /&gt;
If the system has a configured [[Network Time Protocol daemon]], it will be effective for GNOME as well. The synchronization can be set to manual control from the menu, if required.&lt;br /&gt;
&lt;br /&gt;
GNOME supports automatic time zone selection (can be enabled in &#039;&#039;Date &amp;amp; Time&#039;&#039; section of the system settings, given that location services are enabled (see &#039;&#039;Privacy&#039;&#039; section of the settings).&lt;br /&gt;
&lt;br /&gt;
{{Note|Automatic time zone selection might not work anymore because of the retirement of Mozilla Location Services. See [https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/issues/841#note_2300635]. For workarounds see [[System time#Setting based on geolocation]].}}&lt;br /&gt;
&lt;br /&gt;
To show the date in the top bar, execute:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.desktop.interface clock-show-date true&lt;br /&gt;
&lt;br /&gt;
Additionally, to show week numbers in the calendar opened on the top bar, execute:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.desktop.calendar show-weekdate true&lt;br /&gt;
&lt;br /&gt;
==== Default applications ====&lt;br /&gt;
&lt;br /&gt;
Upon installing GNOME for the first time, you may find that the wrong applications are handling certain protocols. For example, &#039;&#039;totem&#039;&#039; opens videos instead of a previously used [[VLC]]. Some of the associations can be set from system settings via &#039;&#039;Default Applications&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
For other protocols and methods, see [[Default applications]] for configuration.&lt;br /&gt;
&lt;br /&gt;
==== Mouse and touchpad ====&lt;br /&gt;
&lt;br /&gt;
Most touchpad settings can be set from system settings via &#039;&#039;Mouse &amp;amp; Touchpad&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Depending on your device, other configuration settings may be available, but not exposed via the default GUI. For example, a different touchpad {{ic|click-method}}&lt;br /&gt;
&lt;br /&gt;
{{hc|$ gsettings range org.gnome.desktop.peripherals.touchpad click-method|&lt;br /&gt;
enum&lt;br /&gt;
&#039;default&#039;&lt;br /&gt;
&#039;none&#039;&lt;br /&gt;
&#039;areas&#039;&lt;br /&gt;
&#039;fingers&#039;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
to be set manually:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.desktop.peripherals.touchpad click-method &#039;fingers&#039;&lt;br /&gt;
&lt;br /&gt;
or via {{Pkg|gnome-tweaks}}.&lt;br /&gt;
&lt;br /&gt;
{{Note|1=The [[synaptics]] driver is not supported by GNOME. Instead, you should use [[libinput]]. See [https://bugzilla.gnome.org/show_bug.cgi?id=764257#c12 this bug report].}}&lt;br /&gt;
&lt;br /&gt;
===== Resize windows by mouse =====&lt;br /&gt;
&lt;br /&gt;
By default, you can use your mouse to move windows by holding down {{ic|Super}}, clicking and holding the left mouse button and dragging the mouse around.&lt;br /&gt;
&lt;br /&gt;
Additionally, you can enable using your mouse to resize windows by holding down {{ic|Super}}, clicking and holding the right mouse button and dragging the mouse around:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.desktop.wm.preferences resize-with-right-button true&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t like the {{ic|Super}} key, you can also change the modifier to something else, like {{ic|Alt}} or {{ic|Ctrl}}:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.desktop.wm.preferences mouse-button-modifier &amp;quot;&#039;&amp;lt;Alt&amp;gt;&#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Network ====&lt;br /&gt;
&lt;br /&gt;
[[NetworkManager]] is the native tool of the GNOME project to control network settings from the shell. If you have not already, [[install]] the {{Pkg|networkmanager}} package and [[enable]] the {{ic|NetworkManager.service}} systemd unit.&lt;br /&gt;
&lt;br /&gt;
While any other [[network manager]] can be used alternatively, NetworkManager provides the full integration via the shell network settings and a status indicator applet {{Pkg|network-manager-applet}} (not required for GNOME).&lt;br /&gt;
&lt;br /&gt;
{{Note|1=Hidden wireless networks set up with {{Pkg|networkmanager}}&#039;s &#039;&#039;nmtui&#039;&#039; do not connect automatically. You need to create a new profile using GNOME control center in order to restore auto-connect capabilities for that network.}}&lt;br /&gt;
&lt;br /&gt;
==== Online accounts ====&lt;br /&gt;
&lt;br /&gt;
Some online accounts, such as [[Nextcloud]], require {{Pkg|gvfs-goa}} and {{Pkg|gvfs-dnssd}} to be installed for full functionality in GNOME applications such as [[GNOME Files]] and GNOME Documents [https://wiki.gnome.org/ThreePointSeven/Features/Owncloud].&lt;br /&gt;
&lt;br /&gt;
See [https://help.gnome.org/users/gnome-help/stable/accounts.html.en Online accounts] for more information.&lt;br /&gt;
&lt;br /&gt;
==== Search ====&lt;br /&gt;
&lt;br /&gt;
The GNOME shell has a search that can be quickly accessed by pressing the {{ic|Super}} key and starting to type. The {{Pkg|localsearch}} package is installed by default as a dependency of {{Pkg|nautilus}} from the {{Grp|gnome}} group and provides an indexing application and metadata database. It can be configured with the &#039;&#039;Search&#039;&#039; menu item in &#039;&#039;Settings&#039;&#039;. It is started automatically by &#039;&#039;gnome-session&#039;&#039; when the user logs in. &lt;br /&gt;
&lt;br /&gt;
localsearch does not automatically recurse into all directories under the user&#039;s home directory, so you may need to add custom paths via the &#039;&#039;Search &amp;gt; Search locations&#039;&#039; menu item. To exclude a directory from the indexing, create an empty {{ic|.nomedia}} file.&lt;br /&gt;
&lt;br /&gt;
A status is available with {{ic|localsearch status}} and the indexed content can be searched ({{ic|localsearch search --help}}), edited ({{ic|localsearch tag --help}}), or reset from the commandline. See {{ic|localsearch help}} and {{ic|localsearch &#039;&#039;command&#039;&#039; --help}}, or the [https://gnome.pages.gitlab.gnome.org/localsearch/commandline.html  online help] for reference.&lt;br /&gt;
&lt;br /&gt;
The database uses {{man|1|tinysparql-sql}} and can also be queried directly, if needed.&lt;br /&gt;
&lt;br /&gt;
==== Accessibility ====&lt;br /&gt;
&lt;br /&gt;
GNOME has accessibility settings available via &#039;&#039;Settings &amp;gt; Accessibility&#039;&#039;. The main settings may be toggled directly after enabling a top bar icon, but note further settings are available via the sub-menus for &#039;&#039;Seeing&#039;&#039;, &#039;&#039;Hearing&#039;&#039;, &#039;&#039;Typing&#039;&#039;, &#039;&#039;Pointing and clicking&#039;&#039; and &#039;&#039;Zoom&#039;&#039;. See https://help.gnome.org/users/gnome-help/stable/a11y.html.en for information on them.&lt;br /&gt;
&lt;br /&gt;
Additionally, a default set of keyboard shortcuts can be set via &#039;&#039;Settings &amp;gt; Keyboard &amp;gt; View and Customize Keyboard Shortcuts &amp;gt; Accessibility&#039;&#039;. For example, pressing {{ic|Alt}}, {{ic|Super}} and {{ic|8}} toggles zooming.&lt;br /&gt;
&lt;br /&gt;
==== Device security settings ====&lt;br /&gt;
&lt;br /&gt;
GNOME has a [https://release.gnome.org/43/ Device Security] panel via the &#039;&#039;Settings &amp;gt; Privacy &amp;amp; Security &amp;gt; Device Security&#039;&#039; menu. This requires {{Pkg|fwupd}} in order to function.[https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2122]&lt;br /&gt;
&lt;br /&gt;
=== Advanced settings ===&lt;br /&gt;
&lt;br /&gt;
As noted above, many configuration options such as changing the [[GTK]] theme or the [[window manager]] theme are not exposed in GNOME Settings (&#039;&#039;gnome-control-center&#039;&#039;). Those users that want to configure these settings may wish to use the GNOME Tweaks ({{Pkg|gnome-tweaks}}), a convenient graphical tool which exposes many of these settings.&lt;br /&gt;
&lt;br /&gt;
GNOME settings (which are stored in the DConf database) can also be configured using the {{Pkg|dconf-editor}} (a graphical DConf configuration tool) or the [https://developer.gnome.org/gio/stable/GSettings.html gsettings] command line tool. The GNOME Tweaks does not do anything else in the background of the GUI; note though that you will not find all settings described in the following sections in it.&lt;br /&gt;
&lt;br /&gt;
==== Extensions ====&lt;br /&gt;
&lt;br /&gt;
The catalogue of extensions is available at https://extensions.gnome.org, they can be installed either through [https://archlinux.org/packages/?q=gnome-shell-extension official repositories] (only a few), [https://aur.archlinux.org/packages?K=gnome-shell-extension the AUR] or through [https://extensions.gnome.org the browser] directly from the GNOME project.&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* Installing extensions through the browser makes them available for the current user only and requires you to handle updates the same way. Install {{Pkg|gnome-browser-connector}} first for this option.&lt;br /&gt;
* Installing extensions through the AUR (or through official repositories, if you find them there) makes them available system-wide (and automates the update process if using an [[AUR helper]]).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Installed extensions can also be configured, enabled or disabled through a GUI with &#039;&#039;gnome-extensions-app&#039;&#039;, from the command line with {{man|1|gnome-extensions}}, or from the browser. In your browser, extensions can be installed then activated in the browser by setting the switch in right top right of the screen to &#039;&#039;&#039;ON&#039;&#039;&#039; and clicking &#039;&#039;&#039;Install&#039;&#039;&#039; on the popup window (if the extension in question is not installed). Installed extensions may be seen at https://extensions.gnome.org/local/, where available updates can be checked.&lt;br /&gt;
&lt;br /&gt;
The {{Pkg|gnome-shell-extensions}} package provides a set of very useful extensions maintained as part of the GNOME project.&lt;br /&gt;
&lt;br /&gt;
{{Pkg|extension-manager}} is a graphical tool which can also be used to install and remove extensions, as well as enable and disable them, both system-wide and for a user. Prior to using it, consider its [https://github.com/mjakeman/extension-manager/labels/bug list of known issues].&lt;br /&gt;
&lt;br /&gt;
To enable usage of extensions (disabled by default):&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.shell disable-user-extensions false&lt;br /&gt;
&lt;br /&gt;
To list currently enabled extensions:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings get org.gnome.shell enabled-extensions&lt;br /&gt;
&lt;br /&gt;
The above command may list extensions that have been removed. To only list extensions that are enabled &#039;&#039;and&#039;&#039; installed, use &#039;&#039;gnome-extensions&#039;&#039; instead:&lt;br /&gt;
&lt;br /&gt;
 $ gnome-extensions list --enabled&lt;br /&gt;
&lt;br /&gt;
For more information about GNOME shell extensions, see https://extensions.gnome.org/about/.&lt;br /&gt;
&lt;br /&gt;
==== Appearance ====&lt;br /&gt;
&lt;br /&gt;
===== Themes =====&lt;br /&gt;
&lt;br /&gt;
{{Note|As of [https://release.gnome.org/42/ Gnome 42], many default Gnome applications use GTK 4 with libadwaita. These apps do not currently support changing themes through gsettings or {{pkg|gnome-tweaks}}, the only visual configuration available is through Settings &amp;gt; Appearance. See [[GTK#Themes]] for setting a GTK theme other than Adwaita or Adwaita-dark.}}&lt;br /&gt;
&lt;br /&gt;
GNOME uses Adwaita by default. To apply Adwaita-dark only to GTK 2 applications, use the following symlink:&lt;br /&gt;
&lt;br /&gt;
 $ ln -s /usr/share/themes/Adwaita-dark ~/.themes/Adwaita&lt;br /&gt;
&lt;br /&gt;
{{Note|The Adwaita-dark theme is provided by {{Pkg|gnome-themes-extra}} which may not be installed on a minimal installation of GNOME.}}&lt;br /&gt;
&lt;br /&gt;
To select new themes (move them to the appropriate directory and) use GNOME Tweaks or the GSettings commands below.&lt;br /&gt;
&lt;br /&gt;
For the GTK theme:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.desktop.interface gtk-theme &#039;&#039;theme-name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the icon theme:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.desktop.interface icon-theme &#039;&#039;theme-name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{Note|The window manager theme follows the GTK theme. Using {{ic|org.gnome.desktop.wm.preferences theme}} is deprecated and ignored.}}&lt;br /&gt;
&lt;br /&gt;
See [[GTK#Themes]] and [[Icons#Icon themes]].&lt;br /&gt;
&lt;br /&gt;
===== Titlebar button order =====&lt;br /&gt;
&lt;br /&gt;
To set the order for the GNOME window manager (Mutter, Metacity):&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.desktop.wm.preferences button-layout &#039;:minimize,maximize,close&#039;&lt;br /&gt;
&lt;br /&gt;
{{Tip|The colon indicates which side of the titlebar the window buttons will appear.}}&lt;br /&gt;
&lt;br /&gt;
===== GNOME Shell themes =====&lt;br /&gt;
&lt;br /&gt;
The theme of GNOME Shell itself is configurable. To use a Shell theme, firstly ensure that you have the {{Pkg|gnome-shell-extensions}} package installed. Then enable the &#039;&#039;User Themes&#039;&#039; extension, either through the GNOME Extensions application or through the [https://extensions.gnome.org GNOME Shell Extensions] webpage. Shell themes can then be loaded and selected using GNOME Extensions.&lt;br /&gt;
&lt;br /&gt;
There are a number of GNOME Shell themes available [https://aur.archlinux.org/packages?K=gtk+theme in the AUR], many themes do not have the same name format, so instead try searching for the appropriate theme in the AUR. Shell themes can also be downloaded from [https://gnome-look.org/ gnome-look.org].&lt;br /&gt;
&lt;br /&gt;
===== AppIndicators/Top bar icons =====&lt;br /&gt;
&lt;br /&gt;
To enable AppIndicators, which is useful for controlling/monitoring certain applications running in the background, Install {{Pkg|gnome-shell-extension-appindicator}} or {{AUR|gnome-shell-extension-appindicator-git}}, [[#Navigation|restart the GNOME Shell]], then enable the AppIndicator extension in the GNOME Extensions application or by running &lt;br /&gt;
&lt;br /&gt;
 $ gnome-extensions enable $(gnome-extensions list {{!}} grep -m 1 appindicatorsupport)&lt;br /&gt;
&lt;br /&gt;
===== Shell animation speed =====&lt;br /&gt;
&lt;br /&gt;
The GNOME shell animation can be sped up, slowed down or disabled. See [[GNOME/Tips and tricks#Change animation speed]].&lt;br /&gt;
&lt;br /&gt;
===== Shell blur =====&lt;br /&gt;
&lt;br /&gt;
Blur my Shell is an extension that adds blur effects to the overview screen as well as the shell itself and other apps. Install {{AUR|gnome-shell-extension-blur-my-shell}} or {{AUR|gnome-shell-extension-blur-my-shell-git}} for development updates. This extension is highly customizable, and you may choose to blur certain applications.&lt;br /&gt;
&lt;br /&gt;
===== Better Alt-Tab Functionality =====&lt;br /&gt;
&lt;br /&gt;
The default Alt-Tab in GNOME is very simple and does not show overviews of the selected windows. You can change the Alt-Tab shortcut from &amp;quot;Switch Applications&amp;quot; to &amp;quot;Switch Windows&amp;quot; in Settings to show window overviews. &lt;br /&gt;
&lt;br /&gt;
You can also use Coverflow Alt-Tab. It is an extension that expands the Alt-Tab behavior and adds features to make switching between applications easier while also giving it a better look. Install {{AUR|gnome-shell-extension-coverflow-alt-tab-git}}, then you may change the configuration of this extension to your liking.&lt;br /&gt;
&lt;br /&gt;
Note: Super-` provides &amp;quot;Switch windows of an application` by default.&lt;br /&gt;
&lt;br /&gt;
==== Autostart ====&lt;br /&gt;
&lt;br /&gt;
GNOME implements [[XDG Autostart]].&lt;br /&gt;
&lt;br /&gt;
The {{Pkg|gnome-tweaks}} allows managing autostart-entries.&lt;br /&gt;
&lt;br /&gt;
{{Tip|1=If the plus sign button in the Tweaks&#039;s Startup Applications section is unresponsive, try starting the Tweaks from the terminal using the following command: {{ic|gnome-tweaks}}. See the following [https://bbs.archlinux.org/viewtopic.php?pid=1413631#p1413631 forum thread].}}&lt;br /&gt;
&lt;br /&gt;
==== Desktop ====&lt;br /&gt;
&lt;br /&gt;
===== Dash to Dock =====&lt;br /&gt;
&lt;br /&gt;
To move the dash out of the overview and turn it into a dock to easily launch and switch applications, [[install]] {{AUR|gnome-shell-extension-dash-to-dock}}.&lt;br /&gt;
&lt;br /&gt;
===== Startup in Overview Mode =====&lt;br /&gt;
&lt;br /&gt;
Starting from GNOME 40, the desktop will start directly into Overview Mode instead of an empty desktop (like in previous versions). To mimic legacy behaviour, one may [[install]] {{AUR|gnome-shell-extension-no-overview}}.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can disable it using gsettings if using {{AUR|gnome-shell-extension-dash-to-dock}}:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.shell.extensions.dash-to-dock disable-overview-on-startup true&lt;br /&gt;
&lt;br /&gt;
See the discussion at [https://discourse.gnome.org/t/gnome-40-login-is-to-the-activities-overview-mode-how-do-you-disable-this/5783].&lt;br /&gt;
&lt;br /&gt;
==== Clipboard history ====&lt;br /&gt;
&lt;br /&gt;
Unlike other desktop environments, GNOME does not have a built-in tool to manage the clipboard history. This can be done however with the help of an extension. Install {{AUR|gnome-shell-extension-clipboard-indicator}}.&lt;br /&gt;
&lt;br /&gt;
==== Weather ====&lt;br /&gt;
&lt;br /&gt;
To display the current weather information in the top panel based on a chosen location, install {{AUR|gnome-shell-extension-openweather}}. The weather information is updated in real-time and displays useful data such as conditions, wind speed, pressure, etc...&lt;br /&gt;
&lt;br /&gt;
==== Sound input/output device selector ====&lt;br /&gt;
{{Remove|Probably not needed anymore. [https://github.com/kgshank/gse-sound-output-device-chooser Packages compatible] up to Gnome 43 only.}}&lt;br /&gt;
By default, if you want to change your sound input or output device or change your microphone&#039;s volume, you need to open GNOME Control Center and configure these settings from there. To integrate a device selector and a microphone volume slider, install {{AUR|gnome-shell-extension-sound-output-device-chooser}} or {{AUR|gnome-shell-extension-sound-output-device-chooser-git}}. Further configuration can be done after installation.&lt;br /&gt;
&lt;br /&gt;
==== Fonts ====&lt;br /&gt;
&lt;br /&gt;
{{Tip|If you set the &#039;&#039;Scaling factor&#039;&#039; to a value above 1.00, the Accessibility menu will be automatically enabled.}}&lt;br /&gt;
&lt;br /&gt;
Fonts can be set for Window titles, Interface (applications), Documents and Monospace. See the Fonts tab in the Tweaks for the relevant options.&lt;br /&gt;
&lt;br /&gt;
For hinting, RGBA will likely be desired as this fits most monitors types, and if fonts appear too blocked reduce hinting to &#039;&#039;Slight&#039;&#039; or &#039;&#039;None&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Input methods ====&lt;br /&gt;
&lt;br /&gt;
GNOME has integrated support for [[input method]]s through [[IBus]]. Only {{Pkg|ibus}} and the wanted input method engine (e.g. {{Pkg|ibus-libpinyin}} for Intelligent Pinyin) needed to be installed. After installation, the input method engine can be added as a keyboard layout under &#039;&#039;Keyboard &amp;gt; Input Sources&#039;&#039; in GNOME Settings (&#039;&#039;gnome-control-center&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
==== Keyboard Layout quirks ====&lt;br /&gt;
&lt;br /&gt;
If you are using an alternative keyboard layout like Neo2 which uses multiple layers/modifiers, you might need to go to &#039;&#039;Keyboard &amp;gt; Type Special Characters&#039;&#039; in GNOME Settings (&#039;&#039;gnome-control-center&#039;&#039;) and change the &#039;&#039;Alternate Characters Key&#039;&#039; away from &#039;&#039;Right Alt&#039;&#039; so that it can be used as a native modifier of the keyboard layout. Setting it to e.g. &#039;&#039;Left Alt&#039;&#039; prevents &#039;&#039;Alt+Tab&#039;&#039;, so be careful what you change it to.&lt;br /&gt;
Without this change, your left &#039;&#039;Mod3&#039;&#039; key might work, but the right one (&#039;&#039;AltGr&#039;&#039;) does not. (As of 2021-05-18)&lt;br /&gt;
&lt;br /&gt;
==== Power ====&lt;br /&gt;
&lt;br /&gt;
When you are using a laptop, you might want to alter the following settings controlling behavior when idle, screen lock power button presses and lid close:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout &#039;&#039;3600&#039;&#039;&lt;br /&gt;
 $ gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type &#039;&#039;hibernate&#039;&#039;&lt;br /&gt;
 $ gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout &#039;&#039;1800&#039;&#039;&lt;br /&gt;
 $ gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type &#039;&#039;hibernate&#039;&#039;&lt;br /&gt;
 $ gsettings set org.gnome.settings-daemon.plugins.power power-button-action &#039;&#039;suspend&#039;&#039;&lt;br /&gt;
 $ gsettings set org.gnome.desktop.lockdown disable-lock-screen &#039;&#039;true&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To keep the monitor active when the lid is closed:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.settings-daemon.plugins.xrandr default-monitors-setup do-nothing&lt;br /&gt;
&lt;br /&gt;
GNOME 3.24 deprecated the following settings:&lt;br /&gt;
&lt;br /&gt;
 org.gnome.settings-daemon.plugins.power button-hibernate&lt;br /&gt;
 org.gnome.settings-daemon.plugins.power button-power&lt;br /&gt;
 org.gnome.settings-daemon.plugins.power button-sleep&lt;br /&gt;
 org.gnome.settings-daemon.plugins.power button-suspend&lt;br /&gt;
 org.gnome.settings-daemon.plugins.power critical-battery-action&lt;br /&gt;
&lt;br /&gt;
===== Do not suspend when laptop lid is closed =====&lt;br /&gt;
&lt;br /&gt;
The settings panel of GNOME does not provide an option for the user to change the action triggered when the laptop lid is closed. To change the lid switch action system-wide, edit the systemd settings in {{ic|/etc/systemd/logind.conf}}. To turn off suspend on lid close, set {{ic|1=HandleLidSwitch=ignore}}, as described in [[Power management#ACPI events]].&lt;br /&gt;
&lt;br /&gt;
===== Change critical battery level action =====&lt;br /&gt;
&lt;br /&gt;
The settings panel does not provide an option for changing the critical battery level action. These settings have been removed from dconf as well. They are now managed by upower. Edit the upower settings in {{ic|/etc/UPower/UPower.conf}}. Find these settings and adjust to your needs.&lt;br /&gt;
&lt;br /&gt;
{{hc|head=/etc/UPower/UPower.conf|output=&lt;br /&gt;
PercentageLow=10&lt;br /&gt;
PercentageCritical=3&lt;br /&gt;
PercentageAction=2&lt;br /&gt;
CriticalPowerAction=HybridSleep&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== Power modes =====&lt;br /&gt;
&lt;br /&gt;
Install the [[power-profiles-daemon]] optional dependency (of {{Pkg|gnome-control-center}}) for power profiles support. Explicitly [[starting/enabling]] the {{ic|power-profiles-daemon}} service is unnecessary since &#039;&#039;gnome-shell&#039;&#039; and GNOME Settings both request its activation upon launching.&lt;br /&gt;
&lt;br /&gt;
When the service is active, power profiles can be managed through the &#039;&#039;Power&#039;&#039; section of GNOME Settings and in the system menu.&lt;br /&gt;
&lt;br /&gt;
==== Screencast ====&lt;br /&gt;
&lt;br /&gt;
The built-in screenshot tool comes without the Screencast option by default. Install the {{Pkg|gst-plugin-pipewire}} optional dependency (of {{Pkg|gnome-shell}}) to enable screen recording.&lt;br /&gt;
&lt;br /&gt;
=== Use a different window manager ===&lt;br /&gt;
&lt;br /&gt;
GNOME Shell does not support using a different [[window manager]], however [[GNOME Flashback]] provides sessions for Metacity and [[Compiz]]. Furthermore, it is possible to define your own [[GNOME/Tips and tricks#Custom GNOME sessions|custom GNOME sessions]] which use alternative components.&lt;br /&gt;
&lt;br /&gt;
Replacing GNOME Shell with a different [[Wayland compositor]] will cause certain sections of {{Pkg|gnome-control-center}} (GNOME Settings) to populate incorrectly. &#039;&#039;gnome-control-center&#039;&#039; will work, but since {{Pkg|mutter}} (GNOME Shell) will not be available to provide settings for populating these sections, they will not have an effect or may not populate accurately with your settings. Sections affected are bluetooth, display, and mouse/touchpad to name a few.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.gnome.org/ Official Website]&lt;br /&gt;
* [https://blogs.gnome.org/tbernard/2021/06/15/community-power-2/ Contributing to GNOME, feature requests, bugs, code]&lt;br /&gt;
* [[Wikipedia:GNOME|Wikipedia article]]&lt;br /&gt;
* [https://extensions.gnome.org/ GNOME-Shell Extensions]&lt;br /&gt;
* [https://wiki.gnome.org/Projects/GnomeShell/CheatSheet GNOME Shell Cheat Sheet]&lt;br /&gt;
* Customization (themes, icons...):&lt;br /&gt;
** [https://wiki.gnome.org/Personalization Personalize GNOME]&lt;br /&gt;
** [https://www.gnome-look.org/ GNOME Look]&lt;br /&gt;
* GNOME applications:&lt;br /&gt;
** [https://wiki.gnome.org/Apps GNOME Apps Index]&lt;br /&gt;
** [[Wikipedia:GNOME Core Applications]]&lt;br /&gt;
* GNOME Source/Mirrors:&lt;br /&gt;
** [https://gitlab.gnome.org/ GNOME GitLab]&lt;br /&gt;
** [https://github.com/GNOME GNOME Github Mirror]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=GNOME&amp;diff=873242</id>
		<title>GNOME</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=GNOME&amp;diff=873242"/>
		<updated>2026-05-07T14:52:08Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Extensions */ handle accuracy template by condensing note and remove template; &amp;quot;easier&amp;quot; can apply to both, depending on what a user seeks; done&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:GNOME]]&lt;br /&gt;
[[cs:GNOME]]&lt;br /&gt;
[[de:GNOME]]&lt;br /&gt;
[[es:GNOME]]&lt;br /&gt;
[[it:GNOME]]&lt;br /&gt;
[[hu:GNOME]]&lt;br /&gt;
[[ja:GNOME]]&lt;br /&gt;
[[pt:GNOME]]&lt;br /&gt;
[[ru:GNOME]]&lt;br /&gt;
[[zh-hans:GNOME]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|Desktop environment}}&lt;br /&gt;
{{Related|GTK}}&lt;br /&gt;
{{Related|GDM}}&lt;br /&gt;
{{Related|GNOME/Tips and tricks}}&lt;br /&gt;
{{Related|GNOME/Troubleshooting}}&lt;br /&gt;
{{Related|GNOME/Files}}&lt;br /&gt;
{{Related|GNOME/Gedit}}&lt;br /&gt;
{{Related|GNOME/Web}}&lt;br /&gt;
{{Related|GNOME/Evolution}}&lt;br /&gt;
{{Related|GNOME/Flashback}}&lt;br /&gt;
{{Related|GNOME/Keyring}}&lt;br /&gt;
{{Related|GNOME/Document viewer}}&lt;br /&gt;
{{Related|Official repositories#gnome-unstable}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:GNOME|GNOME]] (/(ɡ)noʊm/) is a [[desktop environment]] that aims to be simple and easy to use. It is designed by [[Wikipedia:The GNOME Project|The GNOME Project]] and is composed entirely of free and open-source software. It uses [[Wayland]], and the available sessions are&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;GNOME&#039;&#039;&#039;, the default, runs GNOME Shell on [[Wayland]]. Traditional X applications are run through Xwayland.&lt;br /&gt;
* &#039;&#039;&#039;GNOME Classic&#039;&#039;&#039; provides a &amp;quot;[https://help.gnome.org/users/gnome-help/stable/gnome-classic.html.en traditional desktop experience]&amp;quot; (with an interface similar to GNOME 2) by using [https://web.archive.org/web/20190503163814/http://www.worldofgnome.org/welcome-to-gnome-3-8-flintstones-mode/ certain extensions and values]. Thus, it is a customized form of GNOME Shell rather than a truly distinct mode.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
The following [[package group]]s are available:&lt;br /&gt;
&lt;br /&gt;
* {{Grp|gnome}} contains the base GNOME desktop and the well-integrated [https://apps.gnome.org/#core core applications];&lt;br /&gt;
* {{Grp|gnome-circle}} contains various [https://apps.gnome.org/#circle extra applications] extending the GNOME ecosystem.&lt;br /&gt;
* {{Grp|gnome-extra}} contains [https://apps.gnome.org/#development development tools] as well as some further applications and games that fits well into GNOME.&lt;br /&gt;
&lt;br /&gt;
The base desktop consists of [[Wikipedia:GNOME Shell|GNOME Shell]], a plugin for the [[Wikipedia:Mutter (software)|Mutter]] window manager. It can be installed separately with {{Pkg|gnome-shell}}.&lt;br /&gt;
&lt;br /&gt;
{{Note|&#039;&#039;mutter&#039;&#039; acts as a composite manager for the desktop, employing hardware graphics acceleration to provide effects aimed at reducing screen clutter. The GNOME session manager automatically detects if your video driver is capable of running GNOME Shell and if not, falls back to software rendering using &#039;&#039;llvmpipe&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
Unstable releases can also be used, see [[Official repositories#gnome-unstable]].&lt;br /&gt;
&lt;br /&gt;
== Starting ==&lt;br /&gt;
&lt;br /&gt;
GNOME can be started either graphically with a [[display manager]] or manually from the console (some features may be missing). The display manager included in {{Grp|gnome}} is [[GDM]].&lt;br /&gt;
&lt;br /&gt;
{{Note|Support for screen locking (and more) in GNOME is provided by GDM. If GNOME is not started with GDM, another screen locker may be used. See [[List of applications/Security#Screen lockers]].}}&lt;br /&gt;
&lt;br /&gt;
=== Graphically ===&lt;br /&gt;
&lt;br /&gt;
If you installed the {{Grp|gnome}} group and want GNOME to start automatically on next boot, [[enable]] {{ic|gdm.service}}. You can then select the desired session: &#039;&#039;GNOME&#039;&#039; or &#039;&#039;GNOME Classic&#039;&#039; (only displayed if {{Pkg|gnome-shell-extensions}} is installed) from the display manager&#039;s session menu.&lt;br /&gt;
&lt;br /&gt;
If you prefer to start GNOME right away, thereby avoiding a reboot, [[start]] the aforementioned {{ic|gdm.service}} from a graphically unoccupied tty instead.&lt;br /&gt;
&lt;br /&gt;
=== Manually ===&lt;br /&gt;
&lt;br /&gt;
{{Note|An X server is still necessary to run applications that have not yet been ported to [[Wayland]], see [[Wayland#Xwayland]] for details. Applications using certain graphics libraries, such as Qt, can be forced to use Wayland by setting environment variables. See [[Wayland#GUI libraries]] for more information.}}&lt;br /&gt;
&lt;br /&gt;
==== Session type ====&lt;br /&gt;
&lt;br /&gt;
GNOME session inherits session type from systemd. Systemd session type is determined from {{ic|XDG_SESSION_TYPE}} environment variable when the session is started, and can only be changed by the controller of that session afterwards. See the systemd issue on [https://github.com/systemd/systemd/issues/14489 Github].&lt;br /&gt;
&lt;br /&gt;
Therefore merely setting {{ic|XDG_SESSION_TYPE}} after login does not work. Instead, create a systemd drop-in file to set environment for getty :&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/systemd/system/getty@tty1.service.d/wayland.conf&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
[Service]&lt;br /&gt;
Environment=XDG_SESSION_TYPE=wayland&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
To show session type after reload:&lt;br /&gt;
 $ loginctl session-status&lt;br /&gt;
&lt;br /&gt;
==== Start session ====&lt;br /&gt;
&lt;br /&gt;
After {{ic|XDG_SESSION_TYPE}} and login session type is set correctly, manually starting a Wayland session is possible with:&lt;br /&gt;
 $ gnome-session&lt;br /&gt;
&lt;br /&gt;
Running {{ic|gnome-shell --wayland}} directly is not recommended, because it lacks session management.&lt;br /&gt;
&lt;br /&gt;
Note that manual invocation of Gnome does &#039;&#039;&#039;not&#039;&#039;&#039; require {{ic|gdm}} (consequently also the accompanying {{ic|gdm.service}}) at all and is thus also accessible for users with a (possibly very) minimal installation of Gnome composing of a selected few packages included in the more inclusive {{ic|gnome}} group in accordance to personal preference.&lt;br /&gt;
&lt;br /&gt;
To start on login to tty1, add to your {{ic|.bash_profile}}:&lt;br /&gt;
{{bc|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
gnome-session --no-reexec&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
The {{ic|--no-reexec}} flag prevents gnome-session from starting a login shell which sources the profile again and loops.&lt;br /&gt;
&lt;br /&gt;
Firefox and QT applications do not respect {{ic|XDG_SESSION_TYPE}}, so add variables for them as well:&lt;br /&gt;
&lt;br /&gt;
{{bc|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
if [[ -z $DISPLAY &amp;amp;&amp;amp; $(tty) == /dev/tty1 &amp;amp;&amp;amp; $XDG_SESSION_TYPE == wayland ]]; then&lt;br /&gt;
  MOZ_ENABLE_WAYLAND=1 QT_QPA_PLATFORM=wayland exec gnome-session --no-reexec&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== GNOME applications in Wayland ===&lt;br /&gt;
&lt;br /&gt;
When the &#039;&#039;GNOME&#039;&#039; session is used, GNOME applications will be run using Wayland. For debugging cases, https://docs.gtk.org/gtk3/running.html and https://docs.gtk.org/gtk4/running.html list options and environment variables.&lt;br /&gt;
&lt;br /&gt;
== Navigation ==&lt;br /&gt;
&lt;br /&gt;
To learn how to use the GNOME shell effectively, read the [https://wiki.gnome.org/Projects/GnomeShell/CheatSheet GNOME Shell Cheat Sheet]; it highlights GNOME shell features and keyboard shortcuts. Features include task switching, keyboard use, window control, the panel, overview mode, and more. A few of the shortcuts are:&lt;br /&gt;
&lt;br /&gt;
* {{ic|Super+m}}: show notification list&lt;br /&gt;
* {{ic|Super+a}}: show application grid&lt;br /&gt;
* {{ic|Alt+Tab}}: cycle active applications&lt;br /&gt;
* {{ic|Alt+`}} (the key above {{ic|Tab}} on US keyboard layouts): cycle windows of the application in the foreground&lt;br /&gt;
* {{ic|Alt+F2}}, then enter {{ic|r}} or {{ic|restart}}: restart the shell in case of graphical shell problems (only in X/legacy mode, not in Wayland mode).&lt;br /&gt;
&lt;br /&gt;
See [[/Tips and tricks#Navigation]] for changes to the default configuration making the window-switching resemble that of Windows.&lt;br /&gt;
&lt;br /&gt;
See [https://help.gnome.org/users/gnome-help/stable/keyboard-nav.html.en Keyboard navigation] for more shortcuts.&lt;br /&gt;
&lt;br /&gt;
== Legacy names ==&lt;br /&gt;
&lt;br /&gt;
{{Note|Some GNOME programs have undergone name changes where the application&#039;s name in documentation and about dialogs has been changed but the executable name has not. A few such applications are listed in the table below.}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|Searching for the legacy name of an application in the Shell search bar will successfully return the application in question. For instance, searching for &#039;&#039;nautilus&#039;&#039; will return &#039;&#039;Files&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Legacy&lt;br /&gt;
! Current&lt;br /&gt;
|-&lt;br /&gt;
| Baobab&lt;br /&gt;
| Disk Usage Analyzer&lt;br /&gt;
|-&lt;br /&gt;
| Decibels&lt;br /&gt;
| Audio Player&lt;br /&gt;
|-&lt;br /&gt;
| Epiphany&lt;br /&gt;
| [[GNOME/Web|Web]]&lt;br /&gt;
|-&lt;br /&gt;
| Loupe&lt;br /&gt;
| Image Viewer&lt;br /&gt;
|-&lt;br /&gt;
| Nautilus&lt;br /&gt;
| [[GNOME/Files|Files]]&lt;br /&gt;
|-&lt;br /&gt;
| Papers&lt;br /&gt;
| Document Viewer&lt;br /&gt;
|-&lt;br /&gt;
| Showtime&lt;br /&gt;
| Video Player&lt;br /&gt;
|-&lt;br /&gt;
| Simple Scan&lt;br /&gt;
| Document Scanner&lt;br /&gt;
|-&lt;br /&gt;
| Snapshot&lt;br /&gt;
| Camera&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
GNOME Settings (&#039;&#039;gnome-control-center&#039;&#039;) and GNOME applications use the [[wikipedia:Dconf|dconf]] configuration system to store their settings.&lt;br /&gt;
&lt;br /&gt;
You can directly access the dconf database using the {{man|1|gsettings}} command line tool. This also allows you to configure settings not exposed by the user interfaces. Command line tool {{man|1|dconf}} can directly modify the underlying database, bypassing validation. The configuration keys of gsettings and dconf are equivalent, but in a slightly different format: {{ic|gsettings set mygroup.mysubgroup mysetting myvalue}} in gsettings would be {{ic|dconf write /mygroup/mysubgroup/mysetting myvalue}} in dconf.&lt;br /&gt;
&lt;br /&gt;
Up until GNOME 3.24, settings were applied by the GNOME settings daemon (located at {{ic|/usr/lib/gnome-settings-daemon/gnome-settings-daemon}}), which could be run outside of a GNOME session.&lt;br /&gt;
&lt;br /&gt;
GNOME 3.24, however, replaced the GNOME settings daemon with several separate settings plugins {{ic|/usr/lib/gnome-settings-daemon/gsd-*}} which were later moved to {{ic|/usr/lib/gsd-*}}. These plugins are now controlled via desktop files under {{ic|/etc/xdg/autostart/}} (matching {{ic|org.gnome.SettingsDaemon.*.desktop}}). To run these plugins outside of a GNOME session, you will now need to copy/edit the appropriate [[desktop entries]] to {{ic|~/.config/autostart}}.&lt;br /&gt;
&lt;br /&gt;
The configuration is usually performed user-specific; this section does not cover how to create configuration templates for multiple users.&lt;br /&gt;
&lt;br /&gt;
=== System settings ===&lt;br /&gt;
&lt;br /&gt;
==== Color ====&lt;br /&gt;
&lt;br /&gt;
The daemon {{ic|colord}} reads the display&#039;s EDID and extracts the appropriate color profile. Most color profiles are accurate and no setup is required; however, for those that are not accurate, or for older displays, color profiles can be put in {{ic|~/.local/share/icc/}} and directed to.&lt;br /&gt;
&lt;br /&gt;
==== Night Light ====&lt;br /&gt;
&lt;br /&gt;
GNOME comes with a built-in blue light filter similar to [[Redshift]]. You can enable and customise the time you want to enable Night Light from the display settings menu. Furthermore, you can tweak the kelvin temperature with the following {{Pkg|dconf}} setting, where 5000 is an example value:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.settings-daemon.plugins.color night-light-temperature 5000&lt;br /&gt;
&lt;br /&gt;
{{Tip|To change the daytime temperature in a Wayland session, install the [https://extensions.gnome.org/extension/1276/night-light-slider/ Night Light Slider extension].}}&lt;br /&gt;
{{Note| Night Light works on NVIDIA cards in Wayland sessions since version 545.29.02 }}&lt;br /&gt;
&lt;br /&gt;
==== Date &amp;amp; time ====&lt;br /&gt;
&lt;br /&gt;
If the system has a configured [[Network Time Protocol daemon]], it will be effective for GNOME as well. The synchronization can be set to manual control from the menu, if required.&lt;br /&gt;
&lt;br /&gt;
GNOME supports automatic time zone selection (can be enabled in &#039;&#039;Date &amp;amp; Time&#039;&#039; section of the system settings, given that location services are enabled (see &#039;&#039;Privacy&#039;&#039; section of the settings).&lt;br /&gt;
&lt;br /&gt;
{{Note|Automatic time zone selection might not work anymore because of the retirement of Mozilla Location Services. See [https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/issues/841#note_2300635]. For workarounds see [[System time#Setting based on geolocation]].}}&lt;br /&gt;
&lt;br /&gt;
To show the date in the top bar, execute:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.desktop.interface clock-show-date true&lt;br /&gt;
&lt;br /&gt;
Additionally, to show week numbers in the calendar opened on the top bar, execute:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.desktop.calendar show-weekdate true&lt;br /&gt;
&lt;br /&gt;
==== Default applications ====&lt;br /&gt;
&lt;br /&gt;
Upon installing GNOME for the first time, you may find that the wrong applications are handling certain protocols. For example, &#039;&#039;totem&#039;&#039; opens videos instead of a previously used [[VLC]]. Some of the associations can be set from system settings via &#039;&#039;Default Applications&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
For other protocols and methods, see [[Default applications]] for configuration.&lt;br /&gt;
&lt;br /&gt;
==== Mouse and touchpad ====&lt;br /&gt;
&lt;br /&gt;
Most touchpad settings can be set from system settings via &#039;&#039;Mouse &amp;amp; Touchpad&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Depending on your device, other configuration settings may be available, but not exposed via the default GUI. For example, a different touchpad {{ic|click-method}}&lt;br /&gt;
&lt;br /&gt;
{{hc|$ gsettings range org.gnome.desktop.peripherals.touchpad click-method|&lt;br /&gt;
enum&lt;br /&gt;
&#039;default&#039;&lt;br /&gt;
&#039;none&#039;&lt;br /&gt;
&#039;areas&#039;&lt;br /&gt;
&#039;fingers&#039;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
to be set manually:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.desktop.peripherals.touchpad click-method &#039;fingers&#039;&lt;br /&gt;
&lt;br /&gt;
or via {{Pkg|gnome-tweaks}}.&lt;br /&gt;
&lt;br /&gt;
{{Note|1=The [[synaptics]] driver is not supported by GNOME. Instead, you should use [[libinput]]. See [https://bugzilla.gnome.org/show_bug.cgi?id=764257#c12 this bug report].}}&lt;br /&gt;
&lt;br /&gt;
===== Resize windows by mouse =====&lt;br /&gt;
&lt;br /&gt;
By default, you can use your mouse to move windows by holding down {{ic|Super}}, clicking and holding the left mouse button and dragging the mouse around.&lt;br /&gt;
&lt;br /&gt;
Additionally, you can enable using your mouse to resize windows by holding down {{ic|Super}}, clicking and holding the right mouse button and dragging the mouse around:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.desktop.wm.preferences resize-with-right-button true&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t like the {{ic|Super}} key, you can also change the modifier to something else, like {{ic|Alt}} or {{ic|Ctrl}}:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.desktop.wm.preferences mouse-button-modifier &amp;quot;&#039;&amp;lt;Alt&amp;gt;&#039;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Network ====&lt;br /&gt;
&lt;br /&gt;
[[NetworkManager]] is the native tool of the GNOME project to control network settings from the shell. If you have not already, [[install]] the {{Pkg|networkmanager}} package and [[enable]] the {{ic|NetworkManager.service}} systemd unit.&lt;br /&gt;
&lt;br /&gt;
While any other [[network manager]] can be used alternatively, NetworkManager provides the full integration via the shell network settings and a status indicator applet {{Pkg|network-manager-applet}} (not required for GNOME).&lt;br /&gt;
&lt;br /&gt;
{{Note|1=Hidden wireless networks set up with {{Pkg|networkmanager}}&#039;s &#039;&#039;nmtui&#039;&#039; do not connect automatically. You need to create a new profile using GNOME control center in order to restore auto-connect capabilities for that network.}}&lt;br /&gt;
&lt;br /&gt;
==== Online accounts ====&lt;br /&gt;
&lt;br /&gt;
Some online accounts, such as [[Nextcloud]], require {{Pkg|gvfs-goa}} and {{Pkg|gvfs-dnssd}} to be installed for full functionality in GNOME applications such as [[GNOME Files]] and GNOME Documents [https://wiki.gnome.org/ThreePointSeven/Features/Owncloud].&lt;br /&gt;
&lt;br /&gt;
See [https://help.gnome.org/users/gnome-help/stable/accounts.html.en Online accounts] for more information.&lt;br /&gt;
&lt;br /&gt;
==== Search ====&lt;br /&gt;
&lt;br /&gt;
The GNOME shell has a search that can be quickly accessed by pressing the {{ic|Super}} key and starting to type. The {{Pkg|localsearch}} package is installed by default as a dependency of {{Pkg|nautilus}} from the {{Grp|gnome}} group and provides an indexing application and metadata database. It can be configured with the &#039;&#039;Search&#039;&#039; menu item in &#039;&#039;Settings&#039;&#039;. It is started automatically by &#039;&#039;gnome-session&#039;&#039; when the user logs in. &lt;br /&gt;
&lt;br /&gt;
localsearch does not automatically recurse into all directories under the user&#039;s home directory, so you may need to add custom paths via the &#039;&#039;Search &amp;gt; Search locations&#039;&#039; menu item. To exclude a directory from the indexing, create an empty {{ic|.nomedia}} file.&lt;br /&gt;
&lt;br /&gt;
A status is available with {{ic|localsearch status}} and the indexed content can be searched ({{ic|localsearch search --help}}), edited ({{ic|localsearch tag --help}}), or reset from the commandline. See {{ic|localsearch help}} and {{ic|localsearch &#039;&#039;command&#039;&#039; --help}}, or the [https://gnome.pages.gitlab.gnome.org/localsearch/commandline.html  online help] for reference.&lt;br /&gt;
&lt;br /&gt;
The database uses {{man|1|tinysparql-sql}} and can also be queried directly, if needed.&lt;br /&gt;
&lt;br /&gt;
==== Accessibility ====&lt;br /&gt;
&lt;br /&gt;
GNOME has accessibility settings available via &#039;&#039;Settings &amp;gt; Accessibility&#039;&#039;. The main settings may be toggled directly after enabling a top bar icon, but note further settings are available via the sub-menus for &#039;&#039;Seeing&#039;&#039;, &#039;&#039;Hearing&#039;&#039;, &#039;&#039;Typing&#039;&#039;, &#039;&#039;Pointing and clicking&#039;&#039; and &#039;&#039;Zoom&#039;&#039;. See https://help.gnome.org/users/gnome-help/stable/a11y.html.en for information on them.&lt;br /&gt;
&lt;br /&gt;
Additionally, a default set of keyboard shortcuts can be set via &#039;&#039;Settings &amp;gt; Keyboard &amp;gt; View and Customize Keyboard Shortcuts &amp;gt; Accessibility&#039;&#039;. For example, pressing {{ic|Alt}}, {{ic|Super}} and {{ic|8}} toggles zooming.&lt;br /&gt;
&lt;br /&gt;
==== Device Security Settings ====&lt;br /&gt;
&lt;br /&gt;
GNOME 43 comes with a new [https://release.gnome.org/43/ Device Security] panel in Settings. This requires {{Pkg|fwupd}} in order to function. See [https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/2122].&lt;br /&gt;
&lt;br /&gt;
=== Advanced settings ===&lt;br /&gt;
&lt;br /&gt;
As noted above, many configuration options such as changing the [[GTK]] theme or the [[window manager]] theme are not exposed in GNOME Settings (&#039;&#039;gnome-control-center&#039;&#039;). Those users that want to configure these settings may wish to use the GNOME Tweaks ({{Pkg|gnome-tweaks}}), a convenient graphical tool which exposes many of these settings.&lt;br /&gt;
&lt;br /&gt;
GNOME settings (which are stored in the DConf database) can also be configured using the {{Pkg|dconf-editor}} (a graphical DConf configuration tool) or the [https://developer.gnome.org/gio/stable/GSettings.html gsettings] command line tool. The GNOME Tweaks does not do anything else in the background of the GUI; note though that you will not find all settings described in the following sections in it.&lt;br /&gt;
&lt;br /&gt;
==== Extensions ====&lt;br /&gt;
&lt;br /&gt;
The catalogue of extensions is available at https://extensions.gnome.org, they can be installed either through [https://archlinux.org/packages/?q=gnome-shell-extension official repositories] (only a few), [https://aur.archlinux.org/packages?K=gnome-shell-extension the AUR] or through [https://extensions.gnome.org the browser] directly from the GNOME project.&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
* Installing extensions through the browser makes them available for the current user only and requires you to handle updates the same way. Install {{Pkg|gnome-browser-connector}} first for this option.&lt;br /&gt;
* Installing extensions through the AUR (or through official repositories, if you find them there) makes them available system-wide (and automates the update process if using an [[AUR helper]]).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Installed extensions can also be configured, enabled or disabled through a GUI with &#039;&#039;gnome-extensions-app&#039;&#039;, from the command line with {{man|1|gnome-extensions}}, or from the browser. In your browser, extensions can be installed then activated in the browser by setting the switch in right top right of the screen to &#039;&#039;&#039;ON&#039;&#039;&#039; and clicking &#039;&#039;&#039;Install&#039;&#039;&#039; on the popup window (if the extension in question is not installed). Installed extensions may be seen at https://extensions.gnome.org/local/, where available updates can be checked.&lt;br /&gt;
&lt;br /&gt;
The {{Pkg|gnome-shell-extensions}} package provides a set of very useful extensions maintained as part of the GNOME project.&lt;br /&gt;
&lt;br /&gt;
{{Pkg|extension-manager}} is a graphical tool which can also be used to install and remove extensions, as well as enable and disable them, both system-wide and for a user. Prior to using it, consider its [https://github.com/mjakeman/extension-manager/labels/bug list of known issues].&lt;br /&gt;
&lt;br /&gt;
To enable usage of extensions (disabled by default):&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.shell disable-user-extensions false&lt;br /&gt;
&lt;br /&gt;
To list currently enabled extensions:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings get org.gnome.shell enabled-extensions&lt;br /&gt;
&lt;br /&gt;
The above command may list extensions that have been removed. To only list extensions that are enabled &#039;&#039;and&#039;&#039; installed, use &#039;&#039;gnome-extensions&#039;&#039; instead:&lt;br /&gt;
&lt;br /&gt;
 $ gnome-extensions list --enabled&lt;br /&gt;
&lt;br /&gt;
For more information about GNOME shell extensions, see https://extensions.gnome.org/about/.&lt;br /&gt;
&lt;br /&gt;
==== Appearance ====&lt;br /&gt;
&lt;br /&gt;
===== Themes =====&lt;br /&gt;
&lt;br /&gt;
{{Note|As of [https://release.gnome.org/42/ Gnome 42], many default Gnome applications use GTK 4 with libadwaita. These apps do not currently support changing themes through gsettings or {{pkg|gnome-tweaks}}, the only visual configuration available is through Settings &amp;gt; Appearance. See [[GTK#Themes]] for setting a GTK theme other than Adwaita or Adwaita-dark.}}&lt;br /&gt;
&lt;br /&gt;
GNOME uses Adwaita by default. To apply Adwaita-dark only to GTK 2 applications, use the following symlink:&lt;br /&gt;
&lt;br /&gt;
 $ ln -s /usr/share/themes/Adwaita-dark ~/.themes/Adwaita&lt;br /&gt;
&lt;br /&gt;
{{Note|The Adwaita-dark theme is provided by {{Pkg|gnome-themes-extra}} which may not be installed on a minimal installation of GNOME.}}&lt;br /&gt;
&lt;br /&gt;
To select new themes (move them to the appropriate directory and) use GNOME Tweaks or the GSettings commands below.&lt;br /&gt;
&lt;br /&gt;
For the GTK theme:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.desktop.interface gtk-theme &#039;&#039;theme-name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the icon theme:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.desktop.interface icon-theme &#039;&#039;theme-name&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{Note|The window manager theme follows the GTK theme. Using {{ic|org.gnome.desktop.wm.preferences theme}} is deprecated and ignored.}}&lt;br /&gt;
&lt;br /&gt;
See [[GTK#Themes]] and [[Icons#Icon themes]].&lt;br /&gt;
&lt;br /&gt;
===== Titlebar button order =====&lt;br /&gt;
&lt;br /&gt;
To set the order for the GNOME window manager (Mutter, Metacity):&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.desktop.wm.preferences button-layout &#039;:minimize,maximize,close&#039;&lt;br /&gt;
&lt;br /&gt;
{{Tip|The colon indicates which side of the titlebar the window buttons will appear.}}&lt;br /&gt;
&lt;br /&gt;
===== GNOME Shell themes =====&lt;br /&gt;
&lt;br /&gt;
The theme of GNOME Shell itself is configurable. To use a Shell theme, firstly ensure that you have the {{Pkg|gnome-shell-extensions}} package installed. Then enable the &#039;&#039;User Themes&#039;&#039; extension, either through the GNOME Extensions application or through the [https://extensions.gnome.org GNOME Shell Extensions] webpage. Shell themes can then be loaded and selected using GNOME Extensions.&lt;br /&gt;
&lt;br /&gt;
There are a number of GNOME Shell themes available [https://aur.archlinux.org/packages?K=gtk+theme in the AUR], many themes do not have the same name format, so instead try searching for the appropriate theme in the AUR. Shell themes can also be downloaded from [https://gnome-look.org/ gnome-look.org].&lt;br /&gt;
&lt;br /&gt;
===== AppIndicators/Top bar icons =====&lt;br /&gt;
&lt;br /&gt;
To enable AppIndicators, which is useful for controlling/monitoring certain applications running in the background, Install {{Pkg|gnome-shell-extension-appindicator}} or {{AUR|gnome-shell-extension-appindicator-git}}, [[#Navigation|restart the GNOME Shell]], then enable the AppIndicator extension in the GNOME Extensions application or by running &lt;br /&gt;
&lt;br /&gt;
 $ gnome-extensions enable $(gnome-extensions list {{!}} grep -m 1 appindicatorsupport)&lt;br /&gt;
&lt;br /&gt;
===== Shell animation speed =====&lt;br /&gt;
&lt;br /&gt;
The GNOME shell animation can be sped up, slowed down or disabled. See [[GNOME/Tips and tricks#Change animation speed]].&lt;br /&gt;
&lt;br /&gt;
===== Shell blur =====&lt;br /&gt;
&lt;br /&gt;
Blur my Shell is an extension that adds blur effects to the overview screen as well as the shell itself and other apps. Install {{AUR|gnome-shell-extension-blur-my-shell}} or {{AUR|gnome-shell-extension-blur-my-shell-git}} for development updates. This extension is highly customizable, and you may choose to blur certain applications.&lt;br /&gt;
&lt;br /&gt;
===== Better Alt-Tab Functionality =====&lt;br /&gt;
&lt;br /&gt;
The default Alt-Tab in GNOME is very simple and does not show overviews of the selected windows. You can change the Alt-Tab shortcut from &amp;quot;Switch Applications&amp;quot; to &amp;quot;Switch Windows&amp;quot; in Settings to show window overviews. &lt;br /&gt;
&lt;br /&gt;
You can also use Coverflow Alt-Tab. It is an extension that expands the Alt-Tab behavior and adds features to make switching between applications easier while also giving it a better look. Install {{AUR|gnome-shell-extension-coverflow-alt-tab-git}}, then you may change the configuration of this extension to your liking.&lt;br /&gt;
&lt;br /&gt;
Note: Super-` provides &amp;quot;Switch windows of an application` by default.&lt;br /&gt;
&lt;br /&gt;
==== Autostart ====&lt;br /&gt;
&lt;br /&gt;
GNOME implements [[XDG Autostart]].&lt;br /&gt;
&lt;br /&gt;
The {{Pkg|gnome-tweaks}} allows managing autostart-entries.&lt;br /&gt;
&lt;br /&gt;
{{Tip|1=If the plus sign button in the Tweaks&#039;s Startup Applications section is unresponsive, try starting the Tweaks from the terminal using the following command: {{ic|gnome-tweaks}}. See the following [https://bbs.archlinux.org/viewtopic.php?pid=1413631#p1413631 forum thread].}}&lt;br /&gt;
&lt;br /&gt;
==== Desktop ====&lt;br /&gt;
&lt;br /&gt;
===== Dash to Dock =====&lt;br /&gt;
&lt;br /&gt;
To move the dash out of the overview and turn it into a dock to easily launch and switch applications, [[install]] {{AUR|gnome-shell-extension-dash-to-dock}}.&lt;br /&gt;
&lt;br /&gt;
===== Startup in Overview Mode =====&lt;br /&gt;
&lt;br /&gt;
Starting from GNOME 40, the desktop will start directly into Overview Mode instead of an empty desktop (like in previous versions). To mimic legacy behaviour, one may [[install]] {{AUR|gnome-shell-extension-no-overview}}.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can disable it using gsettings if using {{AUR|gnome-shell-extension-dash-to-dock}}:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.shell.extensions.dash-to-dock disable-overview-on-startup true&lt;br /&gt;
&lt;br /&gt;
See the discussion at [https://discourse.gnome.org/t/gnome-40-login-is-to-the-activities-overview-mode-how-do-you-disable-this/5783].&lt;br /&gt;
&lt;br /&gt;
==== Clipboard history ====&lt;br /&gt;
&lt;br /&gt;
Unlike other desktop environments, GNOME does not have a built-in tool to manage the clipboard history. This can be done however with the help of an extension. Install {{AUR|gnome-shell-extension-clipboard-indicator}}.&lt;br /&gt;
&lt;br /&gt;
==== Weather ====&lt;br /&gt;
&lt;br /&gt;
To display the current weather information in the top panel based on a chosen location, install {{AUR|gnome-shell-extension-openweather}}. The weather information is updated in real-time and displays useful data such as conditions, wind speed, pressure, etc...&lt;br /&gt;
&lt;br /&gt;
==== Sound input/output device selector ====&lt;br /&gt;
{{Remove|Probably not needed anymore. [https://github.com/kgshank/gse-sound-output-device-chooser Packages compatible] up to Gnome 43 only.}}&lt;br /&gt;
By default, if you want to change your sound input or output device or change your microphone&#039;s volume, you need to open GNOME Control Center and configure these settings from there. To integrate a device selector and a microphone volume slider, install {{AUR|gnome-shell-extension-sound-output-device-chooser}} or {{AUR|gnome-shell-extension-sound-output-device-chooser-git}}. Further configuration can be done after installation.&lt;br /&gt;
&lt;br /&gt;
==== Fonts ====&lt;br /&gt;
&lt;br /&gt;
{{Tip|If you set the &#039;&#039;Scaling factor&#039;&#039; to a value above 1.00, the Accessibility menu will be automatically enabled.}}&lt;br /&gt;
&lt;br /&gt;
Fonts can be set for Window titles, Interface (applications), Documents and Monospace. See the Fonts tab in the Tweaks for the relevant options.&lt;br /&gt;
&lt;br /&gt;
For hinting, RGBA will likely be desired as this fits most monitors types, and if fonts appear too blocked reduce hinting to &#039;&#039;Slight&#039;&#039; or &#039;&#039;None&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Input methods ====&lt;br /&gt;
&lt;br /&gt;
GNOME has integrated support for [[input method]]s through [[IBus]]. Only {{Pkg|ibus}} and the wanted input method engine (e.g. {{Pkg|ibus-libpinyin}} for Intelligent Pinyin) needed to be installed. After installation, the input method engine can be added as a keyboard layout under &#039;&#039;Keyboard &amp;gt; Input Sources&#039;&#039; in GNOME Settings (&#039;&#039;gnome-control-center&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
==== Keyboard Layout quirks ====&lt;br /&gt;
&lt;br /&gt;
If you are using an alternative keyboard layout like Neo2 which uses multiple layers/modifiers, you might need to go to &#039;&#039;Keyboard &amp;gt; Type Special Characters&#039;&#039; in GNOME Settings (&#039;&#039;gnome-control-center&#039;&#039;) and change the &#039;&#039;Alternate Characters Key&#039;&#039; away from &#039;&#039;Right Alt&#039;&#039; so that it can be used as a native modifier of the keyboard layout. Setting it to e.g. &#039;&#039;Left Alt&#039;&#039; prevents &#039;&#039;Alt+Tab&#039;&#039;, so be careful what you change it to.&lt;br /&gt;
Without this change, your left &#039;&#039;Mod3&#039;&#039; key might work, but the right one (&#039;&#039;AltGr&#039;&#039;) does not. (As of 2021-05-18)&lt;br /&gt;
&lt;br /&gt;
==== Power ====&lt;br /&gt;
&lt;br /&gt;
When you are using a laptop, you might want to alter the following settings controlling behavior when idle, screen lock power button presses and lid close:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout &#039;&#039;3600&#039;&#039;&lt;br /&gt;
 $ gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type &#039;&#039;hibernate&#039;&#039;&lt;br /&gt;
 $ gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout &#039;&#039;1800&#039;&#039;&lt;br /&gt;
 $ gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type &#039;&#039;hibernate&#039;&#039;&lt;br /&gt;
 $ gsettings set org.gnome.settings-daemon.plugins.power power-button-action &#039;&#039;suspend&#039;&#039;&lt;br /&gt;
 $ gsettings set org.gnome.desktop.lockdown disable-lock-screen &#039;&#039;true&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To keep the monitor active when the lid is closed:&lt;br /&gt;
&lt;br /&gt;
 $ gsettings set org.gnome.settings-daemon.plugins.xrandr default-monitors-setup do-nothing&lt;br /&gt;
&lt;br /&gt;
GNOME 3.24 deprecated the following settings:&lt;br /&gt;
&lt;br /&gt;
 org.gnome.settings-daemon.plugins.power button-hibernate&lt;br /&gt;
 org.gnome.settings-daemon.plugins.power button-power&lt;br /&gt;
 org.gnome.settings-daemon.plugins.power button-sleep&lt;br /&gt;
 org.gnome.settings-daemon.plugins.power button-suspend&lt;br /&gt;
 org.gnome.settings-daemon.plugins.power critical-battery-action&lt;br /&gt;
&lt;br /&gt;
===== Do not suspend when laptop lid is closed =====&lt;br /&gt;
&lt;br /&gt;
The settings panel of GNOME does not provide an option for the user to change the action triggered when the laptop lid is closed. To change the lid switch action system-wide, edit the systemd settings in {{ic|/etc/systemd/logind.conf}}. To turn off suspend on lid close, set {{ic|1=HandleLidSwitch=ignore}}, as described in [[Power management#ACPI events]].&lt;br /&gt;
&lt;br /&gt;
===== Change critical battery level action =====&lt;br /&gt;
&lt;br /&gt;
The settings panel does not provide an option for changing the critical battery level action. These settings have been removed from dconf as well. They are now managed by upower. Edit the upower settings in {{ic|/etc/UPower/UPower.conf}}. Find these settings and adjust to your needs.&lt;br /&gt;
&lt;br /&gt;
{{hc|head=/etc/UPower/UPower.conf|output=&lt;br /&gt;
PercentageLow=10&lt;br /&gt;
PercentageCritical=3&lt;br /&gt;
PercentageAction=2&lt;br /&gt;
CriticalPowerAction=HybridSleep&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===== Power modes =====&lt;br /&gt;
&lt;br /&gt;
Install the [[power-profiles-daemon]] optional dependency (of {{Pkg|gnome-control-center}}) for power profiles support. Explicitly [[starting/enabling]] the {{ic|power-profiles-daemon}} service is unnecessary since &#039;&#039;gnome-shell&#039;&#039; and GNOME Settings both request its activation upon launching.&lt;br /&gt;
&lt;br /&gt;
When the service is active, power profiles can be managed through the &#039;&#039;Power&#039;&#039; section of GNOME Settings and in the system menu.&lt;br /&gt;
&lt;br /&gt;
==== Screencast ====&lt;br /&gt;
&lt;br /&gt;
The built-in screenshot tool comes without the Screencast option by default. Install the {{Pkg|gst-plugin-pipewire}} optional dependency (of {{Pkg|gnome-shell}}) to enable screen recording.&lt;br /&gt;
&lt;br /&gt;
=== Use a different window manager ===&lt;br /&gt;
&lt;br /&gt;
GNOME Shell does not support using a different [[window manager]], however [[GNOME Flashback]] provides sessions for Metacity and [[Compiz]]. Furthermore, it is possible to define your own [[GNOME/Tips and tricks#Custom GNOME sessions|custom GNOME sessions]] which use alternative components.&lt;br /&gt;
&lt;br /&gt;
Replacing GNOME Shell with a different [[Wayland compositor]] will cause certain sections of {{Pkg|gnome-control-center}} (GNOME Settings) to populate incorrectly. &#039;&#039;gnome-control-center&#039;&#039; will work, but since {{Pkg|mutter}} (GNOME Shell) will not be available to provide settings for populating these sections, they will not have an effect or may not populate accurately with your settings. Sections affected are bluetooth, display, and mouse/touchpad to name a few.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.gnome.org/ Official Website]&lt;br /&gt;
* [https://blogs.gnome.org/tbernard/2021/06/15/community-power-2/ Contributing to GNOME, feature requests, bugs, code]&lt;br /&gt;
* [[Wikipedia:GNOME|Wikipedia article]]&lt;br /&gt;
* [https://extensions.gnome.org/ GNOME-Shell Extensions]&lt;br /&gt;
* [https://wiki.gnome.org/Projects/GnomeShell/CheatSheet GNOME Shell Cheat Sheet]&lt;br /&gt;
* Customization (themes, icons...):&lt;br /&gt;
** [https://wiki.gnome.org/Personalization Personalize GNOME]&lt;br /&gt;
** [https://www.gnome-look.org/ GNOME Look]&lt;br /&gt;
* GNOME applications:&lt;br /&gt;
** [https://wiki.gnome.org/Apps GNOME Apps Index]&lt;br /&gt;
** [[Wikipedia:GNOME Core Applications]]&lt;br /&gt;
* GNOME Source/Mirrors:&lt;br /&gt;
** [https://gitlab.gnome.org/ GNOME GitLab]&lt;br /&gt;
** [https://github.com/GNOME GNOME Github Mirror]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Rsyslog&amp;diff=873238</id>
		<title>Rsyslog</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Rsyslog&amp;diff=873238"/>
		<updated>2026-05-07T14:11:21Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Enabling and starting service */ apply Help:Style#systemd units operations; the error reads like an old and remedied systemd issue, can&amp;#039;t check it&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Lowercase title}}&lt;br /&gt;
[[Category:Logging]]&lt;br /&gt;
[[ja:Rsyslog]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|syslog-ng}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
&lt;br /&gt;
{{Out of date|References out of date documentation}}&lt;br /&gt;
&lt;br /&gt;
[https://www.rsyslog.com rsyslog] is a [[w:syslog|syslog]] implementation that offers many benefits over [[syslog-ng]]. It can be configured to receive log entries from [[systemd/Journal|systemd&#039;s journal]] in order to process or filter them before quickly writing them to disk or sending them over network.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
{{Note|It is recommended to disable and uninstall the {{Pkg|syslog-ng}} package to prevent possible conflicts.}}&lt;br /&gt;
&lt;br /&gt;
[[Install]] the {{AUR|rsyslog}} package.&lt;br /&gt;
&lt;br /&gt;
=== Enabling and starting service ===&lt;br /&gt;
&lt;br /&gt;
After installation, [[enable]] {{ic|rsyslog.service}} and [[start]] it afterwards.&lt;br /&gt;
&lt;br /&gt;
Starting the {{ic|rsyslog.service}} unit first would likely fail, because enabling the service creates a symlink for {{ic|syslog.service}} which would be missing otherwise; {{ic|rsyslog.service}} would raise the error: {{bc|1=rsyslog.service: Job rsyslog.service/start failed with result &#039;dependency&#039;}}&lt;br /&gt;
&lt;br /&gt;
=== Configure hostname ===&lt;br /&gt;
&lt;br /&gt;
Rsyslog uses the {{Pkg|glibc}} routine {{ic|gethostname()}} or {{ic|gethostbyname()}} to determine the hostname of the local machine. The {{ic|gethostname()}} or {{ic|gethostbyname()}} routine check the contents of {{ic|/etc/hosts}} for the fully qualified domain name (FQDN) if you are not using [[BIND]] or [[NIS]].&lt;br /&gt;
&lt;br /&gt;
You can check what the local machine&#039;s currently configured FQDN is by running {{ic|hostname --fqdn}}. The output of {{ic|hostname --short}} will be used by rsyslog when writing log messages. If you want to have full hostnames in logs, you need to add {{ic|$PreserveFQDN on}} to the beginning of the file (before using any directive that write to files). This is because, rsyslog reads its configuration file and applies it on-the-go and then reads the later lines. &lt;br /&gt;
&lt;br /&gt;
The {{ic|/etc/hosts}} file contains a number of lines that map FQDNs to IP addresses and that map aliases to FQDNs. See the example {{ic|/etc/hosts}} file below:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/hosts|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#&amp;lt;ip-address&amp;gt;    &amp;lt;hostname.domain.org&amp;gt; &amp;lt;hostname&amp;gt;&lt;br /&gt;
#&amp;lt;ip-address&amp;gt;    &amp;lt;actual FQDN&amp;gt; &amp;lt;aliases&amp;gt;&lt;br /&gt;
127.0.0.1        localhost.localdomain somehost.localdomain localhost somehost&lt;br /&gt;
::1              localhost.localdomain somehost.localdomain localhost somehost&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{ic|localhost.localdomain}} is the first item following the IP address, so {{ic|gethostbyname()}} function will return &#039;&#039;&#039;localhost.localdomain&#039;&#039;&#039; as the local machine&#039;s FQDN. Then {{ic|/var/log/messages}} file will use &#039;&#039;&#039;localhost&#039;&#039;&#039; as hostname.&lt;br /&gt;
&lt;br /&gt;
To use &#039;&#039;&#039;somehost&#039;&#039;&#039; as the hostname. Move &#039;&#039;&#039;somehost.localdomain&#039;&#039;&#039; to the first item:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/hosts|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
#&amp;lt;ip-address&amp;gt;    &amp;lt;hostname.domain.org&amp;gt; &amp;lt;hostname&amp;gt;&lt;br /&gt;
#&amp;lt;ip-address&amp;gt;    &amp;lt;actual FQDN&amp;gt; &amp;lt;aliases&amp;gt;&lt;br /&gt;
127.0.0.1        somehost.localdomain localhost.localdomain localhost somehost&lt;br /&gt;
::1              somehost.localdomain localhost.localdomain localhost somehost&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
rsyslog is configured in {{ic|/etc/rsyslog.conf}}. See [https://www.rsyslog.com/doc/v8-stable/configuration/index.html the official documentation] for more information on the available configuration options.&lt;br /&gt;
&lt;br /&gt;
By default, all syslog messages are handled by [[systemd/Journal|systemd&#039;s journal]]. In order to gather system logs in rsyslog, you either have to turn on [[#journald&#039;s syslog-forward feature]] or use the [[#imjournal]] module of rsyslog to gather the logs by importing it from the systemd journald.&lt;br /&gt;
&lt;br /&gt;
=== imjournal ===&lt;br /&gt;
&lt;br /&gt;
If you want rsyslog to pull messages from systemd, load the &#039;&#039;imjournal&#039;&#039; module:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/rsyslog.conf|&lt;br /&gt;
$ModLoad imjournal&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
See [https://www.rsyslog.com/doc/v8-stable/configuration/modules/imjournal.html the documentation on the imjournal input module] for more information.&lt;br /&gt;
&lt;br /&gt;
=== journald&#039;s syslog-forward feature ===&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/systemd/journald.conf|&lt;br /&gt;
&amp;lt;nowiki&amp;gt;ForwardToSyslog=yes&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Log output can be fine tuned in {{ic|/etc/rsyslog.conf}}. The daemon uses Facility levels (see below) to determine what gets put where. For example:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/rsyslog.conf|&lt;br /&gt;
# The authpriv file has restricted access.&lt;br /&gt;
authpriv.*                                              /var/log/secure&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
States that all messages falling under the &#039;&#039;&#039;authpriv&#039;&#039;&#039; facility are logged to {{ic|/var/log/secure}}.&lt;br /&gt;
&lt;br /&gt;
Another example, which would be similar to the behaviour of &#039;&#039;syslog-ng&#039;&#039; for the old {{ic|auth.log}}:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/rsyslog.conf|&lt;br /&gt;
auth.*                                                  -/var/log/auth&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
See [[Systemd/Journal#Journald in conjunction with syslog]] for more information.&lt;br /&gt;
&lt;br /&gt;
== Facility levels ==&lt;br /&gt;
&lt;br /&gt;
{{Note|The mapping between Facility Number and Keyword is not uniform over different operating systems and different syslog implementations. Use the keyword where possible, until it is determined which numbers are used by Arch.}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Facility Number !! Keyword !! Facility Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || kern || kernel messages&lt;br /&gt;
|-&lt;br /&gt;
| 1 || user || user-level messages&lt;br /&gt;
|-&lt;br /&gt;
| 2 || mail || mail system&lt;br /&gt;
|-&lt;br /&gt;
| 3 || daemon || system daemons&lt;br /&gt;
|-&lt;br /&gt;
| 4 || auth || security/authorization messages&lt;br /&gt;
|-&lt;br /&gt;
| 5 || syslog || messages generated internally by syslogd&lt;br /&gt;
|-&lt;br /&gt;
| 6 || lpr || line printer subsystem&lt;br /&gt;
|-&lt;br /&gt;
| 7 || news ||  network news subsystem&lt;br /&gt;
|-&lt;br /&gt;
| 8 || uucp || UUCP subsystem&lt;br /&gt;
|-&lt;br /&gt;
| 9 || || clock daemon&lt;br /&gt;
|-&lt;br /&gt;
| 10 || authpriv || security/authorization messages&lt;br /&gt;
|-&lt;br /&gt;
| 11 || ftp || FTP daemon&lt;br /&gt;
|-&lt;br /&gt;
| 12 || - || NTP subsystem&lt;br /&gt;
|-&lt;br /&gt;
| 13 || - || log audit&lt;br /&gt;
|-&lt;br /&gt;
| 14 || - || log alert&lt;br /&gt;
|-&lt;br /&gt;
| 15 || cron || clock daemon&lt;br /&gt;
|-&lt;br /&gt;
| 16 || local0 || local use 0  (local0)&lt;br /&gt;
|-&lt;br /&gt;
| 17 || local1 || local use 1  (local1)&lt;br /&gt;
|-&lt;br /&gt;
| 18 || local2 || local use 2  (local2)&lt;br /&gt;
|-&lt;br /&gt;
| 19 || local3 || local use 3  (local3)&lt;br /&gt;
|-&lt;br /&gt;
| 20 || local4 || local use 4  (local4)&lt;br /&gt;
|-&lt;br /&gt;
| 21 || local5 || local use 5  (local5)&lt;br /&gt;
|-&lt;br /&gt;
| 22 || local6 || local use 6  (local6)&lt;br /&gt;
|-&lt;br /&gt;
| 23 || local7 || local use 7  (local7)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Severity levels ==&lt;br /&gt;
&lt;br /&gt;
As defined in [[RFC:5424|RFC 5424]], there are eight severity levels:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Code !! Severity !! Keyword !! Description !! General Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Emergency || emerg (panic) || System is unusable. || A &amp;quot;panic&amp;quot; condition usually affecting multiple apps/servers/sites. At this level it  would usually notify all tech staff on call.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Alert || alert || Action must be taken immediately. || Should be corrected immediately, therefore notify staff who can fix the problem. An example would be the loss of a primary ISP connection.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Critical || crit || Critical conditions. || Should be corrected immediately, but indicates failure in a primary system, an example is a loss of a backup ISP connection.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Error || err (error) || Error conditions. || Non-urgent failures, these should be relayed to developers or admins; each item must be resolved within a given time.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Warning || warning (warn) || Warning conditions. || Warning messages, not an error, but indication that an error will occur if action is not taken, e.g. file system 85% full - each item must be resolved within a given time.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Notice || notice || Normal but significant condition. || Events that are unusual but not error conditions - might be summarized in an email to developers or admins to spot potential problems - no immediate action required.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Informational || info || Informational messages. || Normal operational messages - may be harvested for reporting, measuring throughput, etc. - no action required.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Debug || debug || Debug-level messages. || Info useful to developers for debugging the application, not useful during operations.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Tip|A common mnemonic used to remember the syslog levels in reverse order: &amp;quot;Do I Notice When Evenings Come Around Early&amp;quot;.}}&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== journald with rsyslog for kernel messages ===&lt;br /&gt;
&lt;br /&gt;
{{Style|Redundant instructions, systemd commands...}}&lt;br /&gt;
&lt;br /&gt;
Since the syslog component of systemd, journald, does not flush its logs to disk during normal operation, these logs will be gone when the machine is shut down abnormally (power loss, kernel lock-ups, ...). In the case of kernel lock-ups, it can be important to have some kernel logs for debugging. Until journald gains a configuration option for flushing kernel logs, rsyslog can be used in conjunction with journald.&lt;br /&gt;
&lt;br /&gt;
Summary of requirements:&lt;br /&gt;
&lt;br /&gt;
* journald must still get all log messages.&lt;br /&gt;
* rsyslog must only log kernel messages, all other logs are handled by journald.&lt;br /&gt;
* Kernel logs must be logged separatedly to {{ic|/var/log/kernel.log}}.&lt;br /&gt;
* Use systemd to start the service.&lt;br /&gt;
&lt;br /&gt;
Installation and configuration steps:&lt;br /&gt;
&lt;br /&gt;
# Install {{AUR|rsyslog}}.&lt;br /&gt;
# Edit {{ic|/etc/logrotate.d/rsyslog}} and add {{ic|/var/log/kernel.log}} to the list of logs. Without this modification, the kernel log would grow indefinitely.&lt;br /&gt;
# Edit {{ic|/etc/rsyslog.conf}} and comment everything except for {{ic|$ModLoad imklog}}. If a heart-beat (repeated confirmation that the log is alive) is preferred, {{ic|$ModLoad immark}} should remain uncommented as well.&lt;br /&gt;
# Add the next line to the same configuration file:&lt;br /&gt;
#:{{bc|kern.*     /var/log/kernel.log;RSYSLOG_TraditionalFileFormat}}&lt;br /&gt;
#:The {{ic|kern.*}} part catches all messages originating from the kernel. {{ic|;RSYSLOG_TraditionalFileFormat}} is used here to use a less verbose date format. By default, a date format like {{ic|2013-03-09T19:29:33.103897+01:00}} is used. Since the kernel log contains a precision already (printk time) and the actual log time is irrelevant, a format like {{ic|Mar  9 19:29:13}} might be preferred.&lt;br /&gt;
# Since rsyslog should operate completely separated from systemd, remove the option that shares a socket with systemd:&lt;br /&gt;
#:{{bc|1=# sed &#039;s/^Sockets=/#&amp;amp;/&#039; /usr/lib/systemd/system/rsyslog.service &amp;gt; /etc/systemd/system/rsyslog.service}}&lt;br /&gt;
# Next, make rsyslog start on boot and start it for this session by [[start]]ing and enabling {{ic|rsyslog.service}}.&lt;br /&gt;
&lt;br /&gt;
{{note|rsyslog reads from {{ic|/proc/kmsg}}. This means that subsequent reads from that file (either the user or a syslog daemon) will not read &amp;quot;old&amp;quot; logs from that file anymore. journald is not affected as it reads from {{ic|/dev/kmsg}} which allows multiple readers.}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.rsyslog.com/doc/v8-stable/ Rsyslog manual]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=KeePass&amp;diff=873141</id>
		<title>KeePass</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=KeePass&amp;diff=873141"/>
		<updated>2026-05-06T18:21:45Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Configuration with KeePass */ remove OOD; done&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Password managers]]&lt;br /&gt;
[[ja:KeePass]]&lt;br /&gt;
[[pt:KeePass]]&lt;br /&gt;
[[ru:KeePass]]&lt;br /&gt;
KeePass is an encrypted password database format. It is an alternative to online password managers and is supported on all major platforms.&lt;br /&gt;
&lt;br /&gt;
There are two versions of the format: &#039;&#039;KeePass 1.x (Classic)&#039;&#039; and &#039;&#039;KeePass 2.x&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
There are three major implementations of KeePass available in the official repositories:&lt;br /&gt;
&lt;br /&gt;
* {{App|[[Wikipedia:KeePass|KeePass]]|A cross-platform password manager that has autotype and clipboard support when respectively {{Pkg|xdotool}} and {{Pkg|xsel}} are installed. It lets you import [https://keepass.info/help/base/importexport.html many formats] and has [https://keepass.info/plugins.html many plugins].|https://keepass.info|{{Pkg|keepass}}}}&lt;br /&gt;
* {{App|[[Wikipedia:KeePassXC|KeePassXC]]|Fork of KeePassX that is actively maintained and has additional features like browser integration, support for SSH agent, secret service, Yubikey, finger-print reader, TOTP generator and KeeShare. Also provides a CLI through {{ic|keepassxc-cli}}.|https://keepassxc.org|{{Pkg|keepassxc}}}}&lt;br /&gt;
* {{App|{{Pkg|secrets}}|A modern GNOME password manager built on top of KeePass.|https://gitlab.gnome.org/World/secrets/|{{Pkg|secrets}}}}&lt;br /&gt;
&lt;br /&gt;
Other lesser-known alternatives can be found in the AUR:&lt;br /&gt;
&lt;br /&gt;
* {{App|keepassc|A curses-based password manager compatible to KeePass v.1.x and KeePassX. It uses {{ic|xsel}} for clipboard functions.|https://raymontag.github.io/keepassc/|{{AUR|keepassc}}}}&lt;br /&gt;
* {{App|kpcli|A command line interface for KeePass database files {{ic|*.kdb}} or {{ic|*.kdbx}}.|https://sourceforge.net/projects/kpcli/|{{AUR|kpcli}}}}&lt;br /&gt;
* {{App|keepmenu|Dmenu/Rofi frontend for Keepass database files.|https://github.com/firecat53/keepmenu|{{AUR|keepmenu}}}}&lt;br /&gt;
* {{App|AuthPass|KeePass compatible password manager based on Flutter. Comes with default sync suport for Gdrive, Dropbox, and WebDav.|https://authpass.app|{{AUR|authpass-bin}}}}&lt;br /&gt;
* {{App|keeweb|A web app (online / Electron) compatible with KeePass 2.x. KeeWeb comes with default Sync support for major cloud services, Gdrive, Onedrive, Dropbox etc. No active development since release of 1.18.7 on July 18th 2021.|https://keeweb.info|{{AUR|keeweb}} {{AUR|nextcloud-app-keeweb}} {{AUR|keeweb-desktop-bin}}}}&lt;br /&gt;
* {{App|[[Wikipedia:KeePassX|KeePassX]]|Started as a Linux port of KeePass. {{AUR|keepassx2}} uses the KeePass 2.x format, but can import 1.x databases. It also lets you import PwManager and KWallet XML databases. It does not support plugins. [https://www.keepassx.org/faq] No active development since 2016. [https://dev.keepassx.org/projects/keepassx/repository/revisions] |https://www.keepassx.org/|{{AUR|keepassx}} {{AUR|keepassx2}}}}&lt;br /&gt;
&lt;br /&gt;
== Integration ==&lt;br /&gt;
&lt;br /&gt;
Many [https://keepass.info/plugins.html plugins and extensions] are available for integrating KeePass to other software. KeePassX and KeePassXC do not have a plugin interface, but KeePassXC has various integrations built-in.&lt;br /&gt;
&lt;br /&gt;
=== Plugin installation in KeePass ===&lt;br /&gt;
&lt;br /&gt;
KeePass is by default installed at {{ic|/usr/share/keepass/}}. Copy {{ic|plugin.plgx}} to a plugins sub-directory under the KeePass installation directory as demonstrated below:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
# mkdir /usr/share/keepass/plugins&lt;br /&gt;
# cp plugin.plgx /usr/share/keepass/plugins&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Browser integration ===&lt;br /&gt;
&lt;br /&gt;
==== keepassxc-browser for KeePassXC ====&lt;br /&gt;
&lt;br /&gt;
[https://github.com/keepassxreboot/keepassxc-browser keepassxc-browser] is the browser extension of KeePassXC’s built-in browser integration using native-messaging and transport encryption using libsodium. It was developed to replace KeePassHTTP, as KeePassHTTP’s protocol has fundamental security problems.&lt;br /&gt;
&lt;br /&gt;
The developers provide the browser extension on&lt;br /&gt;
&lt;br /&gt;
* [https://addons.mozilla.org/firefox/addon/keepassxc-browser/ Firefox Add-ons] (for [[Firefox]] and [[Tor Browser]]) and&lt;br /&gt;
* in the [https://chrome.google.com/webstore/detail/keepassxc-browser/oboonakemofpalcgghocfoadofidjkkk chrome web store] (for [[Chromium]], [[Google Chrome]], [[Vivaldi]] and [[Brave]]).&lt;br /&gt;
&lt;br /&gt;
Support for Firefox and Chromium forks is available. For {{AUR|librewolf}}, open KeePassXC, go to &#039;&#039;Tools&#039;&#039; &amp;gt; &#039;&#039;Settings&#039;&#039; &amp;gt; &#039;&#039;Browser Integration&#039;&#039; &amp;gt; &#039;&#039;Advanced&#039;&#039; &amp;gt; &#039;&#039;Config Location:&#039;&#039;, and add {{ic|~/.librewolf/native-messaging-hosts}}.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/keepassxreboot/keepassxc-browser source code and an explanation how it works] can be found on GitHub, the KeePassXC developers provide a [https://keepassxc.org/docs/KeePassXC_GettingStarted.html#_configure_keepassxc_browser configuration guide] on their website.&lt;br /&gt;
&lt;br /&gt;
==== KeePassRPC and Kee ====&lt;br /&gt;
&lt;br /&gt;
[https://www.kee.pm/ Kee] ([https://github.com/kee-org/browser-addon GitHub repo]) is a browser extension for [[Firefox]] and [[Chromium]] which integrates KeePass through [https://github.com/kee-org/keepassrpc KeePassRPC], a KeePass plugin from the same developers.&lt;br /&gt;
&lt;br /&gt;
The KeePass plugin is available from [https://github.com/kee-org/keepassrpc/releases GitHub] or from the AUR ({{aur|keepass-plugin-rpc}}).&lt;br /&gt;
&lt;br /&gt;
The browser extension can be found on [https://github.com/kee-org/browser-addon/releases GitHub], [https://addons.mozilla.org/firefox/addon/keefox/ Firefox Add-ons] and the [https://chrome.google.com/webstore/detail/kee-password-manager/mmhlniccooihdimnnjhamobppdhaolme chrome web store].&lt;br /&gt;
&lt;br /&gt;
==== Via autotype feature ====&lt;br /&gt;
&lt;br /&gt;
An alternative to having a direct channel between browser and KeePass(XC) is using the autotype feature.&lt;br /&gt;
&lt;br /&gt;
To enable the autotype feature on Wayland, force KeePass(XC) to fallback to X11. [[Textedit|Edit]] {{ic|/usr/share/applications/org.keepassxc.KeePassXC.desktop}} and change the value of {{ic|Exec}} to {{ic|keepassxc -platform xcb}}. Alternatively, set the {{ic|1=QT_QPA_PLATFORM=xcb}} [[environment variable]] before launching KeePassXC. However, native Wayland applications will not work with autotype. For example, autotype works when running Firefox without Wayland, but not with.&lt;br /&gt;
&lt;br /&gt;
There are browser extensions which support this way by putting the page URL into the window name:&lt;br /&gt;
&lt;br /&gt;
* [https://addons.mozilla.org/firefox/addon/keepass-helper-url-in-title/ KeePass Helper] or [https://addons.mozilla.org/firefox/addon/url-in-title/ TitleURL] for [[Firefox]]&lt;br /&gt;
* [https://chrome.google.com/webstore/detail/url-in-title/ignpacbgnbnkaiooknalneoeladjnfgb URL in title] for [[Chromium]]&lt;br /&gt;
&lt;br /&gt;
{{Warning|Auto typing has its own risks and limitations, therefore check the technical documentation of the password safe you are using: [https://keepass.info/help/base/faq_tech.html#autotypelog KeePass], [https://keepassxc.org/docs/#faq-autotype KeePassXC].}}&lt;br /&gt;
&lt;br /&gt;
=== Yubikey ===&lt;br /&gt;
&lt;br /&gt;
[[YubiKey]] can be integrated with KeePass thanks to contributors of KeePass plugins. KeepassXC provides built-in support for Yubikey Challenge-Response without plugins.&lt;br /&gt;
&lt;br /&gt;
==== Configuration with KeePass ====&lt;br /&gt;
&lt;br /&gt;
For an explanation of the configuration options, see https://keepass.info/help/kb/yubikey.html.&lt;br /&gt;
&lt;br /&gt;
# StaticPassword&lt;br /&gt;
#:Configure one of Yubikey slots to store static password. You can make the password as strong as 65 characters (64 characters with leading &amp;quot;!&amp;quot;). This password can then be used as master password for your KeePass database.&lt;br /&gt;
# One-time passwords (OATH-HOTP)&lt;br /&gt;
## Download plugin from KeePass website: https://keepass.info/plugins.html#otpkeyprov&lt;br /&gt;
## Setup the [[YubiKey#OTP_slot_implementation|Yubikey OATH-HOTP slot]] (program the same, if a backup Yubikey is used)&lt;br /&gt;
## In advanced mode untick &#039;&#039;OATH Token Identifier&#039;&#039;&lt;br /&gt;
## In KeePass additional option will show up under &#039;&#039;Key file / provider&#039;&#039; called &#039;&#039;One-Time Passwords (OATH HOTP)&#039;&#039;&lt;br /&gt;
## Copy secret, key length (6 or 8), and counter you set&lt;br /&gt;
## You may need to setup &#039;&#039;Look-ahead count&#039;&#039; option to something greater than 0, please see [https://forum.yubico.com/viewtopicf146.html?f=16&amp;amp;t=1120 this thread] for more information&lt;br /&gt;
## See [https://vimeo.com/94352853 this video] for more help&lt;br /&gt;
#Challenge-Response (HMAC-SHA1)&lt;br /&gt;
## Get the plugin from AUR: {{AUR|keepass-plugin-keechallenge}}&lt;br /&gt;
## In KeePass additional option will show up under &#039;&#039;Key file / provider&#039;&#039; called &#039;&#039;Yubikey challenge-response&#039;&#039;&lt;br /&gt;
## Plugin assumes slot 2 is used&lt;br /&gt;
&lt;br /&gt;
=== SSH agent ===&lt;br /&gt;
&lt;br /&gt;
KeePassXC offers SSH agent support, a similar feature is also available for KeePass using the [https://lechnology.com/software/keeagent/ KeeAgent] plugin.&lt;br /&gt;
&lt;br /&gt;
The feature allows to store SSH keys in KeePass databases, KeePassXC/KeeAgent acts as OpenSSH Client and dynamically adds and removes the key to the Agent.&lt;br /&gt;
&lt;br /&gt;
The feature in KeePassXC is documented in its [https://keepassxc.org/docs/#faq-ssh-agent-how FAQ]. First configure [[SSH agent]] to start on login and make sure the {{ic|SSH_AUTH_SOCK}} variable is set. Then logout and log back in. Now, in KeePassXC settings, enable SSH agent integration. The {{ic|SSH_AUTH_SOCK}} value exposed in the UI should correspond to what you configured earlier.&lt;br /&gt;
&lt;br /&gt;
{{Note|The [[GnuPG#SSH agent|SSH agent emulation of &#039;&#039;gpg-agent&#039;&#039;]] does not support removing keys from the agent on demand using {{ic|ssh-add -d}} or {{ic|ssh-add -D}}, therefore KeePassXC/KeeAgent cannot remove them when locking the database. [https://github.com/keepassxreboot/keepassxc/issues/2029#issuecomment-395933402] [https://unix.stackexchange.com/questions/185393/gpg-agent-doesnt-remove-my-ssh-key-from-the-keyring]}}&lt;br /&gt;
&lt;br /&gt;
=== Secret Service ===&lt;br /&gt;
&lt;br /&gt;
KeePassXC contains a [https://specifications.freedesktop.org/secret-service-spec/latest/ Freedesktop.org Secret Service] integration. It will allow external applications to use KeePassXC as an encrypted database (&#039;&#039;a.k.a.&#039;&#039; as a vault, wallet, or keyring) to store user credentials (&#039;&#039;e.g.&#039;&#039;, messaging applications, games).&lt;br /&gt;
&lt;br /&gt;
It can be enabled by going into the settings (under the &#039;&#039;Tools&#039;&#039; menu), and selecting which group(s) you want to share (&#039;&#039;&#039;for each database&#039;&#039;&#039;, open &#039;&#039;Database &amp;gt; Database Settings...&#039;&#039;, then go to the &#039;&#039;Secret Service Integration&#039;&#039; tab).&lt;br /&gt;
&lt;br /&gt;
KeePassXC will refuse to enable its integration if it detects that another program (such as [[GNOME/Keyring]]) is already providing that service. You should first stop that program (for example, by [[stop]]ping {{ic|gnome-keyring-daemon.service}} [[user unit]] for {{Pkg|gnome-keyring}}). Note that you will likely want to disable the program permanently, otherwise KeePassXC&#039;s integration will fail on the next reboot (for example, by [[disabling]] the {{ic|gnome-keyring-daemon.socket}} of a [[systemd/User]] for {{Pkg|gnome-keyring}}).&lt;br /&gt;
&lt;br /&gt;
{{Tip|To avoid confirmation of every access to the database by other applications, but transparently allow the access like GNOME Keyring or KDE Keyring, you can go to &#039;&#039;Tools &amp;gt; Secret Service Integration&#039;&#039; and uncheck the two &#039;&#039;Confirm when [...]&#039;&#039; checkboxes.}}&lt;br /&gt;
&lt;br /&gt;
An application that requests access to the database will connect to KeePassXC through [[D-Bus]], where KeePassXC will be &amp;quot;seen&amp;quot; just as [https://wiki.gnome.org/Projects/Libsecret GNOME libsecret] by the application. The database that will be exposed can be stored anywhere on the disk, just like any other KeePassXC database, and the master password of this database will be the one to type when applications will want to retrieve a credential in the future.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Note that if an application tries to access the KeePassXC database while it is not already created, the process can appear to &amp;quot;freeze&amp;quot; for one or two minutes because of a timeout, but then a pop-up for database creation will appear.}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|Note that an application (&#039;&#039;e.g.&#039;&#039; Tutanota using Chromium and Electron as backend) can fail to access Chromium&#039;s Safe Storage if the KeePassXC database is not already opened manually by the user or using the D-Bus autostart file.}}&lt;br /&gt;
&lt;br /&gt;
==== Autostart ====&lt;br /&gt;
&lt;br /&gt;
KeePassXC will not be automatically started when an application requests secrets, which may cause them to break. [https://github.com/keepassxreboot/keepassxc/discussions/9009 A D-Bus auto-start file] can be [[create]]d:&lt;br /&gt;
&lt;br /&gt;
{{hc|${XDG_DATA_HOME:-$HOME/.local/share}/dbus-1/services/org.freedesktop.secrets.service|2=&lt;br /&gt;
[D-BUS Service]&lt;br /&gt;
Name=org.freedesktop.secrets&lt;br /&gt;
Exec=/usr/bin/keepassxc&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|The above will only apply to the user the commands are executed as. To apply the fix to &#039;&#039;all&#039;&#039; users, create the file as root in {{ic|/usr/local/share}}.}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|Remember to delete this file if uninstalling {{Pkg|keepassxc}}. Otherwise, other applications may be unable to provide the Secret Service.}}&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Disable your clipboard manager ===&lt;br /&gt;
&lt;br /&gt;
If you are an avid user of clipboard managers, you may need to disable your clipboard manager before you launch Keepass and then re-start your clipboard manager afterwards.&lt;br /&gt;
&lt;br /&gt;
KeePassXC implementations has the option to auto-clear the clipboard manager after an amount of time, enough to paste copied items.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Some advanced clipboard managers like CopyQ have the option to ignore input from specified applications.}}&lt;br /&gt;
&lt;br /&gt;
=== Dark theme ===&lt;br /&gt;
&lt;br /&gt;
To enable the dark theme for KeePass, install {{AUR|keepass-keetheme}}. After installation, the plugin will get compiled upon starting KeePass. It can then be activated via &#039;&#039;Tools &amp;gt; Dark Theme&#039;&#039;, or by pressing {{ic|Ctrl+t}}.&lt;br /&gt;
&lt;br /&gt;
=== Synchronization ===&lt;br /&gt;
&lt;br /&gt;
Without using specialized plugin, a KeePass database is well-suited to be synchronized through [[Syncthing]]. On conflicts, some applications provides a way to resolve them, such as the &#039;&#039;Merge from database&#039;&#039; feature of KeePassXC.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== User interface scaling issues with KeePassXC 2.6 ===&lt;br /&gt;
&lt;br /&gt;
If the user interface elements are not scaled properly, see [[HiDPI#Qt 5]] and [https://github.com/keepassxreboot/keepassxc/issues/5029 upstream bug report].&lt;br /&gt;
&lt;br /&gt;
=== Greyed-out options ===&lt;br /&gt;
&lt;br /&gt;
Some options like &#039;&#039;Start minimized and locked&#039;&#039; may appear greyed-out. According to a discussion on [https://sourceforge.net/p/keepass/discussion/329220/thread/5a14d949/ SourceForge], since version 2.31, KeePass has disabled two options because of their [https://sourceforge.net/p/keepass/bugs/1418/ broken behaviors] on Mono. &lt;br /&gt;
&lt;br /&gt;
To force these features to be enabled, launch KeePass with the {{ic|-wa-disable:1418}} argument.&lt;br /&gt;
&lt;br /&gt;
=== Wrongly scaled tray icons ===&lt;br /&gt;
&lt;br /&gt;
In some [[desktop environment]]s, the tray icon of KeePass may appear too big or too small due to Mono&#039;s bug, according to a bug report on [https://sourceforge.net/p/keepass/bugs/1733/#925e SourceForge].&lt;br /&gt;
&lt;br /&gt;
[https://github.com/dlech/Keebuntu/ Keebuntu] contains three plugins to provide desktop integration:&lt;br /&gt;
&lt;br /&gt;
* {{AUR|keepass2-plugin-tray-icon}}: For [[Cinnamon]] and [[MATE]];&lt;br /&gt;
* {{AUR|keepass-plugin-statusnotifier-git}}: For [[Plasma]] and [[GNOME]] with {{Pkg|gnome-shell-extension-appindicator}};&lt;br /&gt;
* [https://github.com/dlech/Keebuntu/#launcher-quicklist keepass2-plugin-launcher]: For the {{Pkg|plank}} dock.&lt;br /&gt;
&lt;br /&gt;
After installing one of these plugins, it is sometimes necessary to hide the original tray icon to prevent duplicate icons in the system tray.&lt;br /&gt;
&lt;br /&gt;
=== Secret Service Integration ===&lt;br /&gt;
&lt;br /&gt;
First, check that the group under which your passwords are stored is exposed; the &#039;&#039;Tools &amp;gt; Settings&#039;&#039; menu contains a list of groups enabled for each database. If a database isn&#039;t exposing the proper group, select its tab, open &#039;&#039;Database &amp;gt; Database Settings...&#039;&#039;, then select the group in the &#039;&#039;Secret Service Integration&#039;&#039; tab).&lt;br /&gt;
&lt;br /&gt;
Note that [https://github.com/keepassxreboot/keepassxc/issues/9371 merging a database can cause it to stop exposing any groups].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Graphical glitches with KeePassXC, Plasma6 and Wayland ===&lt;br /&gt;
&lt;br /&gt;
If you are experiencing graphical glitches, install the {{Pkg|qt5-wayland}} and {{Pkg|plasma5-integration}} packages. KeePassXC (as of version v2.7.7) still uses Qt5.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[List of applications/Security#Password managers]]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=KeePass&amp;diff=873140</id>
		<title>KeePass</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=KeePass&amp;diff=873140"/>
		<updated>2026-05-06T18:21:08Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Configuration with KeePass */ add intro sentence with link; update hotp method and slice deprecated tool references out, replacing with current&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Password managers]]&lt;br /&gt;
[[ja:KeePass]]&lt;br /&gt;
[[pt:KeePass]]&lt;br /&gt;
[[ru:KeePass]]&lt;br /&gt;
KeePass is an encrypted password database format. It is an alternative to online password managers and is supported on all major platforms.&lt;br /&gt;
&lt;br /&gt;
There are two versions of the format: &#039;&#039;KeePass 1.x (Classic)&#039;&#039; and &#039;&#039;KeePass 2.x&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
There are three major implementations of KeePass available in the official repositories:&lt;br /&gt;
&lt;br /&gt;
* {{App|[[Wikipedia:KeePass|KeePass]]|A cross-platform password manager that has autotype and clipboard support when respectively {{Pkg|xdotool}} and {{Pkg|xsel}} are installed. It lets you import [https://keepass.info/help/base/importexport.html many formats] and has [https://keepass.info/plugins.html many plugins].|https://keepass.info|{{Pkg|keepass}}}}&lt;br /&gt;
* {{App|[[Wikipedia:KeePassXC|KeePassXC]]|Fork of KeePassX that is actively maintained and has additional features like browser integration, support for SSH agent, secret service, Yubikey, finger-print reader, TOTP generator and KeeShare. Also provides a CLI through {{ic|keepassxc-cli}}.|https://keepassxc.org|{{Pkg|keepassxc}}}}&lt;br /&gt;
* {{App|{{Pkg|secrets}}|A modern GNOME password manager built on top of KeePass.|https://gitlab.gnome.org/World/secrets/|{{Pkg|secrets}}}}&lt;br /&gt;
&lt;br /&gt;
Other lesser-known alternatives can be found in the AUR:&lt;br /&gt;
&lt;br /&gt;
* {{App|keepassc|A curses-based password manager compatible to KeePass v.1.x and KeePassX. It uses {{ic|xsel}} for clipboard functions.|https://raymontag.github.io/keepassc/|{{AUR|keepassc}}}}&lt;br /&gt;
* {{App|kpcli|A command line interface for KeePass database files {{ic|*.kdb}} or {{ic|*.kdbx}}.|https://sourceforge.net/projects/kpcli/|{{AUR|kpcli}}}}&lt;br /&gt;
* {{App|keepmenu|Dmenu/Rofi frontend for Keepass database files.|https://github.com/firecat53/keepmenu|{{AUR|keepmenu}}}}&lt;br /&gt;
* {{App|AuthPass|KeePass compatible password manager based on Flutter. Comes with default sync suport for Gdrive, Dropbox, and WebDav.|https://authpass.app|{{AUR|authpass-bin}}}}&lt;br /&gt;
* {{App|keeweb|A web app (online / Electron) compatible with KeePass 2.x. KeeWeb comes with default Sync support for major cloud services, Gdrive, Onedrive, Dropbox etc. No active development since release of 1.18.7 on July 18th 2021.|https://keeweb.info|{{AUR|keeweb}} {{AUR|nextcloud-app-keeweb}} {{AUR|keeweb-desktop-bin}}}}&lt;br /&gt;
* {{App|[[Wikipedia:KeePassX|KeePassX]]|Started as a Linux port of KeePass. {{AUR|keepassx2}} uses the KeePass 2.x format, but can import 1.x databases. It also lets you import PwManager and KWallet XML databases. It does not support plugins. [https://www.keepassx.org/faq] No active development since 2016. [https://dev.keepassx.org/projects/keepassx/repository/revisions] |https://www.keepassx.org/|{{AUR|keepassx}} {{AUR|keepassx2}}}}&lt;br /&gt;
&lt;br /&gt;
== Integration ==&lt;br /&gt;
&lt;br /&gt;
Many [https://keepass.info/plugins.html plugins and extensions] are available for integrating KeePass to other software. KeePassX and KeePassXC do not have a plugin interface, but KeePassXC has various integrations built-in.&lt;br /&gt;
&lt;br /&gt;
=== Plugin installation in KeePass ===&lt;br /&gt;
&lt;br /&gt;
KeePass is by default installed at {{ic|/usr/share/keepass/}}. Copy {{ic|plugin.plgx}} to a plugins sub-directory under the KeePass installation directory as demonstrated below:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
# mkdir /usr/share/keepass/plugins&lt;br /&gt;
# cp plugin.plgx /usr/share/keepass/plugins&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Browser integration ===&lt;br /&gt;
&lt;br /&gt;
==== keepassxc-browser for KeePassXC ====&lt;br /&gt;
&lt;br /&gt;
[https://github.com/keepassxreboot/keepassxc-browser keepassxc-browser] is the browser extension of KeePassXC’s built-in browser integration using native-messaging and transport encryption using libsodium. It was developed to replace KeePassHTTP, as KeePassHTTP’s protocol has fundamental security problems.&lt;br /&gt;
&lt;br /&gt;
The developers provide the browser extension on&lt;br /&gt;
&lt;br /&gt;
* [https://addons.mozilla.org/firefox/addon/keepassxc-browser/ Firefox Add-ons] (for [[Firefox]] and [[Tor Browser]]) and&lt;br /&gt;
* in the [https://chrome.google.com/webstore/detail/keepassxc-browser/oboonakemofpalcgghocfoadofidjkkk chrome web store] (for [[Chromium]], [[Google Chrome]], [[Vivaldi]] and [[Brave]]).&lt;br /&gt;
&lt;br /&gt;
Support for Firefox and Chromium forks is available. For {{AUR|librewolf}}, open KeePassXC, go to &#039;&#039;Tools&#039;&#039; &amp;gt; &#039;&#039;Settings&#039;&#039; &amp;gt; &#039;&#039;Browser Integration&#039;&#039; &amp;gt; &#039;&#039;Advanced&#039;&#039; &amp;gt; &#039;&#039;Config Location:&#039;&#039;, and add {{ic|~/.librewolf/native-messaging-hosts}}.&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/keepassxreboot/keepassxc-browser source code and an explanation how it works] can be found on GitHub, the KeePassXC developers provide a [https://keepassxc.org/docs/KeePassXC_GettingStarted.html#_configure_keepassxc_browser configuration guide] on their website.&lt;br /&gt;
&lt;br /&gt;
==== KeePassRPC and Kee ====&lt;br /&gt;
&lt;br /&gt;
[https://www.kee.pm/ Kee] ([https://github.com/kee-org/browser-addon GitHub repo]) is a browser extension for [[Firefox]] and [[Chromium]] which integrates KeePass through [https://github.com/kee-org/keepassrpc KeePassRPC], a KeePass plugin from the same developers.&lt;br /&gt;
&lt;br /&gt;
The KeePass plugin is available from [https://github.com/kee-org/keepassrpc/releases GitHub] or from the AUR ({{aur|keepass-plugin-rpc}}).&lt;br /&gt;
&lt;br /&gt;
The browser extension can be found on [https://github.com/kee-org/browser-addon/releases GitHub], [https://addons.mozilla.org/firefox/addon/keefox/ Firefox Add-ons] and the [https://chrome.google.com/webstore/detail/kee-password-manager/mmhlniccooihdimnnjhamobppdhaolme chrome web store].&lt;br /&gt;
&lt;br /&gt;
==== Via autotype feature ====&lt;br /&gt;
&lt;br /&gt;
An alternative to having a direct channel between browser and KeePass(XC) is using the autotype feature.&lt;br /&gt;
&lt;br /&gt;
To enable the autotype feature on Wayland, force KeePass(XC) to fallback to X11. [[Textedit|Edit]] {{ic|/usr/share/applications/org.keepassxc.KeePassXC.desktop}} and change the value of {{ic|Exec}} to {{ic|keepassxc -platform xcb}}. Alternatively, set the {{ic|1=QT_QPA_PLATFORM=xcb}} [[environment variable]] before launching KeePassXC. However, native Wayland applications will not work with autotype. For example, autotype works when running Firefox without Wayland, but not with.&lt;br /&gt;
&lt;br /&gt;
There are browser extensions which support this way by putting the page URL into the window name:&lt;br /&gt;
&lt;br /&gt;
* [https://addons.mozilla.org/firefox/addon/keepass-helper-url-in-title/ KeePass Helper] or [https://addons.mozilla.org/firefox/addon/url-in-title/ TitleURL] for [[Firefox]]&lt;br /&gt;
* [https://chrome.google.com/webstore/detail/url-in-title/ignpacbgnbnkaiooknalneoeladjnfgb URL in title] for [[Chromium]]&lt;br /&gt;
&lt;br /&gt;
{{Warning|Auto typing has its own risks and limitations, therefore check the technical documentation of the password safe you are using: [https://keepass.info/help/base/faq_tech.html#autotypelog KeePass], [https://keepassxc.org/docs/#faq-autotype KeePassXC].}}&lt;br /&gt;
&lt;br /&gt;
=== Yubikey ===&lt;br /&gt;
&lt;br /&gt;
[[YubiKey]] can be integrated with KeePass thanks to contributors of KeePass plugins. KeepassXC provides built-in support for Yubikey Challenge-Response without plugins.&lt;br /&gt;
&lt;br /&gt;
==== Configuration with KeePass ====&lt;br /&gt;
&lt;br /&gt;
For an explanation of the configuration options, see https://keepass.info/help/kb/yubikey.html.&lt;br /&gt;
&lt;br /&gt;
{{Out of date|yubikey-personalization-gui-git was apparently replaced with {{Pkg|yubikey-manager}} or {{AUR|yubico-authenticator}}[https://lists.archlinux.org/archives/list/aur-requests@lists.archlinux.org/thread/FM3Y56EOSBFTO35UMYAWIKSKK45U2FLG/#FM3Y56EOSBFTO35UMYAWIKSKK45U2FLG]}}&lt;br /&gt;
&lt;br /&gt;
# StaticPassword&lt;br /&gt;
#:Configure one of Yubikey slots to store static password. You can make the password as strong as 65 characters (64 characters with leading &amp;quot;!&amp;quot;). This password can then be used as master password for your KeePass database.&lt;br /&gt;
# One-time passwords (OATH-HOTP)&lt;br /&gt;
## Download plugin from KeePass website: https://keepass.info/plugins.html#otpkeyprov&lt;br /&gt;
## Setup the [[YubiKey#OTP_slot_implementation|Yubikey OATH-HOTP slot]] (program the same, if a backup Yubikey is used)&lt;br /&gt;
## In advanced mode untick &#039;&#039;OATH Token Identifier&#039;&#039;&lt;br /&gt;
## In KeePass additional option will show up under &#039;&#039;Key file / provider&#039;&#039; called &#039;&#039;One-Time Passwords (OATH HOTP)&#039;&#039;&lt;br /&gt;
## Copy secret, key length (6 or 8), and counter you set&lt;br /&gt;
## You may need to setup &#039;&#039;Look-ahead count&#039;&#039; option to something greater than 0, please see [https://forum.yubico.com/viewtopicf146.html?f=16&amp;amp;t=1120 this thread] for more information&lt;br /&gt;
## See [https://vimeo.com/94352853 this video] for more help&lt;br /&gt;
#Challenge-Response (HMAC-SHA1)&lt;br /&gt;
## Get the plugin from AUR: {{AUR|keepass-plugin-keechallenge}}&lt;br /&gt;
## In KeePass additional option will show up under &#039;&#039;Key file / provider&#039;&#039; called &#039;&#039;Yubikey challenge-response&#039;&#039;&lt;br /&gt;
## Plugin assumes slot 2 is used&lt;br /&gt;
&lt;br /&gt;
=== SSH agent ===&lt;br /&gt;
&lt;br /&gt;
KeePassXC offers SSH agent support, a similar feature is also available for KeePass using the [https://lechnology.com/software/keeagent/ KeeAgent] plugin.&lt;br /&gt;
&lt;br /&gt;
The feature allows to store SSH keys in KeePass databases, KeePassXC/KeeAgent acts as OpenSSH Client and dynamically adds and removes the key to the Agent.&lt;br /&gt;
&lt;br /&gt;
The feature in KeePassXC is documented in its [https://keepassxc.org/docs/#faq-ssh-agent-how FAQ]. First configure [[SSH agent]] to start on login and make sure the {{ic|SSH_AUTH_SOCK}} variable is set. Then logout and log back in. Now, in KeePassXC settings, enable SSH agent integration. The {{ic|SSH_AUTH_SOCK}} value exposed in the UI should correspond to what you configured earlier.&lt;br /&gt;
&lt;br /&gt;
{{Note|The [[GnuPG#SSH agent|SSH agent emulation of &#039;&#039;gpg-agent&#039;&#039;]] does not support removing keys from the agent on demand using {{ic|ssh-add -d}} or {{ic|ssh-add -D}}, therefore KeePassXC/KeeAgent cannot remove them when locking the database. [https://github.com/keepassxreboot/keepassxc/issues/2029#issuecomment-395933402] [https://unix.stackexchange.com/questions/185393/gpg-agent-doesnt-remove-my-ssh-key-from-the-keyring]}}&lt;br /&gt;
&lt;br /&gt;
=== Secret Service ===&lt;br /&gt;
&lt;br /&gt;
KeePassXC contains a [https://specifications.freedesktop.org/secret-service-spec/latest/ Freedesktop.org Secret Service] integration. It will allow external applications to use KeePassXC as an encrypted database (&#039;&#039;a.k.a.&#039;&#039; as a vault, wallet, or keyring) to store user credentials (&#039;&#039;e.g.&#039;&#039;, messaging applications, games).&lt;br /&gt;
&lt;br /&gt;
It can be enabled by going into the settings (under the &#039;&#039;Tools&#039;&#039; menu), and selecting which group(s) you want to share (&#039;&#039;&#039;for each database&#039;&#039;&#039;, open &#039;&#039;Database &amp;gt; Database Settings...&#039;&#039;, then go to the &#039;&#039;Secret Service Integration&#039;&#039; tab).&lt;br /&gt;
&lt;br /&gt;
KeePassXC will refuse to enable its integration if it detects that another program (such as [[GNOME/Keyring]]) is already providing that service. You should first stop that program (for example, by [[stop]]ping {{ic|gnome-keyring-daemon.service}} [[user unit]] for {{Pkg|gnome-keyring}}). Note that you will likely want to disable the program permanently, otherwise KeePassXC&#039;s integration will fail on the next reboot (for example, by [[disabling]] the {{ic|gnome-keyring-daemon.socket}} of a [[systemd/User]] for {{Pkg|gnome-keyring}}).&lt;br /&gt;
&lt;br /&gt;
{{Tip|To avoid confirmation of every access to the database by other applications, but transparently allow the access like GNOME Keyring or KDE Keyring, you can go to &#039;&#039;Tools &amp;gt; Secret Service Integration&#039;&#039; and uncheck the two &#039;&#039;Confirm when [...]&#039;&#039; checkboxes.}}&lt;br /&gt;
&lt;br /&gt;
An application that requests access to the database will connect to KeePassXC through [[D-Bus]], where KeePassXC will be &amp;quot;seen&amp;quot; just as [https://wiki.gnome.org/Projects/Libsecret GNOME libsecret] by the application. The database that will be exposed can be stored anywhere on the disk, just like any other KeePassXC database, and the master password of this database will be the one to type when applications will want to retrieve a credential in the future.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Note that if an application tries to access the KeePassXC database while it is not already created, the process can appear to &amp;quot;freeze&amp;quot; for one or two minutes because of a timeout, but then a pop-up for database creation will appear.}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|Note that an application (&#039;&#039;e.g.&#039;&#039; Tutanota using Chromium and Electron as backend) can fail to access Chromium&#039;s Safe Storage if the KeePassXC database is not already opened manually by the user or using the D-Bus autostart file.}}&lt;br /&gt;
&lt;br /&gt;
==== Autostart ====&lt;br /&gt;
&lt;br /&gt;
KeePassXC will not be automatically started when an application requests secrets, which may cause them to break. [https://github.com/keepassxreboot/keepassxc/discussions/9009 A D-Bus auto-start file] can be [[create]]d:&lt;br /&gt;
&lt;br /&gt;
{{hc|${XDG_DATA_HOME:-$HOME/.local/share}/dbus-1/services/org.freedesktop.secrets.service|2=&lt;br /&gt;
[D-BUS Service]&lt;br /&gt;
Name=org.freedesktop.secrets&lt;br /&gt;
Exec=/usr/bin/keepassxc&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|The above will only apply to the user the commands are executed as. To apply the fix to &#039;&#039;all&#039;&#039; users, create the file as root in {{ic|/usr/local/share}}.}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|Remember to delete this file if uninstalling {{Pkg|keepassxc}}. Otherwise, other applications may be unable to provide the Secret Service.}}&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Disable your clipboard manager ===&lt;br /&gt;
&lt;br /&gt;
If you are an avid user of clipboard managers, you may need to disable your clipboard manager before you launch Keepass and then re-start your clipboard manager afterwards.&lt;br /&gt;
&lt;br /&gt;
KeePassXC implementations has the option to auto-clear the clipboard manager after an amount of time, enough to paste copied items.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Some advanced clipboard managers like CopyQ have the option to ignore input from specified applications.}}&lt;br /&gt;
&lt;br /&gt;
=== Dark theme ===&lt;br /&gt;
&lt;br /&gt;
To enable the dark theme for KeePass, install {{AUR|keepass-keetheme}}. After installation, the plugin will get compiled upon starting KeePass. It can then be activated via &#039;&#039;Tools &amp;gt; Dark Theme&#039;&#039;, or by pressing {{ic|Ctrl+t}}.&lt;br /&gt;
&lt;br /&gt;
=== Synchronization ===&lt;br /&gt;
&lt;br /&gt;
Without using specialized plugin, a KeePass database is well-suited to be synchronized through [[Syncthing]]. On conflicts, some applications provides a way to resolve them, such as the &#039;&#039;Merge from database&#039;&#039; feature of KeePassXC.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== User interface scaling issues with KeePassXC 2.6 ===&lt;br /&gt;
&lt;br /&gt;
If the user interface elements are not scaled properly, see [[HiDPI#Qt 5]] and [https://github.com/keepassxreboot/keepassxc/issues/5029 upstream bug report].&lt;br /&gt;
&lt;br /&gt;
=== Greyed-out options ===&lt;br /&gt;
&lt;br /&gt;
Some options like &#039;&#039;Start minimized and locked&#039;&#039; may appear greyed-out. According to a discussion on [https://sourceforge.net/p/keepass/discussion/329220/thread/5a14d949/ SourceForge], since version 2.31, KeePass has disabled two options because of their [https://sourceforge.net/p/keepass/bugs/1418/ broken behaviors] on Mono. &lt;br /&gt;
&lt;br /&gt;
To force these features to be enabled, launch KeePass with the {{ic|-wa-disable:1418}} argument.&lt;br /&gt;
&lt;br /&gt;
=== Wrongly scaled tray icons ===&lt;br /&gt;
&lt;br /&gt;
In some [[desktop environment]]s, the tray icon of KeePass may appear too big or too small due to Mono&#039;s bug, according to a bug report on [https://sourceforge.net/p/keepass/bugs/1733/#925e SourceForge].&lt;br /&gt;
&lt;br /&gt;
[https://github.com/dlech/Keebuntu/ Keebuntu] contains three plugins to provide desktop integration:&lt;br /&gt;
&lt;br /&gt;
* {{AUR|keepass2-plugin-tray-icon}}: For [[Cinnamon]] and [[MATE]];&lt;br /&gt;
* {{AUR|keepass-plugin-statusnotifier-git}}: For [[Plasma]] and [[GNOME]] with {{Pkg|gnome-shell-extension-appindicator}};&lt;br /&gt;
* [https://github.com/dlech/Keebuntu/#launcher-quicklist keepass2-plugin-launcher]: For the {{Pkg|plank}} dock.&lt;br /&gt;
&lt;br /&gt;
After installing one of these plugins, it is sometimes necessary to hide the original tray icon to prevent duplicate icons in the system tray.&lt;br /&gt;
&lt;br /&gt;
=== Secret Service Integration ===&lt;br /&gt;
&lt;br /&gt;
First, check that the group under which your passwords are stored is exposed; the &#039;&#039;Tools &amp;gt; Settings&#039;&#039; menu contains a list of groups enabled for each database. If a database isn&#039;t exposing the proper group, select its tab, open &#039;&#039;Database &amp;gt; Database Settings...&#039;&#039;, then select the group in the &#039;&#039;Secret Service Integration&#039;&#039; tab).&lt;br /&gt;
&lt;br /&gt;
Note that [https://github.com/keepassxreboot/keepassxc/issues/9371 merging a database can cause it to stop exposing any groups].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Graphical glitches with KeePassXC, Plasma6 and Wayland ===&lt;br /&gt;
&lt;br /&gt;
If you are experiencing graphical glitches, install the {{Pkg|qt5-wayland}} and {{Pkg|plasma5-integration}} packages. KeePassXC (as of version v2.7.7) still uses Qt5.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[List of applications/Security#Password managers]]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=YubiKey&amp;diff=873139</id>
		<title>YubiKey</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=YubiKey&amp;diff=873139"/>
		<updated>2026-05-06T18:08:29Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* OTP slot implementation */ add tip for options&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:OpenPGP]]&lt;br /&gt;
[[Category:Smartcards]]&lt;br /&gt;
[[Category:Universal 2nd Factor]]&lt;br /&gt;
[[ja:Yubikey]]&lt;br /&gt;
[[zh-hans:YubiKey]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|Universal 2nd Factor}}&lt;br /&gt;
{{Related|OATH}}&lt;br /&gt;
{{Related|dm-crypt/Encrypting an entire system}}&lt;br /&gt;
{{Related|PAM}}&lt;br /&gt;
{{Related|GnuPG}}&lt;br /&gt;
{{Related|KeePass}}&lt;br /&gt;
{{Related|OpenPGP-card-tools}}&lt;br /&gt;
{{Related|Smartcards}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
&lt;br /&gt;
The [https://www.yubico.com/ YubiKey] is a small [[Wikipedia:Security token|USB security token]]. Depending on the model, it can:&lt;br /&gt;
&lt;br /&gt;
* Act as a smartcard using the [[Wikipedia:CCID (protocol)|CCID protocol]], allowing storage of both [https://developers.yubico.com/PGP/ PGP] and [https://developers.yubico.com/PIV/ PIV] secret keys.&lt;br /&gt;
* Handle [[Universal 2nd Factor]] (U2F) requests.&lt;br /&gt;
* Store and query approximately 30 [[Initiative for Open Authentication]] (OATH) credentials.&lt;br /&gt;
* Handle [[Wikipedia:Challenge–response authentication|challenge-response requests]], in either the Yubico OTP mode or the HMAC-SHA1 mode.&lt;br /&gt;
* Generate [[Wikipedia:One-time password|one-time passwords]] (OTPs) with [https://developers.yubico.com/OTP/ Yubico&#039;s AES-based standard].&lt;br /&gt;
* &amp;quot;Type&amp;quot; a static password up to 63 characters.&lt;br /&gt;
&lt;br /&gt;
While offering many features, newer versions of the YubiKey are [https://www.yubico.com/blog/secure-hardware-vs-open-source/ not released as open source]. Alternatives are the [[Solo]], [[Tillitis TKey|TKey]] or [[Nitrokey]].&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
=== Management tools ===&lt;br /&gt;
&lt;br /&gt;
* {{App|YubiKey Manager|Python library and command-line tool ({{ic|ykman}}) for configuring and querying a YubiKey over USB.|https://developers.yubico.com/yubikey-manager/|{{Pkg|yubikey-manager}}}}&lt;br /&gt;
::{{Note|After installation, [[enable]] {{ic|pcscd.service}}; alternatively, it might be useful to [[enable]] {{ic|pcscd.socket}}.}}&lt;br /&gt;
::{{Warning|{{AUR|yubikey-manager-qt}} was available as a GUI but is now [https://github.com/Yubico/yubikey-manager-qt/commit/28dc02d11b081683b59d16d12043aaa3c0a6c75f deprecated by Yubico]. The package is also [https://github.com/Yubico/yubikey-manager-qt/issues/361 completely broken] due to incompatibility with recent versions of Python and {{ic|ykman}}.}}&lt;br /&gt;
* {{App|Yubico Authenticator|GUI tool to access and reset information, configure [https://docs.yubico.com/software/yubikey/tools/authenticator/auth-guide/yubico-otp.html slot-based credentials], and read OATH codes from your YubiKey.|https://developers.yubico.com/yubioath-flutter/|{{AUR|yubico-authenticator}}}}&lt;br /&gt;
* {{App|YubiKey Personalization|Library and tool for configuring and querying a YubiKey over the OTP USB connection. More powerful than {{ic|ykman}}, but harder to use. Has an optional GUI.|https://developers.yubico.com/yubikey-personalization/|{{Pkg|yubikey-personalization}}, {{Pkg|yubikey-personalization-gui}}}}&lt;br /&gt;
::{{Warning|Yubico announced the End of Life of YubiKey Personalization on February 19, 2025. It will not be updated after February 19, 2026.}}&lt;br /&gt;
&lt;br /&gt;
=== Authentication tools ===&lt;br /&gt;
&lt;br /&gt;
* {{App|pam-u2f|[[PAM]] user authentication with [[U2F]] by Yubico. Supplement or replace password authentication with your YubiKey.|https://developers.yubico.com/pam-u2f/|{{Pkg|pam-u2f}}}}&lt;br /&gt;
* {{App|libfido2|Client-side U2F support. Enables web browsers to use the U2F protocol for authentication with your YubiKey.|https://developers.yubico.com/libfido2/|{{Pkg|libfido2}}}}&lt;br /&gt;
* {{App|YubiKey Full Disk Encryption|Use challenge-response mode to create strong LUKS passphrases. Supports full disk encryption.|https://github.com/agherzan/yubikey-full-disk-encryption|{{Pkg|yubikey-full-disk-encryption}}}}&lt;br /&gt;
&lt;br /&gt;
=== Udev rules ===&lt;br /&gt;
&lt;br /&gt;
{{Pkg|yubikey-personalization}} (and, by extension, {{Pkg|yubikey-personalization-gui}}) include [[udev]] rules to allows non-root users to access some of the functionality, such as OTP. Users of the other clients will need to add the following rules:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/udev/rules.d/51-yubikey.rules|2=&lt;br /&gt;
ACTION==&amp;quot;add{{!}}change&amp;quot;, ATTRS{idVendor}==&amp;quot;1050&amp;quot;, ATTRS{idProduct}==&amp;quot;0010{{!}}0110{{!}}0111{{!}}0114{{!}}0116{{!}}0401{{!}}0403{{!}}0405{{!}}0407{{!}}0410&amp;quot;, ENV{ID_SECURITY_TOKEN}=&amp;quot;1&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Inputs ==&lt;br /&gt;
&lt;br /&gt;
The YubiKey takes inputs in the form of API calls over USB and button presses.&lt;br /&gt;
&lt;br /&gt;
The button is very sensitive. Depending on the context, touching it does one of these things:&lt;br /&gt;
&lt;br /&gt;
* Trigger a static password or one-time password (OTP) (Short press for slot 1, long press for slot 2). This is the default behavior, and easy to trigger inadvertently.&lt;br /&gt;
* Confirm / allow a function or access. The LED will illuminate to prompt the user.&lt;br /&gt;
* Insert / eject the smartcard&lt;br /&gt;
&lt;br /&gt;
== Outputs ==&lt;br /&gt;
&lt;br /&gt;
The YubiKey transforms these inputs into outputs:&lt;br /&gt;
&lt;br /&gt;
* Keystrokes (emulating a USB keyboard), used to type static passwords and OTPs. (Note that static passwords are vulnerable to keyloggers.)&lt;br /&gt;
* The built-in LED:&lt;br /&gt;
** Blinks once when plugged in, useful for troubleshooting.&lt;br /&gt;
** Blinks steadily when a button press is required to permit an API response.&lt;br /&gt;
* API responses over USB. This is used for:&lt;br /&gt;
** Challenge-Response requests (calculated using either Yubico OTP mode or HMAC-SHA1 mode)&lt;br /&gt;
** U2F Challenge-Response requests&lt;br /&gt;
** CCID Smartcard related requests&lt;br /&gt;
&lt;br /&gt;
== USB connection modes ==&lt;br /&gt;
&lt;br /&gt;
Depending on the YubiKey model, the device provides up to three different USB interfaces. Two of the interfaces implement the USB HID (Human Interface Device) device class; the third is a smart card interface (CCID). All three can be enabled or disabled independently, allowing control of their associated protocols.&lt;br /&gt;
&lt;br /&gt;
The following table shows which protocols use which interfaces:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Protocol !! Interface&lt;br /&gt;
|-&lt;br /&gt;
|OTP || Keyboard HID&lt;br /&gt;
|-&lt;br /&gt;
|FIDO || Other HID&lt;br /&gt;
|-&lt;br /&gt;
|PIV || CCID&lt;br /&gt;
|-&lt;br /&gt;
|OpenPGP || CCID&lt;br /&gt;
|-&lt;br /&gt;
|OATH || CCID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{ic|ykman}} uses the term &amp;quot;modes&amp;quot;, named OTP, FIDO, and CCID.&lt;br /&gt;
&lt;br /&gt;
{{Note|ykman renamed &amp;quot;U2F&amp;quot; to &amp;quot;FIDO&amp;quot; in release 0.6.1 (2018-04-16). https://developers.yubico.com/yubikey-manager/Release_Notes.html}}&lt;br /&gt;
&lt;br /&gt;
=== Get enabled modes ===&lt;br /&gt;
&lt;br /&gt;
For YubiKey prior to version 5:&lt;br /&gt;
&lt;br /&gt;
{{hc|$ ykman config mode|&lt;br /&gt;
Current connection mode is: OTP+FIDO+CCID&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Note|The command {{ic|ykman mode}} has been deprecated and may be removed later.}}&lt;br /&gt;
&lt;br /&gt;
For YubiKey version 5:&lt;br /&gt;
&lt;br /&gt;
{{hc|$ ykman info|&lt;br /&gt;
Device type: YubiKey 5 NFC&lt;br /&gt;
Serial number: XXXXXXXXX&lt;br /&gt;
Firmware version: 5.4.3&lt;br /&gt;
Form factor: Keychain (USB-A)&lt;br /&gt;
Enabled USB interfaces: OTP, FIDO, CCID&lt;br /&gt;
NFC transport is enabled.&lt;br /&gt;
&lt;br /&gt;
Applications    USB     NFC&lt;br /&gt;
FIDO2           Enabled Enabled&lt;br /&gt;
OTP             Enabled Enabled&lt;br /&gt;
FIDO U2F        Enabled Enabled&lt;br /&gt;
OATH            Enabled Enabled&lt;br /&gt;
YubiHSM Auth    Enabled Enabled&lt;br /&gt;
OpenPGP         Enabled Enabled&lt;br /&gt;
PIV             Enabled Enabled&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Set modes ===&lt;br /&gt;
&lt;br /&gt;
All modes are enabled from the factory. To change them:&lt;br /&gt;
&lt;br /&gt;
 $ ykman mode &#039;&#039;[OPTIONS]&#039;&#039; &#039;&#039;MODE&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* {{ic|&#039;&#039;MODE&#039;&#039;}} can be a string, such as {{ic|OTP+FIDO+CCID}}, or a shortened form {{ic|o+f+c}}.&lt;br /&gt;
* {{ic|&#039;&#039;MODE&#039;&#039;}} can be a mode-number, which encodes several enabled modes.&lt;br /&gt;
&lt;br /&gt;
Here is a table of mode-numbers, if you care to use them:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|0||OTP device only.&lt;br /&gt;
|-&lt;br /&gt;
|1||CCID device only.&lt;br /&gt;
|-&lt;br /&gt;
|2||OTP/CCID composite device.&lt;br /&gt;
|-&lt;br /&gt;
|3||U2F device only.&lt;br /&gt;
|-&lt;br /&gt;
|4||OTP/U2F composite device.&lt;br /&gt;
|-&lt;br /&gt;
|5||U2F/CCID composite device.&lt;br /&gt;
|-&lt;br /&gt;
|6||OTP/U2F/CCID composite device.&lt;br /&gt;
|-&lt;br /&gt;
|81||CCID device only, with touch-eject.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Note|Some examples use mode number 86, which is [https://github.com/Yubico/yubikey-manager/issues/20#issuecomment-326496204 invalid]. The 80 will be ignored, and it will behave like 6.}}&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
&lt;br /&gt;
* {{ic|--touch-eject}} - The button will insert and eject the smart card. This only works if the mode is CCID only; FIDO and OTP must be disabled.&lt;br /&gt;
* {{ic|--autoeject-timeout &#039;&#039;SECONDS&#039;&#039;}} - Automatically eject the smart card after some time. Same restrictions as {{ic|--touch-eject}}.&lt;br /&gt;
* {{ic|--chalresp-timeout &#039;&#039;SECONDS&#039;&#039;}} - Set the challenge-response timeout.&lt;br /&gt;
&lt;br /&gt;
For more information, see {{ic|ykman mode --help}}.&lt;br /&gt;
&lt;br /&gt;
== One-time password ==&lt;br /&gt;
&lt;br /&gt;
This feature has a somewhat misleading name, because it also encompasses the static password and challenge-response functions.&lt;br /&gt;
&lt;br /&gt;
2 slots are provided for this feature, accessible by short and long button presses respectively. Each can be configured with &#039;&#039;&#039;one&#039;&#039;&#039; of the following:&lt;br /&gt;
&lt;br /&gt;
* Yubico OTP&lt;br /&gt;
* OATH-HOTP&lt;br /&gt;
* OATH-TOTP&lt;br /&gt;
* Challenge-response&lt;br /&gt;
* Static Password&lt;br /&gt;
&lt;br /&gt;
Each function has several configuration options provided at the time of creation, but once set they cannot be read back. It is possible to swap slots 1 and 2, with {{ic|ykman otp swap}}.&lt;br /&gt;
&lt;br /&gt;
=== Factory configuration ===&lt;br /&gt;
&lt;br /&gt;
On a new YubiKey, Yubico OTP is preconfigured on slot 1. This initial AES symmetric key is stored in the YubiKey and on the Yubico Authentication server. This allows validating against YubiCloud, allowing the use of Yubico OTP in combination with the Yubico Forum website for instance or on https://demo.yubico.com).&lt;br /&gt;
&lt;br /&gt;
{{Warning|If you ever overwrite the factory key in slot 1, you cannot create a new key of the same trust level. Factory generated Yubico OTP credentials begin with a {{ic|CC}} prefix, while user generated credentials begin with {{ic|VV}}. There is no fundamental difference in security or functionality, though some services only trust {{ic|CC}} credentials. More information can be found in this [https://forum.yubico.com/viewtopic12ca.html?f%3D16&amp;amp;t%3D1960 forum thread].}}&lt;br /&gt;
&lt;br /&gt;
=== Yubico OTP ===&lt;br /&gt;
&lt;br /&gt;
The [https://developers.yubico.com/OTP/ Yubico OTP] is based on [[Wikipedia:Symmetric cryptography|symmetric cryptography]]. More specifically, each YubiKey contains a 128-bit [[Wikipedia:Advanced Encryption Standard|AES]] key unique to that device, which is also stored on a validation server. When asked for a password, the YubiKey will create a token by concatenating different fields such as the ID of the key, a counter, and a random number, and encrypting the result.&lt;br /&gt;
&lt;br /&gt;
This OTP is sent to the target system, which passes it to a validation server. The validation server (also in posession of the secret key) decrypts it and verifies the information inside. The result is returned to the target system, which can then decide whether to grant access.&lt;br /&gt;
&lt;br /&gt;
==== Configuration and usage ====&lt;br /&gt;
&lt;br /&gt;
Generate a new key in slot 2, and upload it to YubiCloud (opens in a browser):&lt;br /&gt;
&lt;br /&gt;
 $ ykman otp yubiotp --generate-key --upload 2&lt;br /&gt;
&lt;br /&gt;
For more information, see {{ic|ykman otp yubiotp --help}}.&lt;br /&gt;
&lt;br /&gt;
==== Security risks ====&lt;br /&gt;
&lt;br /&gt;
===== AES key compromise =====&lt;br /&gt;
&lt;br /&gt;
As you can imagine, the AES key should be kept secret. It cannot be retrieved from the YubiKey itself (or it should not, at least not with software). It is also present in the validation server, so the security of this server is very important.&lt;br /&gt;
&lt;br /&gt;
===== Validation requests/responses tampering =====&lt;br /&gt;
&lt;br /&gt;
Since the target system relies on a validation server, a possible attack would be to impersonate it. To prevent this, the target system needs to authenticate the validation server, either using HMAC or HTTPS.&lt;br /&gt;
&lt;br /&gt;
=== Challenge-response ===&lt;br /&gt;
&lt;br /&gt;
A challenge is sent to the YubiKey, which calculates a response based on some secret. The same challenge always results in the same response. Without the secret this calculation is not feasible, even with many challenge-response pairs.&lt;br /&gt;
&lt;br /&gt;
This can be used for&lt;br /&gt;
&lt;br /&gt;
* True 2-factor authentication: The user is provided a challenge, they must provide the correct response in addition to a password. Both parties must have the secret key.&lt;br /&gt;
* &amp;quot;Semi&amp;quot; 2-factor authentication: the challenge acts as a password, and the server stores the correct response. This is not an OTP, and if anyone can obtain the response they will gain access, but it is simpler as the server does not need the secret key.&lt;br /&gt;
&lt;br /&gt;
There are two Challenge-Response algorithms:&lt;br /&gt;
&lt;br /&gt;
* HMAC-SHA1&lt;br /&gt;
* Yubico OTP&lt;br /&gt;
&lt;br /&gt;
You can set them up with a GUI using the {{Pkg|yubikey-personalization-gui}}, or with the following instructions:&lt;br /&gt;
&lt;br /&gt;
==== HMAC-SHA1 algorithm ====&lt;br /&gt;
&lt;br /&gt;
Set up slot 2 in challenge response mode with a generated key:&lt;br /&gt;
&lt;br /&gt;
 $ ykman otp chalresp --generate 2&lt;br /&gt;
&lt;br /&gt;
You can omit the {{ic|--generate}} flag in order to provide a key, see {{ic|ykman otp chalresp --help}}. A main advantage of providing a key is that it can be used to setup a second device as a backup. The command {{ic|openssl rand -hex 20}} generates a suitable key, for example.&lt;br /&gt;
&lt;br /&gt;
==== Yubico OTP algorithm ====&lt;br /&gt;
&lt;br /&gt;
{{ic|ykman}} Does not appear to support setting the chal-yubico algorithm, but you can use {{ic|ykpersonalize}}. Generate a random key in slot 2:&lt;br /&gt;
&lt;br /&gt;
 $ ykpersonalize -2 -ochal-resp -ochal-yubico&lt;br /&gt;
&lt;br /&gt;
For more information, see {{man|1|ykpersonalize}}.&lt;br /&gt;
&lt;br /&gt;
==== Sending a challenge ====&lt;br /&gt;
&lt;br /&gt;
To send a challenge and get a response, the {{ic|ykchalresp -&#039;&#039;slot&#039;&#039; &#039;&#039;challenge&#039;&#039;}} command can be used. For example,&lt;br /&gt;
&lt;br /&gt;
{{hc|$ ykchalresp -2 &#039;&#039;archie&#039;&#039;|&lt;br /&gt;
12a19763be77d75af46fb76f0b737c117fa47205&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
returns a 40-byte SHA1-hash unique to the programmed slot 2. A different challenge produces another unique response.&lt;br /&gt;
&lt;br /&gt;
=== Static password ===&lt;br /&gt;
&lt;br /&gt;
You can either generate a static password:&lt;br /&gt;
&lt;br /&gt;
 $ ykman otp static --generate &#039;&#039;slot&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
or provide one:&lt;br /&gt;
&lt;br /&gt;
 $ ykman otp static &#039;&#039;slot&#039;&#039; &#039;&#039;password&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You have several options; you can set the length and character set of the generated password, and whether or not to send an Enter keystroke. See {{ic|ykman otp static --help}} for more.&lt;br /&gt;
&lt;br /&gt;
{{Tip|Most YubiKeys provide only limited (2) slots to save static passwords. A setup challenge-response slot provides static hash responses for unlimited challenges. While these are numeric and lower alphabet only, the response length provides considerable entropy.}}&lt;br /&gt;
&lt;br /&gt;
=== Emulated USB keyboard limitations, or &amp;quot;Why does my password look so weak?&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
In order for the YubiKey to work with most keyboard layouts, passwords are by default limited to the ModHex alphabet ({{ic|cbdefghijklnrtuv}}), digits {{ic|0-9}}, and {{ic|!}}. These characters use the same scan codes across a very large number of keyboard layouts, ensuring compatibility with most computers.&lt;br /&gt;
&lt;br /&gt;
Yubico has provided a [https://resources.yubico.com/53ZDUYE6/as/9hccqgx9bwwqq96mhkk8jb4h/Static_Password_Function.pdf whitepaper] on the subject.&lt;br /&gt;
&lt;br /&gt;
== OATH ==&lt;br /&gt;
&lt;br /&gt;
The YubiKey offers 2 [[OATH]] implementations:&lt;br /&gt;
&lt;br /&gt;
; OATH API: Newer method, can store approximately 30 credentials depending on the model. (YubiKey 4, NEO, and newer)&lt;br /&gt;
; OTP slot: Older method, both OTP slots can store a single credential. (All models which support challenge-response)&lt;br /&gt;
&lt;br /&gt;
=== OATH API ===&lt;br /&gt;
&lt;br /&gt;
If you prefer a GUI, you can use {{AUR|yubico-authenticator}}.&lt;br /&gt;
&lt;br /&gt;
{{ic|ykman}} can add codes in the URI format with {{ic|ykman oath uri}}. Here is a one-liner that will add a credential from an image of a QR code:&lt;br /&gt;
&lt;br /&gt;
 $ zbarimg qr_code.png --quiet --raw | xargs ykman oath accounts uri&lt;br /&gt;
&lt;br /&gt;
You can also do things manually. Program a TOTP key, requiring a button touch to generate a code:&lt;br /&gt;
&lt;br /&gt;
 $ ykman oath accounts add --touch &#039;&#039;name&#039;&#039; &#039;&#039;secret&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Program an HOTP key:&lt;br /&gt;
&lt;br /&gt;
 $ ykman oath accounts add --oath-type HOTP &#039;&#039;name&#039;&#039; &#039;&#039;secret&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
List credentials:&lt;br /&gt;
&lt;br /&gt;
 $ ykman oath accounts list&lt;br /&gt;
&lt;br /&gt;
Generate codes:&lt;br /&gt;
&lt;br /&gt;
 $ ykman oath accounts code &#039;&#039;query&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To see all available subcommands see {{ic|ykman oath --help}}. To see information about each, use {{ic|ykman oath &#039;&#039;subcommand&#039;&#039; --help}}.&lt;br /&gt;
&lt;br /&gt;
=== OTP slot implementation ===&lt;br /&gt;
&lt;br /&gt;
Program an HOTP in slot 2:&lt;br /&gt;
&lt;br /&gt;
 $ ykman otp hotp 2 &#039;&#039;key&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{Tip|Options for {{ic|--digits}} and {{ic|--counter}} can be specified. They are needed to register the HOTP secret in applications.}}&lt;br /&gt;
&lt;br /&gt;
Program a TOTP:&lt;br /&gt;
&lt;br /&gt;
 $ ykman otp chalresp --totp &#039;&#039;slot&#039;&#039; &#039;&#039;key&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Generate an HOTP:&lt;br /&gt;
&lt;br /&gt;
 $ ykman otp calculate &#039;&#039;slot&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Generate a TOTP:&lt;br /&gt;
&lt;br /&gt;
 $ ykman otp calculate --totp &#039;&#039;slot&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
See also: {{ic|ykman otp --help}} and https://developers.yubico.com/OATH/&lt;br /&gt;
&lt;br /&gt;
== U2F ==&lt;br /&gt;
&lt;br /&gt;
[[Universal 2nd Factor]] (U2F) with a YubiKey is very simple, requiring no configuration for the key itself. Note that this mode is also referred to as &#039;FIDO&#039; in some documentation and utilities. You have a few limited management options through the {{ic|ykman}} utility:&lt;br /&gt;
&lt;br /&gt;
* Set a PIN: {{ic|ykman fido access change-pin}}&lt;br /&gt;
* delete individual credentials: {{ic|ykman fido credentials delete &#039;&#039;QUERY&#039;&#039;}}&lt;br /&gt;
* Reset all credentials and PIN: {{ic|ykman fido reset}}&lt;br /&gt;
&lt;br /&gt;
To use U2F for authentication, see the instructions in [[U2F]].&lt;br /&gt;
&lt;br /&gt;
Also see [[WebAuthn]].&lt;br /&gt;
&lt;br /&gt;
== CCID smartcard ==&lt;br /&gt;
&lt;br /&gt;
CCID (Chip Card Interface Device) is a USB standard device class for use by USB devices that act as smart card readers or with security tokens that connect directly via USB, like the YubiKey. HID (Human Interface Device) and CCID are both USB device classes, i.e. they are in the same category of USB specifications. HID is a specification for computer peripherals, like keyboards. The YubiKey works like a USB (HID) keyboard when used in the OTP and FIDO modes, but switches to the CCID protocol when using the PIV application, or as an OpenPGP device.&lt;br /&gt;
&lt;br /&gt;
CCID mode should be enabled by default on all YubiKeys shipped since November 2015 [https://www.yubico.com/support/knowledge-base/categories/articles/use-yubikey-yubikey-windows-hello-app/]{{Dead link|2025|04|06|status=404}}. Enable at least the CCID mode. Please see [[#Get enabled modes]].&lt;br /&gt;
&lt;br /&gt;
=== PIV ===&lt;br /&gt;
&lt;br /&gt;
Starting with the YubiKey NEO, the YubiKeys contain a PIV (Personal Identity Verification) application on the chip. PIV is a US government standard (FIPS 201) that specifies how a token using RSA or ECC (Elliptic Curve Cryptography) is used for personal electronic identification. The YubiKey NEO only supports RSA encryption, later models (YubiKey 4 and 5) support both RSA and ECC. The exact algorithms supported depends on the firmware. For example, only YubiKeys with firmware 5.7 and up support RSA 3072, RSA 4096, Ed25519, and X25519 keys [https://developers.yubico.com/PIV/Introduction/YubiKey_and_PIV.html]. The distinguishing characteristic of a PIV token is that it is built to protect private keys and operate on-chip. A private key never leaves the token after it has been installed on it. Optionally, the private key can even be generated on-chip with the aid of an on-chip random number generator. If generated on-chip, the private key is never handled outside of the chip, and there is no way to recover it from the token. When using the PIV mechanism, the YubiKey functions as a CCID device.&lt;br /&gt;
&lt;br /&gt;
=== OpenPGP smartcards ===&lt;br /&gt;
&lt;br /&gt;
The YubiKey can act as a standard OpenPGP smartcard; see [[GnuPG#Smartcards]] for instructions on how to set up and use it with [[GnuPG]]. Yubico also provides some documentation in https://developers.yubico.com/PGP/.&lt;br /&gt;
&lt;br /&gt;
If you do not want to use the other features (U2F and OTP), the button can be configured to insert and eject it, and an auto-eject timeout can be set as well. See [[#USB connection modes]] for more.&lt;br /&gt;
&lt;br /&gt;
The default user pin is {{ic|123456}} and the default admin pin is {{ic|12345678}}. The default PUK is also {{ic|12345678}}. Remember to change all 3.&lt;br /&gt;
&lt;br /&gt;
== Use cases ==&lt;br /&gt;
&lt;br /&gt;
This section details how to use your YubiKey for various authentication purposes. It is by no means an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
=== Full disk encryption with LUKS ===&lt;br /&gt;
&lt;br /&gt;
You have several options:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Challenge-Response:&#039;&#039;&#039; the [[#Challenge-response|response]] to some challenge is used as a LUKS key. The challenge can act as a password for true 2-factor authentication, or stored in plain-text for one-factor authentication.&lt;br /&gt;
* &#039;&#039;&#039;GnuPG:&#039;&#039;&#039; Uses the yubikey&#039;s [[#CCID smartcard|PGP smartcard]] functionality. Offers strong 2-factor authentication without needing a huge passphrase.&lt;br /&gt;
* &#039;&#039;&#039;FIDO HMAC Secret:&#039;&#039;&#039; If your YubiKey supports [[U2F]], it can be configured to return a symmetric secret.&lt;br /&gt;
&lt;br /&gt;
{{Note|A disk&#039;s encryption is only as strong as its weakest key. Once you configure one of these tools, consider removing the initial passphrase, or replacing it with a very long one.}}&lt;br /&gt;
&lt;br /&gt;
==== Common prerequisites ====&lt;br /&gt;
&lt;br /&gt;
* A bootable [[dm-crypt/Encrypting an entire system|LUKS encrypted]] system, using the {{ic|encrypt}} [[mkinitcpio]] hook, with at least one free keyslot.&lt;br /&gt;
** With the exception of {{AUR|mkinitcpio-ykfde}}, the {{ic|sd-encrypt}} hook is not supported by any of these tools.&lt;br /&gt;
* Backed up LUKS header (Optional, though advisable)&lt;br /&gt;
&lt;br /&gt;
==== Challenge-response ====&lt;br /&gt;
&lt;br /&gt;
See {{Pkg|yubikey-full-disk-encryption}}&#039;s [https://github.com/agherzan/yubikey-full-disk-encryption#usage official documentation] for complete instructions. Broadly:&lt;br /&gt;
&lt;br /&gt;
# Install {{Pkg|yubikey-full-disk-encryption}}.&lt;br /&gt;
# Configure {{ic|/etc/ykfde.conf}}.&lt;br /&gt;
# Enroll the disk: {{ic|# ykfde-enroll -d /dev/&#039;&#039;DISK&#039;&#039; -s &#039;&#039;LUKS_SLOT&#039;&#039;}}&lt;br /&gt;
# Add the {{ic|ykfde}} [[mkinitcpio#HOOKS|mkinitcpio hook]] before the {{ic|encrypt}} hook.&lt;br /&gt;
# [[Regenerate the initramfs]].&lt;br /&gt;
&lt;br /&gt;
:{{Note|Plymouth users: replace the {{ic|plymouth-encrypt}} hook with the {{ic|ykfde}} hook.}}&lt;br /&gt;
&lt;br /&gt;
There are a few variations available:&lt;br /&gt;
&lt;br /&gt;
* 2FA: default behavior. You must provide the challenge as a password when enrolling the device, and upon boot.&lt;br /&gt;
* 1FA: Set {{ic|YKFDE_CHALLENGE}} in {{ic|ykfde.conf}}. Note that this is stored in plaintext. Consider disabling non-root read permissions to this file.&lt;br /&gt;
* [https://github.com/agherzan/yubikey-full-disk-encryption#enable-nfc-support-in-ykfde-initramfs-hook-experimental NFC support] (Experimental)&lt;br /&gt;
* [https://github.com/agherzan/yubikey-full-disk-encryption#enable-ykfde-suspend-service-experimental Suspend &amp;amp; Resume support] (Experimental) Automatically lock encrypted volumes on suspend, unlock them on resume.&lt;br /&gt;
&lt;br /&gt;
You must regenerate the initramfs for any configuration changes to take effect.&lt;br /&gt;
&lt;br /&gt;
==== systemd-based initramfs ====&lt;br /&gt;
&lt;br /&gt;
Users of the {{ic|sd-encrypt}} hook may install {{AUR|mkinitcpio-ykfde}} or {{AUR|mkinitcpio-ykfde-git}} and follow the instruction in the [https://github.com/eworm-de/mkinitcpio-ykfde/blob/master/README-mkinitcpio.md project documentation]. The procedure is broadly similar to {{Pkg|yubikey-full-disk-encryption}}.&lt;br /&gt;
&lt;br /&gt;
==== GnuPG encrypted keyfile ====&lt;br /&gt;
&lt;br /&gt;
One tool to accomplish this is [https://github.com/fuhry/initramfs-scencrypt initramfs-scencrypt]; see its docs for complete instructions. Note that as of October 2022 this package is not in the AUR and is not thoroughly tested, though the GitHub repository offers a PKGBUILD.&lt;br /&gt;
&lt;br /&gt;
The [[dm-crypt/Specialties#Using GPG, LUKS, or OpenSSL encrypted keyfiles|dm-crypt pages]] offer a few alternatives, though they are mostly links to old forum posts.&lt;br /&gt;
&lt;br /&gt;
==== HMAC secret extension of FIDO2 protocol ====&lt;br /&gt;
&lt;br /&gt;
Yet another way of using YubiKey for full disk encryption is to utilize [https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-client-to-authenticator-protocol-v2.0-id-20180227.html#sctn-hmac-secret-extension HMAC Secret Extension] to retrieve the LUKS password from YubiKey. This can be protected by a passphrase. This functionality requires at least [https://support.yubico.com/hc/en-us/articles/360016649319-YubiKey-5-2-3-Enhancements-to-FIDO-2-Support YubiKey 5 with firmware 5.2.3+].&lt;br /&gt;
For a passphrase protected solution, install {{AUR|khefin}} and follow instructions available in [https://github.com/mjec/khefin/wiki/Arch-Linux-LUKS-configuration project documentation].&lt;br /&gt;
For single factor (optionally PIN-protected) solution and starting with systemd 248, it is possible to use your FIDO2 key as LUKS2 keyslot. Instructions available in the [https://0pointer.net/blog/unlocking-luks2-volumes-with-tpm2-fido2-pkcs11-security-hardware-on-systemd-248.html author&#039;s blog post].&lt;br /&gt;
&lt;br /&gt;
=== KeePass ===&lt;br /&gt;
&lt;br /&gt;
[[KeePass]] can be configured for YubiKey support; see the [[KeePass#Yubikey|YubiKey section]] for instructions.&lt;br /&gt;
&lt;br /&gt;
=== SSH keys ===&lt;br /&gt;
&lt;br /&gt;
==== CCID ====&lt;br /&gt;
&lt;br /&gt;
If your YubiKey supports CCID smartcards, you can use it as a hardware-backed [[SSH key]], either based on GPG or PIV keys. Yubico offers good documentation:&lt;br /&gt;
* An [https://developers.yubico.com/PIV/Guides/Securing_SSH_with_OpenPGP_or_PIV.html overview of both] possibilities, giving their advantages and disadvantages&lt;br /&gt;
* Instructions for [https://developers.yubico.com/PGP/SSH_authentication/index.html PGP authentication]&lt;br /&gt;
* Instructions for [https://developers.yubico.com/PIV/Guides/SSH_user_certificates.html PIV authentication through user certificates]&lt;br /&gt;
* Instructions for [https://developers.yubico.com/PIV/Guides/SSH_with_PIV_and_PKCS11.html PIV authentication through #PKCS11]&lt;br /&gt;
&lt;br /&gt;
:{{Note|The default PIN code of the PIV application on the YubiKey is {{ic|123456}}; you may want to change it, as well as the default management key. See the [https://developers.yubico.com/PIV/Guides/Device_setup.html device setup instructions] for more.}}&lt;br /&gt;
&lt;br /&gt;
==== U2F ====&lt;br /&gt;
&lt;br /&gt;
You may also use the U2F feature of the YubiKey to create hardware-backed SSH keys. See [[SSH keys#FIDO/U2F]] for instructions.&lt;br /&gt;
&lt;br /&gt;
==== PIV ====&lt;br /&gt;
&lt;br /&gt;
{{AUR|yubikey-agent}} stores the SSH key as PIV token. See https://github.com/FiloSottile/yubikey-agent#readme for a setup guide.&lt;br /&gt;
&lt;br /&gt;
=== Linux user authentication with PAM ===&lt;br /&gt;
&lt;br /&gt;
[[PAM]], and therefore anything which uses PAM for user authentication, can be configured to use a YubiKey as a factor of its user authentication process. This includes sudo, su, ssh, screen lockers, display managers, and nearly every other instance where a Linux system needs to authenticate a user. Its flexible configuration allows you to set whichever authentication requirements fit your needs, for the entire system, a specific application, or for groups of applications. For example, you could accept the YubiKey as an alternative to a password for local sessions, while requiring both for remote sessions. In addition to the Arch Wiki, You are encouraged to read {{man|8|pam}} and {{man|5|pam.conf}} to understand how it works and how to configure it.&lt;br /&gt;
&lt;br /&gt;
There are several modules available which integrate YubiKey-supported protocols into PAM:&lt;br /&gt;
&lt;br /&gt;
* {{Pkg|pam-u2f}} - Supports [[#U2F]] via the FIDO2 standard. If you are not sure which method to use, this one is a good choice.&lt;br /&gt;
** [[Universal 2nd Factor#Authentication for user sessions]]&lt;br /&gt;
** [https://developers.yubico.com/pam-u2f/ Yubico&#039;s official docs], including a list of supported module parameters.&lt;br /&gt;
** Man Pages: {{man|8|pam_u2f}}, {{man|1|pamu2fcfg}}&lt;br /&gt;
* {{Pkg|oath-toolkit}} - Supports [[#OATH]] one-time passwords (either HOTP or TOTP)&lt;br /&gt;
** [[pam_oath]]&lt;br /&gt;
* {{Pkg|yubico-pam}} - Supports [[#Yubico OTP]] and challenge-response OTPs. Note that Yubico OTP mode requires a network connection to a validation server, while challenge-response mode does not.&lt;br /&gt;
** [https://developers.yubico.com/yubico-pam/ Yubico&#039;s official docs]{{Dead link|2025|03|15|status=404}}&lt;br /&gt;
** {{man|8|pam_yubico}} - Take note of the {{ic|mode}} parameter, used to set challenge-response mode.&lt;br /&gt;
::{{Warning|yubico-pam [https://github.com/Yubico/yubico-pam repository] on GitHub was archived on February 20, 2025.}}&lt;br /&gt;
&lt;br /&gt;
{{Warning|Exercise caution when modifying PAM configuration files. Mistakes can render a system completely insecure, or so secure that no authentication is possible.}}&lt;br /&gt;
&lt;br /&gt;
PAM configuration is beyond the scope of this article, but for a brief overview:&lt;br /&gt;
&lt;br /&gt;
* Create file(s) containing authorized keys, either in users&#039; home directories or centrally.&lt;br /&gt;
* Add a line in the appropriate place in the appropriate PAM configuration file which follows this format:&lt;br /&gt;
    auth [required|sufficient] [module_name].so [module arguments]&lt;br /&gt;
* {{ic|auth required}} for multifactor, {{ic|auth sufficient}} for single factor.&lt;br /&gt;
* {{ic|module_name}} - Example: {{ic|pam_u2f.so}}. See a list of installed modules: {{ic|ls /usr/lib/security}}&lt;br /&gt;
* Module configuration arguments are for things like the location of the keyfile, or which method the module should use for authentication.&lt;br /&gt;
&lt;br /&gt;
==== SSH notes ====&lt;br /&gt;
&lt;br /&gt;
* Yubico has provided [https://developers.yubico.com/yubico-pam/Yubikey_and_SSH_via_PAM.html additional guidance]{{Dead link|2025|03|15|status=404}}. It is written for an old version of Ubuntu, but much of it still applies to an updated Arch system.&lt;br /&gt;
* If you are configuring a distant server to use YubiKey, you should open at least one additional, rescue SSH session, so that you are not locked out if the configuration fails.&lt;br /&gt;
* Check that {{ic|/etc/ssh/sshd_config}} contains the following settings. The {{ic|sshd_config}} shipped with {{Pkg|openssh}} has these set correctly by default.&lt;br /&gt;
    ChallengeResponseAuthentication no&lt;br /&gt;
    UsePAM yes&lt;br /&gt;
&lt;br /&gt;
=== Browser/web integration ===&lt;br /&gt;
&lt;br /&gt;
Many web services are beginning to support FIDO hardware tokens. See the [[U2F]] and [[WebAuthn]] pages for more information, but usually the only thing you need to do is to install {{Pkg|libfido2}} and [https://demo.yubico.com/webauthn-technical/registration try it].&lt;br /&gt;
&lt;br /&gt;
== Tips and tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Executing actions on insertion/removal of YubiKey device ===&lt;br /&gt;
&lt;br /&gt;
For example, you want to perform an action when you pull your YubiKey out of the USB slot, create the following:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/udev/rules.d/80-yubikey-actions.rules|2=&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ACTION==&amp;quot;remove&amp;quot;, ENV{ID_VENDOR}==&amp;quot;Yubico&amp;quot;, ENV{ID_VENDOR_ID}==&amp;quot;1050&amp;quot;, ENV{ID_MODEL_ID}==&amp;quot;0010|0111|0112|0113|0114|0115|0116|0401|0402|0403|0404|0405|0406|0407|0410&amp;quot;, RUN+=&amp;quot;&#039;&#039;/usr/local/bin/script args&#039;&#039;&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Please note, most keys are covered within this example but it may not work for all versions of YubiKey. You will have to look at the output of lsusb to get the vendor and model ID&#039;s, along with the description of the device or you could use udevadm to get information. Of course, to execute a script on insertion, you would change the action to &#039;add&#039; instead of remove.&lt;br /&gt;
&lt;br /&gt;
=== Start Yubico Authenticator on insertion ===&lt;br /&gt;
&lt;br /&gt;
The authenticator is a long-running GUI process. If run directly in a udev rule, the process would block udev&#039;s processing. If forked, udev would unconditionally kill the process after the event handling finishes. Thus you cannot start the authenticator from udev rules. However, systemd.device may be used to handle this case.&lt;br /&gt;
&lt;br /&gt;
Similar to above, create:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/udev/rules.d/80-yubikey-actions.rules|2=&amp;lt;nowiki&amp;gt;&lt;br /&gt;
ENV{ID_VENDOR}==&amp;quot;Yubico&amp;quot;, ENV{ID_VENDOR_ID}==&amp;quot;1050&amp;quot;, ENV{ID_MODEL_ID}==&amp;quot;0010|0111|0112|0113|0114|0115|0116|0401|0402|0403|0404|0405|0406|0407|0410&amp;quot;, SYMLINK+=&amp;quot;yubikey&amp;quot;, TAG+=&amp;quot;systemd&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Then [[create]] a new systemd [[user unit]]:&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.config/systemd/user/yubioath-desktop.service|2=&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Autostart Yubico Authenticator&lt;br /&gt;
# Uncomment if you want to stop the authenticator when unplugged.&lt;br /&gt;
#StopPropagatedFrom=dev-yubikey.device&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=dev-yubikey.device&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
Type=oneshot&lt;br /&gt;
ExecStart=/usr/bin/yubioath-desktop&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
and [[enable]] it. &#039;&#039;systemctl&#039;&#039; would warn that it is added as a dependency to a non-existent unit {{ic|dev-yubikey.device}}. But it is okay. Such unit will start existing once the YubiKey is plugged in.&lt;br /&gt;
&lt;br /&gt;
== Maintenance / upgrades ==&lt;br /&gt;
&lt;br /&gt;
=== Installing the OATH Applet for a YubiKey NEO ===&lt;br /&gt;
&lt;br /&gt;
These steps will allow you to install the OATH applet onto your YubiKey NEO. This allows the use of Yubico Authenticator in the Google Play Store.&lt;br /&gt;
&lt;br /&gt;
{{Note|1=These steps are only for NEOs with a firmware version &amp;lt;= 3.1.2. The current generation NEOs (with U2F) come with the OpenPGP applet already installed)}}&lt;br /&gt;
&lt;br /&gt;
==== Configure the NEO as a CCID device ====&lt;br /&gt;
&lt;br /&gt;
{{Out of date|yubikey-personalization-gui is dead and its repository has been archived. Apparently {{Pkg|yubikey-manager}} or {{AUR|yubico-authenticator}} are recommended alternatives. [https://lists.archlinux.org/archives/list/aur-requests@lists.archlinux.org/message/FM3Y56EOSBFTO35UMYAWIKSKK45U2FLG/]}}&lt;br /&gt;
&lt;br /&gt;
# Install {{Pkg|yubikey-personalization-gui}}.&lt;br /&gt;
# Add the udev rules and reboot so you can manage the YubiKey without needing to be root&lt;br /&gt;
# Run {{ic|ykpersonalize -m82}}, enter {{ic|y}}, and hit enter.&lt;br /&gt;
&lt;br /&gt;
==== Install the applet ====&lt;br /&gt;
&lt;br /&gt;
# Install {{AUR|gpshell}}, {{AUR|gppcscconnectionplugin}}, {{AUR|globalplatform}}, and {{Pkg|pcsclite}}.&lt;br /&gt;
# [[Start]] {{ic|pcscd.service}}.&lt;br /&gt;
# Download the most recent CAP file from the [https://developers.yubico.com/ykneo-oath/Releases/ ykneo-oath] site.&lt;br /&gt;
# Download {{ic|gpinstall.txt}} from [https://github.com/Yubico/ykneo-oath/blob/master/gpinstall.txt GitHub].&lt;br /&gt;
# Edit the line in gpinstall.txt beginning with {{ic|install -file}} to reflect the path where the CAP file is located.&lt;br /&gt;
# Open a terminal and run {{ic|gpshell &#039;&#039;path/to/gpinstall.txt&#039;&#039;}}.&lt;br /&gt;
# Ideally, a bunch of text will scroll by and it ends saying something like{{bc|&amp;lt;nowiki&amp;gt;Command --&amp;gt; 80E88013D7C000C400BE00C700CA00CA00B400BE00CE00D200D500D700B000DB00C700DF00BEFFFF00BE00E400AC00AE00AE00DB00E700A&lt;br /&gt;
A00EA00ED00ED00ED00BE00EF00F100F400F100F700FA00FF00BE00F700AA01010103010700CA00C400B400AA00F700B400AA00B600C7010C&lt;br /&gt;
010C00AA0140012001B0056810B0013005600000056810E0011006B4B44304B44404B44106B44B4405B443400343B002410636810E06B4B44&lt;br /&gt;
407326810B004B43103441003334002B102B404B3B403BB4003B440076820A4100221024405B4341008B44600000231066820A100&lt;br /&gt;
Wrapped command --&amp;gt; 84E88013DFC000C400BE00C700CA00CA00B400BE00CE00D200D500D700B000DB00C700DF00BEFFFF00BE00E400AC00AE00AE00DB00E700A&lt;br /&gt;
A00EA00ED00ED00ED00BE00EF00F100F400F100F700FA00FF00BE00F700AA01010103010700CA00C400B400AA00F700B400AA00B600C7010C&lt;br /&gt;
010C00AA0140012001B0056810B0013005600000056810E0011006B4B44304B44404B44106B44B4405B443400343B002410636810E06B4B44&lt;br /&gt;
407326810B004B43103441003334002B102B404B3B403BB4003B440076820A4100221024405B4341008B44600000231066820A15D848CB77&lt;br /&gt;
27D0EDA00&lt;br /&gt;
Response &amp;lt;-- 009000&lt;br /&gt;
Command --&amp;gt; 80E60C002107A000000527210108A00000052721010108A000000527210101010003C901000000&lt;br /&gt;
Wrapped command --&amp;gt; 84E60C002907A000000527210108A00000052721010108A000000527210101010003C9010000B4648127914A4C7C00&lt;br /&gt;
Response &amp;lt;-- 009000&lt;br /&gt;
card_disconnect&lt;br /&gt;
release_context&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
# Unplug the NEO and try it with the Yubico Authenticator app.&lt;br /&gt;
&lt;br /&gt;
==== (Optional) Install the Yubico Authenticator desktop client ====&lt;br /&gt;
&lt;br /&gt;
{{Out of date|Package got merged into {{AUR|yubico-authenticator}}.}}&lt;br /&gt;
&lt;br /&gt;
You can get the desktop version of the Yubico Authenticator by installing {{AUR|yubioath-desktop}}{{Broken package link|package not found}}.&lt;br /&gt;
&lt;br /&gt;
While {{ic|pcscd.service}} is running, run {{ic|yubioath-desktop}} and insert your YubiKey when prompted.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
Restart, especially if you have completed updates since your YubiKey last worked. Do this even if some functions appear to be functioning.&lt;br /&gt;
&lt;br /&gt;
=== YubiKey not acting as HID device ===&lt;br /&gt;
&lt;br /&gt;
{{Note|1=These steps are no longer necessary after [https://github.com/systemd/systemd/commit/d45ee2f31a8358db0accde2e7c81777cedadc3c2 systemd since v244] added native support for this functionality.}}&lt;br /&gt;
&lt;br /&gt;
Add udev rule as described in [https://michaelheap.com/yubikey-on-arch/ this article]:&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/udev/rules.d/10-security-key.rules|2=&lt;br /&gt;
KERNEL==&amp;quot;hidraw*&amp;quot;, SUBSYSTEM==&amp;quot;hidraw&amp;quot;, MODE=&amp;quot;0664&amp;quot;, GROUP=&amp;quot;users&amp;quot;, ATTRS{idVendor}==&amp;quot;2581&amp;quot;, ATTRS{idProduct}==&amp;quot;f1d0&amp;quot;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Run {{ic|udevadm trigger}} afterwards.&lt;br /&gt;
&lt;br /&gt;
=== ykman fails to connect to the YubiKey ===&lt;br /&gt;
&lt;br /&gt;
If the manager fails to connect to the YubiKey, make sure you have started {{ic|pcscd.service}} or {{ic|pcscd.socket}}.&lt;br /&gt;
&lt;br /&gt;
=== Error: Failed connecting to YubiKey 5 [OTP+FIDO+CCID]. Make sure the application have the required permissions. ===&lt;br /&gt;
&lt;br /&gt;
This can occur when using {{ic|ykman}} to access the oath credentials on the device if {{ic|scdaemon}} has already taken exclusive control of the device. [https://github.com/Yubico/yubikey-manager/issues/35]&lt;br /&gt;
&lt;br /&gt;
To fix this you can set the {{ic|reader-port}} option with the correct value for your device in {{ic|~/.gnupg/scdaemon.conf}}. [https://support.yubico.com/hc/en-us/articles/360013714479-Troubleshooting-Issues-with-GPG]&lt;br /&gt;
&lt;br /&gt;
{{Note|This will cause the gpgagent to re-prompt you to unlock the YubiKey after each time you access the YubiKey through ykman.}}&lt;br /&gt;
&lt;br /&gt;
For YubiKey NEO and YubiKey 4:&lt;br /&gt;
&lt;br /&gt;
 reader-port Yubico Yubikey&lt;br /&gt;
&lt;br /&gt;
or for YubiKey 5:&lt;br /&gt;
&lt;br /&gt;
 reader-port Yubico Yubi&lt;br /&gt;
&lt;br /&gt;
=== YubiKey fails to bind within a guest VM ===&lt;br /&gt;
&lt;br /&gt;
Assuming the YubiKey is available to the guest, the issue results from a driver binding to the device on the host. To unbind the device, the bus and port information is needed from [[dmesg]] on the host:&lt;br /&gt;
&lt;br /&gt;
 # dmesg | grep -B1 Yubico | tail -n 2 | head -n 1 | sed -E &#039;s/^\&amp;lt;nowiki&amp;gt;[[^]]&amp;lt;/nowiki&amp;gt;+\] usb (&amp;lt;nowiki&amp;gt;[^:]&amp;lt;/nowiki&amp;gt;*):.*/\1/&#039;&lt;br /&gt;
&lt;br /&gt;
The resulting USB id should be of the form {{ic|X-Y.Z}} or {{ic|X-Y}}. Then, on the host, use {{ic|find}} to search {{ic|/sys/bus/usb/drivers}} for which driver the YubiKey is binded to (e.g. {{ic|usbhid}} or {{ic|usbfs}}).&lt;br /&gt;
&lt;br /&gt;
 $ find /sys/bus/usb/drivers -name &amp;quot;*X-Y.Z*&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To unbind the device, use the result from the previous command (i.e. {{ic|/sys/bus/usb/drivers/&#039;&#039;DRIVER&#039;&#039;/X-Y.Z:1.0}}):&lt;br /&gt;
&lt;br /&gt;
 # echo &#039;X-Y.Z:1.0&#039; &amp;gt; /sys/bus/usb/drivers/&#039;&#039;DRIVER&#039;&#039;/unbind&lt;br /&gt;
&lt;br /&gt;
=== Error: [key] could not be locally signed or gpg: No default secret key: No public key ===&lt;br /&gt;
&lt;br /&gt;
Occurs when attempting to sign keys on a non-standard keyring while a YubiKey is plugged in, e.g. as [[pacman/Package signing|Pacman]] does in {{ic|pacman-key --populate}}. The solution is to remove the offending YubiKey and start over.&lt;br /&gt;
&lt;br /&gt;
=== YubiKey disappears and reappears in Yubico Authenticator ===&lt;br /&gt;
&lt;br /&gt;
This happens when the CCID driver is not installed. You may need to [[install]] the {{Pkg|ccid}} package.&lt;br /&gt;
&lt;br /&gt;
=== YubiKey core error: timeout ===&lt;br /&gt;
&lt;br /&gt;
You are probably using the wrong slot. Try the other one.&lt;br /&gt;
&lt;br /&gt;
=== gpg: no such device ===&lt;br /&gt;
&lt;br /&gt;
gpg (scdaemon) tries to acquire exclusive access to the yubikey. It needs to be configured to use PSCS and use shared access.[https://blog.apdu.fr/posts/2024/12/gnupg-and-pcsc-conflicts-episode-3/][https://github.com/LudovicRousseau/PCSC/issues/65]&lt;br /&gt;
&lt;br /&gt;
Your configuration file should contain:&lt;br /&gt;
&lt;br /&gt;
{{hc|~/.gnupg/scdaemon.conf|&lt;br /&gt;
disable-ccid&lt;br /&gt;
pcsc-shared&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
For old versions of GnuPG, the {{ic|pcsc-shared}} option is not available. Only keep {{ic|disable-ccid}} and [[restart]] {{ic|pcscd.service}} as a workaround.&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Common_Access_Card&amp;diff=873097</id>
		<title>Common Access Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Common_Access_Card&amp;diff=873097"/>
		<updated>2026-05-05T17:44:16Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* See also */ update dead link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Smartcards]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|Smartcards}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
This page explains how to setup Arch to use a US Department of Defense [[wikipedia:Common_Access_Card|Common Access Card]] (CAC).&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Install {{Pkg|ccid}} and {{Pkg|opensc}}.&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
{{Note|You should not have to edit your opensc configuration files by default. You should check all other setup items first (e.g. certificate imports)}}&lt;br /&gt;
&lt;br /&gt;
If your card reader does not have a pin pad, [[append]] {{ic|1=enable_pinpad = false}} to {{ic|/etc/opensc.conf}}.&lt;br /&gt;
&lt;br /&gt;
Sometimes {{Pkg|opensc}} can struggle to identify the proper driver for CAC, instead it may choose PIV or something else. You can force the CAC driver by editing {{ic|/etc/opensc.conf}} for {{ic|1=card_drivers = cac}} and {{ic|1=force_card_driver = cac}}&lt;br /&gt;
&lt;br /&gt;
== Enable pcscd ==&lt;br /&gt;
&lt;br /&gt;
[[Start/enable]] {{ic|pcscd.socket}}.&lt;br /&gt;
&lt;br /&gt;
== Configure browser ==&lt;br /&gt;
&lt;br /&gt;
# Go to: https://www.cyber.mil/pki-pke/document-library&lt;br /&gt;
# Download certs: &#039;&#039;&amp;quot;PKI CA Certificate Bundles: PKCS#7 For DoD PKI Only - Version 5.14&amp;quot;&#039;&#039; (ZIP Download)&lt;br /&gt;
# Unzip the DoD PKI zip&lt;br /&gt;
# Follow browser-specific instructions&lt;br /&gt;
&lt;br /&gt;
=== Firefox ===&lt;br /&gt;
&lt;br /&gt;
==== Load security device ====&lt;br /&gt;
&lt;br /&gt;
Navigate to &#039;&#039;Edit &amp;gt; Settings &amp;gt; Privacy &amp;amp; Security &amp;gt; Certificates &amp;gt; Security Devices&#039;&#039; and click &amp;quot;Load&amp;quot; to load a module using {{ic|/usr/lib/opensc-pkcs11.so}} or {{ic|/usr/lib/pkcs11/opensc-pkcs11.so}}.&lt;br /&gt;
&lt;br /&gt;
{{Note|Firefox may report the module did not load correctly however you will have to check in the security devices to confirm whether the module properly loaded or not}}&lt;br /&gt;
&lt;br /&gt;
==== Import the DoD Certificates ====&lt;br /&gt;
&lt;br /&gt;
Install the certificates from the mentioned zip-file in &#039;&#039;this&#039;&#039; order, by going to &#039;&#039;Edit &amp;gt; Settings &amp;gt; Privacy &amp;amp; Security &amp;gt; Certificates &amp;gt; Manage Certificates &amp;gt; Authorities &amp;gt; Import&#039;&#039; (make sure to at-least check the box for &amp;quot;Trust this CA to identify websites&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
{{Note|As of the 5.14 version of the certificate zip}}&lt;br /&gt;
&lt;br /&gt;
# Certificates_PKCS7_v5_14_DoD_der.p7b&lt;br /&gt;
# Certificates_PKCS7_v5_14_DoD_DoD_Root_CA_3_der.p7b&lt;br /&gt;
# Certificates_PKCS7_v5_14_DoD_DoD_Root_CA_4_der.p7b &lt;br /&gt;
# Certificates_PKCS7_v5_14_DoD_DoD_Root_CA_5_der.p7b&lt;br /&gt;
# Certificates_PKCS7_v5_14_DoD_DoD_Root_CA_6_der.p7b&lt;br /&gt;
# DOD_PKE_Chain.pem&lt;br /&gt;
&lt;br /&gt;
=== Chromium/Google Chrome ===&lt;br /&gt;
&lt;br /&gt;
1. Add the CAC Module to the NSS DB. &lt;br /&gt;
&lt;br /&gt;
Ensure that your CAC is connected, that [[Chromium]] is closed and enter the following in a terminal: &lt;br /&gt;
{{ic|&amp;lt;nowiki&amp;gt;$ modutil -dbdir sql:$HOME/.pki/nssdb/ -add &amp;quot;CAC Module&amp;quot; -libfile /usr/lib/opensc-pkcs11.so&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
{{Note|You may see the message &#039;Failure to load dynamic library&#039;. This can be ignored.}}&lt;br /&gt;
Upon success you will see &amp;quot;Module &amp;quot;CAC Module&amp;quot; added to database.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
2. Check if the CAC Module was successfully added with {{ic|&amp;lt;nowiki&amp;gt;$ modutil -dbdir sql:$HOME/.pki/nssdb/ -list&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Navigate (in a shell) to the location of the unzipped DoD PKI files and install via:&lt;br /&gt;
&lt;br /&gt;
  for n in *der.p7b; do certutil -d sql:$HOME/.pki/nssdb -A -t TC -n $n -i $n; done&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
Re-open Chrome, Navigate to &#039;&#039;Settings &amp;gt; Show Advanced Settings &amp;gt; Manage Certificates &amp;gt; Authorities&#039;&#039; to load CA bundle from the  PEM-formatted file from above.&lt;br /&gt;
&lt;br /&gt;
4. Verify the authority is in Chrome under &#039;&#039;Settings &amp;gt; Show Advanced Settings &amp;gt; Manage Certificates &amp;gt; Authorities&#039;&#039; then expand &amp;quot;org-U.S. Government&amp;quot; and you should see a number of &amp;quot;DoD&amp;quot; certificates listed.&lt;br /&gt;
&lt;br /&gt;
== VMware/Omnissa Horizon Client ==&lt;br /&gt;
Please note that Omnissa purchased the horizon-view solution from VMware.&lt;br /&gt;
&lt;br /&gt;
===Omnissa:===&lt;br /&gt;
&lt;br /&gt;
Install {{AUR|omnissa-horizon-client}}, and {{AUR|omnissa-horizon-usb}}.&lt;br /&gt;
To integrate CAC authentication with the VMware Horizon Client, create the directory {{ic|/usr/lib/omnissa/horizon/pkcs11}} and link the pkcs11 library: &lt;br /&gt;
&lt;br /&gt;
 # ln -s /usr/lib/pkcs11/opensc-pkcs11.so /usr/lib/omnissa/horizon/pkcs11/libopenscpkcs11.so&lt;br /&gt;
Also create the following symlinks to enable ssl_3.4.0.&lt;br /&gt;
 # ln -sf /usr/lib/libcrypto.so.3 /usr/lib/omnissa/libcrypto.so.3&lt;br /&gt;
 # ln -sf /usr/lib/libssl.so.3 /usr/lib/omnissa/libssl.so.3&lt;br /&gt;
&lt;br /&gt;
If utilizing an external CAC reader, the following command must be utilized&lt;br /&gt;
 # sudo systemctl enable --now horizon-usb.service&lt;br /&gt;
&lt;br /&gt;
===VMware:===&lt;br /&gt;
Install {{AUR|vmware-horizon-client}}, {{AUR|vmware-horizon-usb}}, and {{AUR|vmware-horizon-smartcard}}. [[Start]] and [[enable]] {{ic|vmware-horizon-usb.service}}. &lt;br /&gt;
&lt;br /&gt;
To integrate CAC authentication with the VMware Horizon Client, create the directory {{ic|/usr/lib/vmware/view/pkcs11}} and link the pkcs11 library: &lt;br /&gt;
&lt;br /&gt;
 # ln -s /usr/lib/pkcs11/opensc-pkcs11.so /usr/lib/vmware/view/pkcs11/libopenscpkcs11.so&lt;br /&gt;
Also create the following symlinks to enable ssl_3.4.0&lt;br /&gt;
 # ln -sf /usr/lib/libcrypto.so.3 /usr/lib/vmware/libcrypto.so.3&lt;br /&gt;
 # ln -sf /usr/lib/libssl.so.3 /usr/lib/vmware/libssl.so.3&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Visit your favorite CAC secured web page and you should be asked for the &#039;&#039;Master Password&#039;&#039; for your certificate.  Enter it and if you get in, you know it is working.&lt;br /&gt;
&lt;br /&gt;
If some sites/pages seem to have a problem working correctly (e.g. outlook web access will not authenticate the session for DoD webmail) try using a private/incognito session to test validity of the cert chain and remove some variables.&lt;br /&gt;
&lt;br /&gt;
If you would like to manually query the certificates on a PIN enabled CAC/SmartCard, use the following command:&lt;br /&gt;
&lt;br /&gt;
 $ p11tool --login --provider=/usr/lib/pkcs11/opensc-pkcs11.so --list-all-certs -d 100&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
&lt;br /&gt;
=== opensc-tool ===&lt;br /&gt;
&lt;br /&gt;
Most of this information was found in a [https://web.archive.org/web/20200505031254/http://blog.fkraiem.org/2013/03/13/linux-smart-card-authentication-howto/ blog post by Firas Kraïem]&lt;br /&gt;
&lt;br /&gt;
Verify {{Pkg|opensc}} can see your reader: &lt;br /&gt;
&lt;br /&gt;
{{hc|$ opensc-tool --list-readers |&lt;br /&gt;
# Detected readers (pcsc)&lt;br /&gt;
Nr.  Card  Features  Name&lt;br /&gt;
0    Yes            Generic USB2.0-CRW [Smart Card Reader Interface] (20070818000000000) 00 00&lt;br /&gt;
}} &lt;br /&gt;
&lt;br /&gt;
List plugged in card: &lt;br /&gt;
&lt;br /&gt;
{{hc|$ opensc-tool --reader 0 --name |Personal Identity Verification Card}} &lt;br /&gt;
&lt;br /&gt;
List plugged in card and drive in use: &lt;br /&gt;
&lt;br /&gt;
{{hc|$ opensc-tool --reader 0 --name -v|&lt;br /&gt;
Connecting to card in reader Generic USB2.0-CRW [Smart Card Reader Interface] (20070818000000000) 00 00...&lt;br /&gt;
Using card driver Personal Identity Verification Card.&lt;br /&gt;
Card name: Personal Identity Verification Card&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== pcsc-tools ===&lt;br /&gt;
&lt;br /&gt;
An other option is {{Pkg|pcsc-tools}}. The program {{ic|pcsc_scan}} may be helpful&lt;br /&gt;
&lt;br /&gt;
{{hc|$ pcsc_scan|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
PC/SC device scanner&lt;br /&gt;
V 1.4.21 (c) 2001-2011, Ludovic Rousseau &amp;lt;ludovic.rousseau@free.fr&amp;gt;&lt;br /&gt;
Compiled with PC/SC lite version: 1.8.6&lt;br /&gt;
Using reader plug&#039;n play mechanism&lt;br /&gt;
Scanning present readers...&lt;br /&gt;
0: Dell Dell Smart Card Reader Keyboard 00 00&lt;br /&gt;
&lt;br /&gt;
Thu Sep  5 10:41:53 2013&lt;br /&gt;
Reader 0: Dell Dell Smart Card Reader Keyboard 00 00&lt;br /&gt;
  Card state: Card removed, &lt;br /&gt;
&lt;br /&gt;
Thu Sep  5 10:41:58 2013&lt;br /&gt;
Reader 0: Dell Dell Smart Card Reader Keyboard 00 00&lt;br /&gt;
  Card state: Card inserted, &lt;br /&gt;
  ATR: 3B DB 96 00 80 1F 03 00 31 C0 64 B0 F3 10 00 07 90 00 80&lt;br /&gt;
&lt;br /&gt;
ATR: 3B DB 96 00 80 1F 03 00 31 C0 64 B0 F3 10 00 07 90 00 80&lt;br /&gt;
+ TS = 3B --&amp;gt; Direct Convention&lt;br /&gt;
+ T0 = DB, Y(1): 1101, K: 11 (historical bytes)&lt;br /&gt;
  TA(1) = 96 --&amp;gt; Fi=512, Di=32, 16 cycles/ETU&lt;br /&gt;
    250000 bits/s at 4 MHz, fMax for Fi = 5 MHz =&amp;gt; 312500 bits/s&lt;br /&gt;
  TC(1) = 00 --&amp;gt; Extra guard time: 0&lt;br /&gt;
  TD(1) = 80 --&amp;gt; Y(i+1) = 1000, Protocol T = 0 &lt;br /&gt;
-----&lt;br /&gt;
  TD(2) = 1F --&amp;gt; Y(i+1) = 0001, Protocol T = 15 - Global interface bytes following &lt;br /&gt;
-----&lt;br /&gt;
  TA(3) = 03 --&amp;gt; Clock stop: not supported - Class accepted by the card: (3G) A 5V B 3V &lt;br /&gt;
+ Historical bytes: 00 31 C0 64 B0 F3 10 00 07 90 00&lt;br /&gt;
  Category indicator byte: 00 (compact TLV data object)&lt;br /&gt;
    Tag: 3, len: 1 (card service data byte)&lt;br /&gt;
      Card service data byte: C0&lt;br /&gt;
        - Application selection: by full DF name&lt;br /&gt;
        - Application selection: by partial DF name&lt;br /&gt;
        - EF.DIR and EF.ATR access services: by GET RECORD(s) command&lt;br /&gt;
        - Card with MF&lt;br /&gt;
    Tag: 6, len: 4 (pre-issuing data)&lt;br /&gt;
     Data: B0 F3 10 00&lt;br /&gt;
    Mandatory status indicator (3 last bytes)&lt;br /&gt;
      LCS (life card cycle): 07 (Operational state (activated))&lt;br /&gt;
      SW: 9000 (Normal processing.)&lt;br /&gt;
+ TCK = 80 (correct checksum)&lt;br /&gt;
&lt;br /&gt;
Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):&lt;br /&gt;
3B DB 96 00 80 1F 03 00 31 C0 64 B0 F3 10 00 07 90 00 80&lt;br /&gt;
	DoD CAC, Oberthur ID One 128 v5.5 Dual&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.idmanagement.gov/university/piv/ PIV Usage Guides]&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
	<entry>
		<id>https://wiki.archlinux.org/index.php?title=Common_Access_Card&amp;diff=873094</id>
		<title>Common Access Card</title>
		<link rel="alternate" type="text/html" href="https://wiki.archlinux.org/index.php?title=Common_Access_Card&amp;diff=873094"/>
		<updated>2026-05-05T17:39:06Z</updated>

		<summary type="html">&lt;p&gt;Indigo: /* Omnissa: */ apply Help:Style/White space&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Smartcards]]&lt;br /&gt;
{{Related articles start}}&lt;br /&gt;
{{Related|Smartcards}}&lt;br /&gt;
{{Related articles end}}&lt;br /&gt;
This page explains how to setup Arch to use a US Department of Defense [[wikipedia:Common_Access_Card|Common Access Card]] (CAC).&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Install {{Pkg|ccid}} and {{Pkg|opensc}}.&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
{{Note|You should not have to edit your opensc configuration files by default. You should check all other setup items first (e.g. certificate imports)}}&lt;br /&gt;
&lt;br /&gt;
If your card reader does not have a pin pad, [[append]] {{ic|1=enable_pinpad = false}} to {{ic|/etc/opensc.conf}}.&lt;br /&gt;
&lt;br /&gt;
Sometimes {{Pkg|opensc}} can struggle to identify the proper driver for CAC, instead it may choose PIV or something else. You can force the CAC driver by editing {{ic|/etc/opensc.conf}} for {{ic|1=card_drivers = cac}} and {{ic|1=force_card_driver = cac}}&lt;br /&gt;
&lt;br /&gt;
== Enable pcscd ==&lt;br /&gt;
&lt;br /&gt;
[[Start/enable]] {{ic|pcscd.socket}}.&lt;br /&gt;
&lt;br /&gt;
== Configure browser ==&lt;br /&gt;
&lt;br /&gt;
# Go to: https://www.cyber.mil/pki-pke/document-library&lt;br /&gt;
# Download certs: &#039;&#039;&amp;quot;PKI CA Certificate Bundles: PKCS#7 For DoD PKI Only - Version 5.14&amp;quot;&#039;&#039; (ZIP Download)&lt;br /&gt;
# Unzip the DoD PKI zip&lt;br /&gt;
# Follow browser-specific instructions&lt;br /&gt;
&lt;br /&gt;
=== Firefox ===&lt;br /&gt;
&lt;br /&gt;
==== Load security device ====&lt;br /&gt;
&lt;br /&gt;
Navigate to &#039;&#039;Edit &amp;gt; Settings &amp;gt; Privacy &amp;amp; Security &amp;gt; Certificates &amp;gt; Security Devices&#039;&#039; and click &amp;quot;Load&amp;quot; to load a module using {{ic|/usr/lib/opensc-pkcs11.so}} or {{ic|/usr/lib/pkcs11/opensc-pkcs11.so}}.&lt;br /&gt;
&lt;br /&gt;
{{Note|Firefox may report the module did not load correctly however you will have to check in the security devices to confirm whether the module properly loaded or not}}&lt;br /&gt;
&lt;br /&gt;
==== Import the DoD Certificates ====&lt;br /&gt;
&lt;br /&gt;
Install the certificates from the mentioned zip-file in &#039;&#039;this&#039;&#039; order, by going to &#039;&#039;Edit &amp;gt; Settings &amp;gt; Privacy &amp;amp; Security &amp;gt; Certificates &amp;gt; Manage Certificates &amp;gt; Authorities &amp;gt; Import&#039;&#039; (make sure to at-least check the box for &amp;quot;Trust this CA to identify websites&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
{{Note|As of the 5.14 version of the certificate zip}}&lt;br /&gt;
&lt;br /&gt;
# Certificates_PKCS7_v5_14_DoD_der.p7b&lt;br /&gt;
# Certificates_PKCS7_v5_14_DoD_DoD_Root_CA_3_der.p7b&lt;br /&gt;
# Certificates_PKCS7_v5_14_DoD_DoD_Root_CA_4_der.p7b &lt;br /&gt;
# Certificates_PKCS7_v5_14_DoD_DoD_Root_CA_5_der.p7b&lt;br /&gt;
# Certificates_PKCS7_v5_14_DoD_DoD_Root_CA_6_der.p7b&lt;br /&gt;
# DOD_PKE_Chain.pem&lt;br /&gt;
&lt;br /&gt;
=== Chromium/Google Chrome ===&lt;br /&gt;
&lt;br /&gt;
1. Add the CAC Module to the NSS DB. &lt;br /&gt;
&lt;br /&gt;
Ensure that your CAC is connected, that [[Chromium]] is closed and enter the following in a terminal: &lt;br /&gt;
{{ic|&amp;lt;nowiki&amp;gt;$ modutil -dbdir sql:$HOME/.pki/nssdb/ -add &amp;quot;CAC Module&amp;quot; -libfile /usr/lib/opensc-pkcs11.so&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
{{Note|You may see the message &#039;Failure to load dynamic library&#039;. This can be ignored.}}&lt;br /&gt;
Upon success you will see &amp;quot;Module &amp;quot;CAC Module&amp;quot; added to database.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
2. Check if the CAC Module was successfully added with {{ic|&amp;lt;nowiki&amp;gt;$ modutil -dbdir sql:$HOME/.pki/nssdb/ -list&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Navigate (in a shell) to the location of the unzipped DoD PKI files and install via:&lt;br /&gt;
&lt;br /&gt;
  for n in *der.p7b; do certutil -d sql:$HOME/.pki/nssdb -A -t TC -n $n -i $n; done&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
Re-open Chrome, Navigate to &#039;&#039;Settings &amp;gt; Show Advanced Settings &amp;gt; Manage Certificates &amp;gt; Authorities&#039;&#039; to load CA bundle from the  PEM-formatted file from above.&lt;br /&gt;
&lt;br /&gt;
4. Verify the authority is in Chrome under &#039;&#039;Settings &amp;gt; Show Advanced Settings &amp;gt; Manage Certificates &amp;gt; Authorities&#039;&#039; then expand &amp;quot;org-U.S. Government&amp;quot; and you should see a number of &amp;quot;DoD&amp;quot; certificates listed.&lt;br /&gt;
&lt;br /&gt;
== VMware/Omnissa Horizon Client ==&lt;br /&gt;
Please note that Omnissa purchased the horizon-view solution from VMware.&lt;br /&gt;
&lt;br /&gt;
===Omnissa:===&lt;br /&gt;
&lt;br /&gt;
Install {{AUR|omnissa-horizon-client}}, and {{AUR|omnissa-horizon-usb}}.&lt;br /&gt;
To integrate CAC authentication with the VMware Horizon Client, create the directory {{ic|/usr/lib/omnissa/horizon/pkcs11}} and link the pkcs11 library: &lt;br /&gt;
&lt;br /&gt;
 # ln -s /usr/lib/pkcs11/opensc-pkcs11.so /usr/lib/omnissa/horizon/pkcs11/libopenscpkcs11.so&lt;br /&gt;
Also create the following symlinks to enable ssl_3.4.0.&lt;br /&gt;
 # ln -sf /usr/lib/libcrypto.so.3 /usr/lib/omnissa/libcrypto.so.3&lt;br /&gt;
 # ln -sf /usr/lib/libssl.so.3 /usr/lib/omnissa/libssl.so.3&lt;br /&gt;
&lt;br /&gt;
If utilizing an external CAC reader, the following command must be utilized&lt;br /&gt;
 # sudo systemctl enable --now horizon-usb.service&lt;br /&gt;
&lt;br /&gt;
===VMware:===&lt;br /&gt;
Install {{AUR|vmware-horizon-client}}, {{AUR|vmware-horizon-usb}}, and {{AUR|vmware-horizon-smartcard}}. [[Start]] and [[enable]] {{ic|vmware-horizon-usb.service}}. &lt;br /&gt;
&lt;br /&gt;
To integrate CAC authentication with the VMware Horizon Client, create the directory {{ic|/usr/lib/vmware/view/pkcs11}} and link the pkcs11 library: &lt;br /&gt;
&lt;br /&gt;
 # ln -s /usr/lib/pkcs11/opensc-pkcs11.so /usr/lib/vmware/view/pkcs11/libopenscpkcs11.so&lt;br /&gt;
Also create the following symlinks to enable ssl_3.4.0&lt;br /&gt;
 # ln -sf /usr/lib/libcrypto.so.3 /usr/lib/vmware/libcrypto.so.3&lt;br /&gt;
 # ln -sf /usr/lib/libssl.so.3 /usr/lib/vmware/libssl.so.3&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Visit your favorite CAC secured web page and you should be asked for the &#039;&#039;Master Password&#039;&#039; for your certificate.  Enter it and if you get in, you know it is working.&lt;br /&gt;
&lt;br /&gt;
If some sites/pages seem to have a problem working correctly (e.g. outlook web access will not authenticate the session for DoD webmail) try using a private/incognito session to test validity of the cert chain and remove some variables.&lt;br /&gt;
&lt;br /&gt;
If you would like to manually query the certificates on a PIN enabled CAC/SmartCard, use the following command:&lt;br /&gt;
&lt;br /&gt;
 $ p11tool --login --provider=/usr/lib/pkcs11/opensc-pkcs11.so --list-all-certs -d 100&lt;br /&gt;
&lt;br /&gt;
== Debugging ==&lt;br /&gt;
&lt;br /&gt;
=== opensc-tool ===&lt;br /&gt;
&lt;br /&gt;
Most of this information was found in a [https://web.archive.org/web/20200505031254/http://blog.fkraiem.org/2013/03/13/linux-smart-card-authentication-howto/ blog post by Firas Kraïem]&lt;br /&gt;
&lt;br /&gt;
Verify {{Pkg|opensc}} can see your reader: &lt;br /&gt;
&lt;br /&gt;
{{hc|$ opensc-tool --list-readers |&lt;br /&gt;
# Detected readers (pcsc)&lt;br /&gt;
Nr.  Card  Features  Name&lt;br /&gt;
0    Yes            Generic USB2.0-CRW [Smart Card Reader Interface] (20070818000000000) 00 00&lt;br /&gt;
}} &lt;br /&gt;
&lt;br /&gt;
List plugged in card: &lt;br /&gt;
&lt;br /&gt;
{{hc|$ opensc-tool --reader 0 --name |Personal Identity Verification Card}} &lt;br /&gt;
&lt;br /&gt;
List plugged in card and drive in use: &lt;br /&gt;
&lt;br /&gt;
{{hc|$ opensc-tool --reader 0 --name -v|&lt;br /&gt;
Connecting to card in reader Generic USB2.0-CRW [Smart Card Reader Interface] (20070818000000000) 00 00...&lt;br /&gt;
Using card driver Personal Identity Verification Card.&lt;br /&gt;
Card name: Personal Identity Verification Card&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== pcsc-tools ===&lt;br /&gt;
&lt;br /&gt;
An other option is {{Pkg|pcsc-tools}}. The program {{ic|pcsc_scan}} may be helpful&lt;br /&gt;
&lt;br /&gt;
{{hc|$ pcsc_scan|&amp;lt;nowiki&amp;gt;&lt;br /&gt;
PC/SC device scanner&lt;br /&gt;
V 1.4.21 (c) 2001-2011, Ludovic Rousseau &amp;lt;ludovic.rousseau@free.fr&amp;gt;&lt;br /&gt;
Compiled with PC/SC lite version: 1.8.6&lt;br /&gt;
Using reader plug&#039;n play mechanism&lt;br /&gt;
Scanning present readers...&lt;br /&gt;
0: Dell Dell Smart Card Reader Keyboard 00 00&lt;br /&gt;
&lt;br /&gt;
Thu Sep  5 10:41:53 2013&lt;br /&gt;
Reader 0: Dell Dell Smart Card Reader Keyboard 00 00&lt;br /&gt;
  Card state: Card removed, &lt;br /&gt;
&lt;br /&gt;
Thu Sep  5 10:41:58 2013&lt;br /&gt;
Reader 0: Dell Dell Smart Card Reader Keyboard 00 00&lt;br /&gt;
  Card state: Card inserted, &lt;br /&gt;
  ATR: 3B DB 96 00 80 1F 03 00 31 C0 64 B0 F3 10 00 07 90 00 80&lt;br /&gt;
&lt;br /&gt;
ATR: 3B DB 96 00 80 1F 03 00 31 C0 64 B0 F3 10 00 07 90 00 80&lt;br /&gt;
+ TS = 3B --&amp;gt; Direct Convention&lt;br /&gt;
+ T0 = DB, Y(1): 1101, K: 11 (historical bytes)&lt;br /&gt;
  TA(1) = 96 --&amp;gt; Fi=512, Di=32, 16 cycles/ETU&lt;br /&gt;
    250000 bits/s at 4 MHz, fMax for Fi = 5 MHz =&amp;gt; 312500 bits/s&lt;br /&gt;
  TC(1) = 00 --&amp;gt; Extra guard time: 0&lt;br /&gt;
  TD(1) = 80 --&amp;gt; Y(i+1) = 1000, Protocol T = 0 &lt;br /&gt;
-----&lt;br /&gt;
  TD(2) = 1F --&amp;gt; Y(i+1) = 0001, Protocol T = 15 - Global interface bytes following &lt;br /&gt;
-----&lt;br /&gt;
  TA(3) = 03 --&amp;gt; Clock stop: not supported - Class accepted by the card: (3G) A 5V B 3V &lt;br /&gt;
+ Historical bytes: 00 31 C0 64 B0 F3 10 00 07 90 00&lt;br /&gt;
  Category indicator byte: 00 (compact TLV data object)&lt;br /&gt;
    Tag: 3, len: 1 (card service data byte)&lt;br /&gt;
      Card service data byte: C0&lt;br /&gt;
        - Application selection: by full DF name&lt;br /&gt;
        - Application selection: by partial DF name&lt;br /&gt;
        - EF.DIR and EF.ATR access services: by GET RECORD(s) command&lt;br /&gt;
        - Card with MF&lt;br /&gt;
    Tag: 6, len: 4 (pre-issuing data)&lt;br /&gt;
     Data: B0 F3 10 00&lt;br /&gt;
    Mandatory status indicator (3 last bytes)&lt;br /&gt;
      LCS (life card cycle): 07 (Operational state (activated))&lt;br /&gt;
      SW: 9000 (Normal processing.)&lt;br /&gt;
+ TCK = 80 (correct checksum)&lt;br /&gt;
&lt;br /&gt;
Possibly identified card (using /usr/share/pcsc/smartcard_list.txt):&lt;br /&gt;
3B DB 96 00 80 1F 03 00 31 C0 64 B0 F3 10 00 07 90 00 80&lt;br /&gt;
	DoD CAC, Oberthur ID One 128 v5.5 Dual&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://piv.idmanagement.gov/engineering/ PIV Usage Guides]{{Dead link|2023|09|16|status=404}}&lt;/div&gt;</summary>
		<author><name>Indigo</name></author>
	</entry>
</feed>