I want to reduce ssh connection time, by debugging sshd have found that libpam is loading all pam modules specified in /etc/pam.d/sshd file at every connection.

How to configure/modifiy libpam such that it loads modules only for first connection and after it uses same modules for every connection? I know libpam was designed for loading pam modules but want to load pam modules once.

Let me know if anyone have any idea.

I'm using OpenSSH_5.8p1, OpenSSL 1.0.0l and Linux-PAM-1.1.3

  • 2
    Out of curiosity, did your debugging actually show that PAM loading was slow compared to the other parts of starting the session? If so, is PAM doing a lot of work to do authentication or is it really just the loading that is slow? Sorry to ask so many skeptical questions, it is just very surprising to me. I would expect other portions of the connection to dwarf simply loading the PAM modules. For example, if you have "UseDNS" set to yes.
    – Steven D
    Commented Mar 27, 2014 at 6:39


You must log in to answer this question.

Browse other questions tagged .