Hi my friends.
I have been following the Samba+LDAP=PDC in this forum. Ldap looks like is working, now I want to use my ldap db and used with my ftp(pure-ftpd) and mail(dovecot) services, but looks like PAM is my issue.
This is running inside a jail, my problem right now is dovecot.
This is my dovecot settings:
Now, nss_ldap symlink to ldap.conf in /usr/local/etc/ && /usr/local/etc/openldap/ as the some doc say.
This is my nss_ldap.conf:
I have been trying with different settings in nss_ldap.conf, this is the most simple.
My dovecot-ldap.conf is:
I can add users with smbldap-useradd no issue here, I can ask the system about my users:
dovecot.log:
Sometimes the log told something about /etc/pam.d/dovecot, I really don't understand how to setup this file in freebsd, in linux is easy, I google a while and found this:
Now u can see that service=imap in my log, which I copy the same settings as dovecot.
What I'm missing?
Thanks all for your time
I have been following the Samba+LDAP=PDC in this forum. Ldap looks like is working, now I want to use my ldap db and used with my ftp(pure-ftpd) and mail(dovecot) services, but looks like PAM is my issue.
This is running inside a jail, my problem right now is dovecot.
This is my dovecot settings:
Code:
dovecot -n
# 1.2.10: /usr/local/etc/dovecot.conf
# OS: FreeBSD 8.0-RELEASE-p2 i386
log_path: /var/log/dovecot.log
info_log_path: /var/log/dovecot.log
syslog_facility: local7
protocols: imap
listen: *:143
ssl: no
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable: /usr/local/libexec/dovecot/imap-login
login_greeting: Dovecot SSSST ready.
login_trusted_networks: 192.168.49.0/24
verbose_proctitle: yes
first_valid_uid: 1000
first_valid_gid: 1000
mail_privileged_group: mail
mail_location: maildir:~/Maildir
mail_debug: yes
maildir_stat_dirs: yes
maildir_copy_preserve_filename: yes
imap_client_workarounds: delay-newmail netscape-eoh tb-extra-mailbox-sep
namespace:
type: private
separator: .
prefix: INBOX.
inbox: yes
list: yes
subscriptions: yes
lda:
postmaster_address: postmaster
sendmail_path: /usr/sbin/sendmail
rejection_subject: Rejected: %s
rejection_reason: Your message to <%t> was automatically rejected:%n%r
auth default:
mechanisms: plain login
username_format: %Lu
verbose: yes
debug: yes
debug_passwords: yes
passdb:
driver: ldap
args: /usr/local/etc/dovecot-ldap.conf
userdb:
driver: passwd
args: /usr/local/etc/dovecot-ldap.conf blocking=yes
userdb:
driver: ldap
args: /usr/local/etc/dovecot-ldap.conf
socket:
type: listen
client:
path: /var/run/dovecot/auth-client
mode: 432
master:
path: /var/run/dovecot/auth-master
mode: 384
Now, nss_ldap symlink to ldap.conf in /usr/local/etc/ && /usr/local/etc/openldap/ as the some doc say.
This is my nss_ldap.conf:
Code:
host 192.168.49.6
# The distinguished name of the search base.
base dc=x,dc=dyndns, dc=org
ldap_version 3
port 389
pam_login_attribute uid
ssl off
I have been trying with different settings in nss_ldap.conf, this is the most simple.
My dovecot-ldap.conf is:
Code:
hosts = 192.168.49.6
dn = cn=Manager,dc=x,dc=dyndns,dc=org
dnpass = x
tls = no
auth_bind = yes
auth_bind_userdn = cn=%u,ou=x,ou=dyndns,dc=org
ldap_version = 3
base = ou=Users, dc=x, dc=dyndns, dc=org
scope = subtree
user_attrs = homeDirectory=home,uidNumber=uid,gidNumber=gid
user_filter = (&(objectClass=posixAccount)(uid=%u))
pass_attrs = uid=user,userPassword=password
pass_filter = (&(objectClass=posixAccount)(uid=%u))
default_pass_scheme = SSHA
I can add users with smbldap-useradd no issue here, I can ask the system about my users:
Code:
nis# smbldap-usershow test
dn: uid=test,ou=Users,dc=x,dc=dyndns,dc=org
objectClass: top,person,organizationalPerson,inetOrgPerson,posixAccount,shadowAccount,sambaSamAccount
cn: test
sn: test
givenName: test
uid: test
uidNumber: 10003
gidNumber: 513
homeDirectory: /home/test
loginShell: /sbin/nologin
gecos: System User
sambaLogonTime: 0
sambaLogoffTime: 2147483647
sambaKickoffTime: 2147483647
sambaPwdCanChange: 0
displayName: test
sambaSID: S-1-5-21-3301197195-1603911413-870733154-21006
sambaPrimaryGroupSID: S-1-5-21-3301197195-1603911413-870733154-513
sambaProfilePath: \\nis\profiles\test
sambaHomePath: \\nis\test
sambaHomeDrive: 'H:':
sambaLMPassword: CCF9155E3E7DB453AAD3B435B51404EE
sambaAcctFlags: [U]
sambaNTPassword: 3DBDE697D71690A769204BEB12283678
sambaPwdLastSet: 1270082815
sambaPwdMustChange: 2134082815
userPassword: {SSHA}ExZnNMyrMD2JrI2INCnhE/Z9i+pJUG9S
shadowLastChange: 14700
shadowMax: 10000
Code:
id test
uid=10003(test) gid=513(Domain Users) groups=513(Domain Users)
Code:
getent passwd
root:$1$zksrXGQa$wu5ckxSu6V8WIKDF5RS/0/:0:0:Charlie &:/root:/bin/csh
toor:*:0:0:Bourne-again Superuser:/root:
daemon:*:1:1:Owner of many system processes:/root:/usr/sbin/nologin
operator:*:2:5:System &:/:/usr/sbin/nologin
bin:*:3:7:Binaries Commands and Source:/:/usr/sbin/nologin
tty:*:4:65533:Tty Sandbox:/:/usr/sbin/nologin
kmem:*:5:65533:KMem Sandbox:/:/usr/sbin/nologin
games:*:7:13:Games pseudo-user:/usr/games:/usr/sbin/nologin
news:*:8:8:News Subsystem:/:/usr/sbin/nologin
man:*:9:9:Mister Man Pages:/usr/share/man:/usr/sbin/nologin
sshd:*:22:22:Secure Shell Daemon:/var/empty:/usr/sbin/nologin
smmsp:*:25:25:Sendmail Submission User:/var/spool/clientmqueue:/usr/sbin/nologin
mailnull:*:26:26:Sendmail Default User:/var/spool/mqueue:/usr/sbin/nologin
bind:*:53:53:Bind Sandbox:/:/usr/sbin/nologin
proxy:*:62:62:Packet Filter pseudo-user:/nonexistent:/usr/sbin/nologin
_pflogd:*:64:64:pflogd privsep user:/var/empty:/usr/sbin/nologin
_dhcp:*:65:65:dhcp programs:/var/empty:/usr/sbin/nologin
uucp:*:66:66:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp/uucico
pop:*:68:6:Post Office Owner:/nonexistent:/usr/sbin/nologin
www:*:80:80:World Wide Web Owner:/nonexistent:/usr/sbin/nologin
nobody:*:65534:65534:Unprivileged user:/nonexistent:/usr/sbin/nologin
mysql:*:88:88:MySQL Daemon:/var/db/mysql:/usr/sbin/nologin
ldap:*:389:389:OpenLDAP Server:/nonexistent:/sbin/nologin
dovecot:*:143:143:Dovecot User:/var/empty:/usr/sbin/nologin
postfix:*:125:125:Postfix Mail System:/var/spool/postfix:/usr/sbin/nologin
root:*:0:0:Netbios Domain Administrator:/home/root:/bin/false
nobody:*:999:514:nobody:/dev/null:/bin/false
test:*:10003:513:System User:/home/test:/sbin/nologin
dovecot.log:
Code:
pr 01 00:40:20 auth(default): Info: new auth connection: pid=16913
Apr 01 00:40:24 auth(default): Info: client in: AUTH 1 PLAIN service=imap secured lip=192.168.49.6 rip=192.168.49.6 lport=143 rport=51478 resp=AHBtb3Jlbm8AMTIz
Apr 01 00:40:24 auth(default): Info: ldap(test,192.168.49.6): invalid credentials (given password: 123)
Apr 01 00:40:26 auth(default): Info: client out: FAIL 1 user=test
Apr 01 00:40:31 imap-login: Info: Disconnected (auth failed, 1 attempts): user=<test>, method=PLAIN, rip=192.168.49.6, lip=192.168.49.6, secured
Sometimes the log told something about /etc/pam.d/dovecot, I really don't understand how to setup this file in freebsd, in linux is easy, I google a while and found this:
Code:
#%PAM-1.0
# auth
auth required /usr/local/lib/pam_ldap.so
# account
account required /usr/local/lib/pam_ldap.so
# session
session required /usr/local/lib/pam_ldap.so
# password
password required /usr/local/lib/pam_ldap.so
Now u can see that service=imap in my log, which I copy the same settings as dovecot.
What I'm missing?
Thanks all for your time
