Konfigurasjonsinformasjon
Konfigurasjonsinformasjonen plasseres i /etc/pam.d/
. Her er en eksempelfil:
# Begin /etc/pam.d/other
auth required pam_unix.so nullok
account required pam_unix.so
session required pam_unix.so
password required pam_unix.so nullok
# End /etc/pam.d/other
Lag nå noen generiske konfigurasjonsfiler. Som root
bruker:
install -vdm755 /etc/pam.d &&
cat > /etc/pam.d/system-account << "EOF" &&
# Begin /etc/pam.d/system-account
account required pam_unix.so
# End /etc/pam.d/system-account
EOF
cat > /etc/pam.d/system-auth << "EOF" &&
# Begin /etc/pam.d/system-auth
auth required pam_unix.so
# End /etc/pam.d/system-auth
EOF
cat > /etc/pam.d/system-session << "EOF" &&
# Begin /etc/pam.d/system-session
session required pam_unix.so
# End /etc/pam.d/system-session
EOF
cat > /etc/pam.d/system-password << "EOF"
# Begin /etc/pam.d/system-password
# use yescrypt hash for encryption, use shadow, and try to use any
# previously defined authentication token (chosen password) set by any
# prior module.
password required pam_unix.so yescrypt shadow try_first_pass
# End /etc/pam.d/system-password
EOF
Legg deretter til en restriktiv /etc/pam.d/other
konfigurasjonsfil. Med denne
filen vil programmer som er PAM bevisste ikke kjøre med mindre
det finnes en konfigurasjonsfil spesifikt for det programmet.
cat > /etc/pam.d/other << "EOF"
# Begin /etc/pam.d/other
auth required pam_warn.so
auth required pam_deny.so
account required pam_warn.so
account required pam_deny.so
password required pam_warn.so
password required pam_deny.so
session required pam_warn.so
session required pam_deny.so
# End /etc/pam.d/other
EOF
PAM manualsiden (man
pam) gir et godt utgangspunkt for å lære om de
forskjellige feltene og tillatte oppføringer. Linux-PAM System
Administrators' Guide på /usr/share/doc/Linux-PAM-1.7.0/Linux-PAM_SAG.txt
anbefales for ytterligere informasjon.