使用 PAM 配置 saslauthd

使用 PAM 配置 saslauthd

我正在尝试使用 PAM 配置 saslauthd。我使用和创建了一个test密码为 的用户,并检查我是否可以使用 进行登录。testuseraddpasswdsu - 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>

答案1

抱歉,这很简单。我的 pam 配置是针对服务的smtp

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

相关内容