【英文】MacOS上强制使用TouchID或AppleWatch验证身份

Preface

Force the use of TouchID or Apple Watch for authentication on MacOS

Modify Configuration File

  • Use TouchID or Apple Watch to authenticate with sudo command

For other commands, modify the corresponding configuration file under the /etc/pam.d/ directory.

  • Modify the configuration file with administrator privileges
1
sudo vim /etc/pam.d/sudo
  • Add a line below the commented line
1
2
# sudo: auth account password session
auth sufficient pam_tid.so
  • Save and exit
1
:wq!

Completion

  • Use TouchID or Apple Watch to authenticate instead of entering a password when using the sudo command

References

Blog of Undefined App