# TouchID for Sudo

## Overview

Instead of having to type our password each time we use `sudo` we can instead use Touch ID on our mac keyboards.&#x20;

{% hint style="warning" %}
While we can use the `/etc/pam.d/sudo` file for this, changes will not survive system updates, and if we accidentally mess something up, it's [quite a pain](https://medium.com/@zmre/quick-tip-fixing-the-sudo-file-on-macos-cf3c2a2584d4) to fix it!
{% endhint %}

Instead, we can&#x20;

* Copy the file `/etc/pam.d/sudo_local.template` to `/etc/pam.d/sudo_local`&#x20;
* Then remove the `#` in front of the `auth` like below

```bash
# /etc/pam.d/sudo_local
𝗮𝘂𝘁𝗵    𝘀𝘂𝗳𝗳𝗶𝗰𝗶𝗲𝗻𝘁   𝗽𝗮𝗺_𝘁𝗶𝗱.𝘀𝗼
```

Then save, and the next time you run sudo, you'll be prompted for Touch ID instead of your password.&#x20;

<figure><img src="https://2721275171-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8yu8YbDfwd1VqEdUxGyA%2Fuploads%2FPca8fAUrOzfZhGA8EHJC%2FCleanShot%202025-11-15%20at%2012.59.40%402x.png?alt=media&#x26;token=9f403219-ab98-449f-8fc3-806049aa9916" alt=""><figcaption></figcaption></figure>
