I was playing around with the pam.d file in nano and for some reason along the way I lost root access. Whenever I try to use the sudo command, I get an error like this:
[redacted]@[redacted] ~ % sudo sh
sudo: unable to initialize PAM: No such file or directory
When I try to go into single-user mode, or use sudo - I get the same error.
This is what the pam.d file looks like. I can't edit it back.
# sudo: auth account password session
auth sufficient /usr/local/Cellar/pam-u2f/1.0.4/lib/pam/pam_u2f.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
When I try to save, I get an error message saying [ Error writing sudo: Permission denied]
.
I'm on a MacBook Air 2017 running 10.15.1. How do I get back root access? Any help would be appreciated. Thanks!
Cmd
+S
orCmd
+V
?