![我无法使用 NIS 用户帐户登录邮件服务器](https://linux22.com/image/585487/%E6%88%91%E6%97%A0%E6%B3%95%E4%BD%BF%E7%94%A8%20NIS%20%E7%94%A8%E6%88%B7%E5%B8%90%E6%88%B7%E7%99%BB%E5%BD%95%E9%82%AE%E4%BB%B6%E6%9C%8D%E5%8A%A1%E5%99%A8.png)
下面是我的配置
# 2.0.13: /etc/dovecot/dovecot.conf
# OS: Linux 3.0.0-17-server x86_64 Ubuntu 11.10
auth_mechanisms = plain login
mail_location = maildir:/nfs/users/%u/Maildir
passdb {
args = scheme=CRYPT username_format=%u /etc/dovecot/users
driver = passwd-file
}
protocols = " imap pop3"
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
}
}
service imap-login {
inet_listener imap {
port = 143
}
inet_listener imaps {
port = 993
ssl = yes
}
}
ssl_cert = </etc/ssl/certs/mail.prisaltd.local.crt
ssl_key = </etc/ssl/private/prisa.key
userdb {
args = username_format=%u /etc/dovecot/users
driver = passwd-file
}
protocol imap {
imap_client_workarounds = tb-extra-mailbox-sep
imap_logout_format = bytes=%i/%o
mail_plugins =
}
/etc/pam.d/通用密码
# here are the per-package modules (the "Primary" block)
password [success=1 default=ignore] pam_unix.so obscure sha512 nis
# here's the fallback if no module succeeds
password requisite pam_deny.so
# prime the stack with a positive return value if there isn't one already;
# this avoids us returning an error just because nothing sets a success code
# since the modules above will each just jump around
password required pam_permit.so
# and here are more per-package modules (the "Additional" block)
password optional pam_ecryptfs.so
# end of pam-auth-update config
鸽舍原木
May 26 13:14:39 prisa-appserver ntpdate[574]: Can't find host ntp.ubuntu.com: Name or service not known (-2)
May 26 13:14:39 prisa-appserver ntpdate[574]: no servers can be used, exiting
May 26 13:14:48 prisa-appserver sudo: pam_ecryptfs: pam_sm_authenticate: /home/prisa is already mounted
May 26 13:14:50 prisa-appserver kernel: [ 90.418686] CIFS: Unknown mount option -
May 26 13:14:50 prisa-appserver kernel: [ 90.472004] CIFS VFS: default security mechanism requested. The default security mechanism will be upgraded from ntlm to ntlmv2 in kernel release 3.1
May 26 13:15:44 prisa-appserver ntpdate[1571]: Can't find host ntp.ubuntu.com: Name or service not known (-2)
May 26 13:15:44 prisa-appserver ntpdate[1571]: no servers can be used, exiting
May 26 13:17:01 prisa-appserver CRON[1678]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
May 26 13:39:01 prisa-appserver CRON[1775]: (root) CMD ( [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php5/maxlifetime) ! -execdir fuser -s {} 2>/dev/null \; -delete)
May 26 13:46:08 prisa-appserver dovecot: imap-login: Disconnected (auth failed, 3 attempts): user=<prisa>, method=PLAIN, rip=192.168.128.14, lip=192.168.128.15, TLS
May 26 13:46:59 prisa-appserver dovecot: imap-login: Aborted login (no auth attempts): rip=192.168.128.14, lip=192.168.128.15
May 26 13:46:59 prisa-appserver dovecot: imap-login: Aborted login (no auth attempts): rip=192.168.128.14, lip=192.168.128.15
May 26 13:46:59 prisa-appserver dovecot: imap-login: Disconnected (no auth attempts): rip=192.168.128.14, lip=192.168.128.15, TLS handshaking: SSL_accept() failed: error:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown ca: SSL alert number 48
May 26 13:46:59 prisa-appserver dovecot: pop3-login: Aborted login (no auth attempts): rip=192.168.128.14, lip=192.168.128.15
May 26 13:46:59 prisa-appserver dovecot: pop3-login: Aborted login (no auth attempts): rip=192.168.128.14, lip=192.168.128.15
May 26 13:46:59 prisa-appserver dovecot: pop3-login: Disconnected (no auth attempts): rip=192.168.128.14, lip=192.168.128.15, TLS handshaking: SSL_accept() failed: error:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown ca: SSL alert number 48
May 26 13:46:59 prisa-appserver dovecot: imap-login: Aborted login (no auth attempts): rip=192.168.128.14, lip=192.168.128.15, TLS
May 26 13:46:59 prisa-appserver dovecot: pop3-login: Disconnected (no auth attempts): rip=192.168.128.14, lip=192.168.128.15, TLS
May 26 13:47:04 prisa-appserver postfix/smtpd[1820]: connect from unknown[192.168.128.14]
May 26 13:47:04 prisa-appserver postfix/smtpd[1820]: improper command pipelining after EHLO from unknown[192.168.128.14]
May 26 13:47:04 prisa-appserver postfix/smtpd[1820]: disconnect from unknown[192.168.128.14]
May 26 13:47:04 prisa-appserver postfix/smtpd[1830]: connect from unknown[192.168.128.14]
May 26 13:47:04 prisa-appserver postfix/smtpd[1830]: lost connection after CONNECT from unknown[192.168.128.14]
May 26 13:47:04 prisa-appserver postfix/smtpd[1830]: disconnect from unknown[192.168.128.14]
May 26 13:47:22 prisa-appserver dovecot: imap-login: Disconnected (auth failed, 3 attempts): user=<femmy>, method=PLAIN, rip=192.168.128.14, lip=192.168.128.15, TLS
May 26 13:47:48 prisa-appserver dovecot: imap-login: Disconnected (auth failed, 3 attempts): user=<[email protected]>, method=PLAIN, rip=192.168.128.14, lip=192.168.128.15, TLS
May 26 13:48:15 prisa-appserver dovecot: imap-login: Disconnected (auth failed, 3 attempts): user=<femmy>, method=PLAIN, rip=192.168.128.14, lip=192.168.128.15, TLS
May 26 13:48:21 prisa-appserver dovecot: imap-login: Disconnected (auth failed, 3 attempts): user=<[email protected]>, method=PLAIN, rip=192.168.128.14, lip=192.168.128.15, TLS
请问我做错了什么?我已经这样做了 2 周了。
谢谢
答案1
Dovecot 不假设您想要为系统用户启用访问权限。这允许它提供只有虚拟用户才能访问的环境。看来您只配置了虚拟用户。您可以组合多个用户和密码数据库。我使用额外的密码数据库为来自网吧和其他远程位置的用户提供仅限电子邮件的密码。
您没有为使用系统 (NIS) 用户登录做出任何规定。尝试userdb
使用 passwd 驱动程序添加规范。类似这样的操作应该可行。
userdb {
driver = passwd
}
您还需要相应的passdb
(密码数据库)规范。使用passwd
驱动程序将使用 NSS 查找,其中应包括 NID 数据。由于您已配置 PAM,因此您可能需要尝试该pam
驱动程序。
passdb {
driver = passwd
}
在 Ubuntu 上,这些选项可用,但在 中被注释掉了/etc/dovecot/conf.d/auth-system.conf.ext
。您需要取消注释此文件中的相应行,以及取消注释 中包含此文件的行/etc/dovecot/confd./10-auth.conf
。如果您有该文件,这将是添加配置的合适文件。根据我的经验,dovecot
只要配置数据位于包含在配置中的文件中,它将以任何顺序接受配置数据。dovecot -n
在包含和注释删除后,该命令将显示配置数据。