4 ms·
And the best part is that it supports conditional logic with goto's! [success=3] mean's jump three rules ahead. Which means you can't really modify this file wi
by Spivak 5y ago
And the best part is that it supports conditional logic with goto's! [success=3] mean's jump three rules ahead. Which means you can't really modify this file without considering the whole thing.
This led Ubuntu to create /usr/share/pam-configs which have files like
Name: SSS authentication
Default: yes
Priority: 128
Auth-Type: Primary
Auth:
[success=end default=ignore] pam_sss.so use_first_pass
Auth-Initial:
[success=end default=ignore] pam_sss.so forward_pass
Account-Type: Additional
Account:
sufficient pam_localuser.so
[default=bad success=ok user_unknown=ignore] pam_sss.so
Session-Type: Additional
Session-Interactive-Only: yes
Session:
optional pam_sss.so
Password-Type: Primary
Password:
sufficient pam_sss.so use_authtok
Password-Initial:
sufficient pam_sss.so
to try and make something declarative. RHEL/CentOS went the authconfig route but both ended up saying to never ever touch anything in /etc/pam.d
- xena 5y agoWait, is this why my arbitrary changes to /etc/pam.d on Ubuntu have resulted in failure?
- Spivak 5y agoMaybe! Rewriting PAM is usually only done when messing with packages but can be called manually if you drop files in there with your config management. “Wow this could be really useful” you might think. “Where “is it documented?” https://wiki.ubuntu.com/PAMConfigFrameworkSpec https://wiki.ubuntu.com/PAMConfigFrameworkSpec “But where is the reference, how do I know what directives are even available?” …
- notacoward 5y agoThis is the part that really gets me about PAM. There really did need to be something where it sits, and the plugin approach is perfectly sound. (Aside: I hope the expressed horror at "plugins in C" is one of the satirical parts, because plenty of people really do have such a poor grasp of computing history.) On the other hand, the implementation of those basic ideas has always been plagued by inscrutable APIs/formats, poor documentation, and unnecessarily catastrophic failure modes - as shown in the talk itself, and some of the comments above. Actually working with PAM is almost as unpleasant as working with SELinux, and neither has to be so bad.
- gerdesj 5y agoYou can always take control back. I have a fair few Ubuntus lying around whilst I use Arch on my laptop and workstations. Ubuntu has /etc/pam.d/common-auth which looks like the main module to define your intent. Strip out the comments and see what you have left - read the comments first! Copy the whole lot somewhere and login to another console with root rights. Now you can play. What would you like to do?
- throwawayboise 5y ago> both ended up saying to never ever touch anything in /etc/pam.d As I've learned the hard way, at least keep a root shell open somewhere if you do...
- naleshniki 5y agoIt's important to be aware that this goto nonsense is not PAM. It's not in Solaris PAM nor in OpenPAM (the BSD's PAM, as used in macOS, FreeBSD, NetBSD, and DragonFly BSD.) Inventing bizarre and unusual turing complete configuration languages is a GNU/Linux hobby - just look at UDev reals.