I experienced this issue on Hardy but I found evidence of it occurring on earlier versions and on Debian.
- You can't login using your normal credentials. Logging on in X (the graphical environment) raises an "authentication failed" error and the shell complains about an "unknown module".
- You can access the system in recovery mode and you can confirm that the users and passwords are set correctly.
- Attempting the su command from the shell raises "Unknown module: su" but you may be able to switch users (in single user mode)
- You may also see "Segmentation fault" errors.
- The system logs provide no help, there is no entry related to this failure.
PAM (Pluggable Authentication Modules) is failing to authenticate you because it can't load its essential modules.
**WARNING** Following these directions should be safe but you will run a potentially dangerous command. Take the proper precautions like backing up important data or the entire system. **
If you haven't messed with PAM the easiest thing to do is to take it out and replace it with a working copy from the official repositories.
Step 1: Start ubuntu using the recovery option (singe user mode)
Step 2: Purge the pam runtime and modules packages and some related files (don't try using apt for this):
Step 3: Reinstall those packages from the repositories:
dpkg --force-all --purge libpam-runtime
dpkg --force-all --purge libpam-modules
rm -rf /etc/pam.d
rm -rf /lib/security
Step 4: Reboot. You should be able to login normally now:
apt-get install libpam-runtime libpam-modules
My main source for fixing my issue and deriving these instructions:
The user in the following post had a similar issue but fixed it a different way, which did not work for me: