web-dev-qa-db-fra.com

Configurer Saslautht avec PAM

J'essaie de configurer Saslautht avec PAM. J'ai créé un utilisateur test avec mot de passe test utiliser useradd et passwd _ et j'ai vérifié que je peux vous connecter avec su - test.

[Arch@vps-5220ce87 ~]$ systemctl status saslauthd
● saslauthd.service - Cyrus SASL authentication daemon
     Loaded: loaded (/usr/lib/systemd/system/saslauthd.service; enabled; vendor preset: disabled)
     Active: active (running) since Sat 2020-12-19 21:57:28 UTC; 43min ago
    Process: 932358 ExecStart=/usr/sbin/saslauthd $SASLAUTHD_OPTS (code=exited, status=0/SUCCESS)
   Main PID: 932360 (saslauthd)
      Tasks: 5 (limit: 4585)
     Memory: 1.8M
     CGroup: /system.slice/saslauthd.service
             ├─932360 /usr/sbin/saslauthd -a pam
             ├─932361 /usr/sbin/saslauthd -a pam
             ├─932362 /usr/sbin/saslauthd -a pam
             ├─932363 /usr/sbin/saslauthd -a pam
             └─932364 /usr/sbin/saslauthd -a pam
[Arch@vps-5220ce87 ~]$ cat /etc/conf.d/saslauthd
SASLAUTHD_OPTS="-a pam"
[Arch@vps-5220ce87 ~]$ cat /etc/pam.d/smtp
#%PAM-1.0
auth            required        pam_unix.so
account         required        pam_unix.so
[Arch@vps-5220ce87 ~]$ testsaslauthd -u test -p test
0: NO "authentication failed"
[Arch@vps-5220ce87 ~]$ Sudo journalctl -ru saslauthd -n 3
-- Logs begin at Mon 2020-11-16 09:26:47 UTC, end at Sat 2020-12-19 22:44:52 UTC. --
Dec 19 22:41:23 vps-5220ce87 saslauthd[932364]:                 : auth failure: [user=test] [service=imap] [realm=] [mech=pam] [reason=PAM auth error]
Dec 19 22:41:23 vps-5220ce87 saslauthd[932364]: DEBUG: auth_pam: pam_authenticate failed: Authentication failure
Dec 19 22:41:23 vps-5220ce87 saslauthd[932364]: pam_warn(imap:auth): function=[pam_sm_authenticate] flags=0x8000 service=[imap] terminal=[<unknown>] user=[t>
3
Labo

Désolé, c'était simple. Ma configuration PAM était pour le service smtp.

[Arch@vps-5220ce87 ~]$ testsaslauthd -u test -p test -s smtp
0: OK "Success."
1
Labo