Unable to sudo: PAM authentication error: Module is unknown

TomNash picture TomNash · Sep 17, 2014 · Viewed 24.8k times · Source

After a typo in a change to /etc/pam.d/sudo no user can sudo at all. The package cannot be modified as it requires sudo privileges, but all attempts result in rm: cannot remove ‘/etc/pam.d/sudo’: Permission denied and attemps to escalate to sudo result in sudo: PAM authentication error: Module is unknown. The package cannot be removed as it requires sudo. What is there to be done?

Answer

TomNash picture TomNash · Sep 17, 2014

My account was part of the sudoers group, was able to pkexec vi /etc/pam.d/sudo and make the appropriate changes to the file as described here