Skip to content

Instantly share code, notes, and snippets.

@agmm
Last active March 31, 2022 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agmm/6ec5ee9324bc413be947d5cc4d257c2b to your computer and use it in GitHub Desktop.
Save agmm/6ec5ee9324bc413be947d5cc4d257c2b to your computer and use it in GitHub Desktop.
Quick guide to restore /etc/pam.d/sudo

Quick guide to restore /etc/pam.d/sudo

  1. Create a file named sudo with the following content:
# 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
  1. Use Finder to copy the sudo file to /etc/pam.d/, replacing the misconfigured one.

  2. If that does not work, reboot the system while holding ⌘+R. This will give you access to a recovery terminal with enough privileges to resolve the issue.

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment