On last months we have seen some servers reporting problems on pam_imunify with block effect of FTP access to the servers. 



Error:

auth: pam_imunify(dovecot_imunify:auth): Error connecting to /opt/i360_pam_imunify/pam_imunify360.sock: Connection refused
auth: PAM Error connecting to /opt/i360_pam_imunify/pam_imunify360.sock: Connection refused
auth: pam_imunify(dovecot_imunify:auth): Error connecting to /opt/i360_pam_imunify/pam_imunify360.sock: Connection refused
auth: PAM Error connecting to /opt/i360_pam_imunify/pam_imunify360.sock: Connection refused
auth: pam_imunify(dovecot_imunify:auth): Error connecting to /opt/i360_pam_imunify/pam_imunify360.sock: Connection refused
auth: PAM Error connecting to /opt/i360_pam_imunify/pam_imunify360.sock: Connection refused
auth: pam_imunify(dovecot_imunify:auth): Error connecting to /opt/i360_pam_imunify/pam_imunify360.sock: Connection refused
auth: PAM Error connecting to /opt/i360_pam_imunify/pam_imunify360.sock: Connection refused
auth: pam_imunify(dovecot_imunify:auth): Error connecting to /opt/i360_pam_imunify/pam_imunify360.sock: Connection refused
auth: PAM Error connecting to /opt/i360_pam_imunify/pam_imunify360.sock: Connection refused
auth: pam_imunify(dovecot_imunify:auth): Error connecting to /opt/i360_pam_imunify/pam_imunify360.sock: Connection refused


After some tests and reaching Imunify360 support, this problem has been flagged as a Bug and will be fixed in the next releases.


To solve this, we need to do some changes on /usr/lib/systemd/system/imunify360-pam.service



Before:
ExecStartPre=/bin/rm -f /opt/i360_pam_imunify/pam_imunify360.sock



After:
ExecStartPre=/bin/rm -f /opt/i360_pam_imunify/pam_imunify360.sock /var/run/ftpd.imunify360.sock


After this change, we need to reload and restart imunify360-apm


Problem fixed, your users will be able to access to FTP again.