Long SSH Login: pam_systemd 25s Delay

Long SSH Login What is PAM Pluggable Authentication Modules (PAM) is a middleware layer between applications (sshd, su, login, sudo) and authentication logic. Programs link against libpam.so and delegate authentication to it. Every login goes through a stack of modules defined in /etc/pam.d/. Why Login is Slow PAM runs modules sequentially on every login. If one module hangs, your login waits. Common suspects include pam_motd.so, pam_lastlog.so, and pam_env.so. In constrained deployments, the main offender is often:...

June 4, 2026 · 2 min