25

How can I use Touch ID for messages like this? osascript wants to make changes

0

1 Answer 1

35

For sudo to accept Touch ID for authentication, you'll need to configure your Pluggable Authentication Modules (PAM) system to accept the Touch ID authentication module.

Edit /etc/pam.d/sudo and add the following to the top of the list:

auth    sufficient  pam_tid.so

When osascript ‘wants to make changes’, likely because of a ‘with administrator privileges’ modifier, it uses the same authentication as ‘sudo’.

This affects how authentication will work for sudo, not just when using AppleScript. You'll now see the Touch ID prompt when using sudo on the command line, such as in Terminal, or when using other applications which request elevation using sudo.

                      Touch ID dialog prompt on screen to make changes

              Touch Bar prompt for authentication

3
  • Is it significant that tabs are used as separators instead of spaces? The source for this answer uses tabs, but when you copy/paste from StackOverflow, you get spaces. Commented Jun 4, 2018 at 20:39
  • @BallpointBen Any non-zero whitespace will work, tabs or spaces. You might like to use spaces to align the text with the existing ‘columns’ in the file.
    – grg
    Commented Jun 4, 2018 at 20:40
  • 2
    This works for sudo, but doesn't seem to work for all "want to make changes" dialogs. In particular those triggered by AuthorizationExecuteWithPrivileges, it still shows password instead of Touch ID. (github.com/rugarciap/Turbo-Boost-Switcher/blob/master/…) Commented Dec 22, 2019 at 10:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .