proftpd Unable to open config file: /etc/security/pam_env.conf

Although it wasn’t causing any problems I wanted to stop proftpd logging these lines:

Aug 15 09:51:00 servername proftpd: pam_unix(proftpd:session): session opened for user joebloggs by (uid=0)
Aug 15 09:51:01 servername proftpd: pam_env(proftpd:setcred): Unable to open config file: /etc/security/pam_env.conf: No such file or directory
Aug 15 09:51:01 servername proftpd: pam_succeed_if(proftpd:session): error retrieving information about user 0
Aug 15 09:51:01 servername proftpd: pam_unix(proftpd:session): session closed for user joebloggs

Proftpd Logs

Many other people also appear to have the same problem. The solution appears to be to edit the file /etc/pam.d/proftpd and change the contents from:

#%PAM-1.0
auth       required     pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
#auth       required    pam_stack.so service=system-auth
auth       required     pam_shells.so
#account    required    pam_stack.so service=system-auth
#session    required    pam_stack.so service=system-auth
auth include system-auth
account include system-auth
session include system-auth

TO

#%PAM-1.0
session optional pam_keyinit.so force revoke
auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
auth required pam_shells.so
auth include system-auth
account include system-auth
# Comment the following line if you are having PAM issues with chrooted users
#session include system-auth
session required pam_loginuid.so

Hope this helps someone else.

One Response to “proftpd Unable to open config file: /etc/security/pam_env.conf”

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>