Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS Sonoma changes /etc/pam.d/sudo #784

Open
lilyball opened this issue Sep 28, 2023 · 3 comments · May be fixed by #1344
Open

macOS Sonoma changes /etc/pam.d/sudo #784

lilyball opened this issue Sep 28, 2023 · 3 comments · May be fixed by #1344

Comments

@lilyball
Copy link
Contributor

In macOS Sonoma, the /etc/pam.d/sudo file now starts with

auth       include        sudo_local

and there's a separate sudo_local.template file with the contents

# sudo_local: local config file which survives system update and is included for sudo
# uncomment following line to enable Touch ID for sudo
#auth       sufficient     pam_tid.so

Given this, the security.pam.enableSudoTouchIdAuth module should probably be changed to use environment.etc."pam.d/sudo_local" and then have the sed script check for the sudo_local line and insert that if it's not present. This way on macOS Sonoma the change will persist across OS updates.

@lilyball
Copy link
Contributor Author

I just tested applying this change to my macOS Ventura machine and it works there (as expected), although of course software updates will reset /etc/pam.d/sudo and so it won't persist until macOS Sonoma.

@stgarf
Copy link

stgarf commented Jan 27, 2024

You can add yubikeys as well if you are so inclined. Auth is parsed in order so if yubi fails/times out it falls back to tid next.

# sudo_local: local config file which survives system update and is included for sudo

# yubikey auth
auth       sufficient     /nix/store/.../pam_yubico.so  mode=challenge-response

# uncomment following line to enable Touch ID for sudo
auth       sufficient     pam_tid.so

@dwt
Copy link

dwt commented Feb 19, 2025

See #1020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants