# 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="/files/YB7ubJ9WXkZYXzP92uM5" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.techwithtyler.dev/operating-systems/macos/touchid-for-sudo.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
