The following is a minimal implementation of
<citerefentry><refentrytitle>pam_unix
</refentrytitle><manvolnum>8
</manvolnum></citerefentry>, offering only authentication services. It should build and run with most PAM implementations, but takes advantage of OpenPAM extensions if available: note the use of
<citerefentry><refentrytitle>pam_get_authtok
</refentrytitle><manvolnum>3
</manvolnum></citerefentry>, which enormously simplifies prompting the user for a password.