Question: how pam works in linux?
Answer: How PAM Works: The Basics. Notice that the login program, used by programs such as getty and in. telnetd to authenticate users and log them in, is linked against the PAM libraries. When a specific service such as login requires user authentication, it employs the PAM routines to complete this authentication.