<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Touchid on Geek Cabinet</title>
    <link>https://geekcabi.net/tags/touchid/</link>
    <description>Recent content in Touchid on Geek Cabinet</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 10 Nov 2022 00:00:00 +0000</lastBuildDate><atom:link href="https://geekcabi.net/tags/touchid/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Using Touch ID with sudo on macOS</title>
      <link>https://geekcabi.net/posts/using-touchid-sudo-macos/</link>
      <pubDate>Thu, 10 Nov 2022 00:00:00 +0000</pubDate>
      
      <guid>https://geekcabi.net/posts/using-touchid-sudo-macos/</guid>
      <description>&lt;p&gt;Here&amp;rsquo;s a quick cheat sheet for my own reference.&lt;/p&gt;
&lt;p&gt;macOS supports the use of &lt;a href=&#34;https://support.apple.com/guide/mac-help/use-touch-id-mchl16fbf90a/mac&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34; class=&#34;external&#34;&gt;Touch ID&lt;/a&gt; for sudo authentication. Yes, I still love to live in the terminal, so this is an everyday, multiple times a day thing for me.&lt;/p&gt;
&lt;p&gt;Fortunately, it&amp;rsquo;s a very quick edit to enable the functionality and it saves a TON of time (vs entering your password each time you run the sudo command - or worse, &lt;a href=&#34;https://linuxhandbook.com/sudo-without-password/&#34; rel=&#34;noopener&#34; target=&#34;_blank&#34; class=&#34;external&#34;&gt;setting the NOPASSWD option&lt;/a&gt;.)&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Here&rsquo;s a quick cheat sheet for my own reference.</p>
<p>macOS supports the use of <a href="https://support.apple.com/guide/mac-help/use-touch-id-mchl16fbf90a/mac" rel="noopener" target="_blank" class="external">Touch ID</a> for sudo authentication. Yes, I still love to live in the terminal, so this is an everyday, multiple times a day thing for me.</p>
<p>Fortunately, it&rsquo;s a very quick edit to enable the functionality and it saves a TON of time (vs entering your password each time you run the sudo command - or worse, <a href="https://linuxhandbook.com/sudo-without-password/" rel="noopener" target="_blank" class="external">setting the NOPASSWD option</a>.)</p>
<h2 id="edit-pam">Edit PAM</h2>
<p>Initial file contents</p>
<pre tabindex="0"><code># sudo: auth account password session
auth       sufficient     pam_smartcard.so
auth       required       pam_opendirectory.so
account    required       pam_permit.so
password   required       pam_deny.so
session    required       pam_permit.so
</code></pre><p><code>me@macbookpro:~ # sudo vi /etc/pam.d/sudo</code></p>
<p>Insert as the first uncommented line: <code>auth sufficient pam_tid.so</code></p>
<p>Resulting file contents</p>
<pre tabindex="0"><code># sudo: auth account password session
auth       sufficient     pam_tid.so
auth       sufficient     pam_smartcard.so
auth       required       pam_opendirectory.so
account    required       pam_permit.so
password   required       pam_deny.so
session    required       pam_permit.so
</code></pre><p>Force save (<code>:w!</code>) then quit (<code>:q</code>)</p>
<p>And you&rsquo;re done!</p>
<h2 id="but-there-is-a-minor-caveat">But there is a <em>minor</em> caveat&hellip;.</h2>
<p>In macOS, PAM cofiguration files are protected by <a href="https://support.apple.com/guide/security/system-integrity-protection-secb7ea06b49/web" rel="noopener" target="_blank" class="external">System Integrity Protection (SIP)</a> so they will be overwritten with every OS upgrade - <strong>by design</strong>.</p>
<p>It&rsquo;s a bit annyoing and maybe some day I&rsquo;ll dig into better options. But for now it&rsquo;s a quick and generally painless edit after an OS update.</p>
]]></content:encoded>
    </item>
    
  </channel>
</rss>
