Lazy Diary @ Hatena Blog

PowerShell / Java / miscellaneous things about software development, Tips & Gochas. CC BY-SA 4.0/Apache License 2.0

Samba + LDAP で Samba ユーザの追加ができない

追加するユーザの uid を smbldaptest とする。

yusuke@hoge:~$ sudo /usr/bin/smbpasswd -a smbldaptest
New SMB password:
Retype new SMB password:
User smbldaptest does not exist in system password file (usually /etc/passwd).
 Cannot add account without a valid local system user.
Failed to modify password entry for user smbldaptest
yusuke@hoge:~$ 

上のようなメッセージが出ている場合は、LDAP(の通常は cn=people,dc=example,dc=com)にユーザ smbldaptest があるかチェック。なければ ldif ファイルを作って追加する。

yusuke@hoge:~$ sudo /usr/bin/smbpasswd -a smbldaptest
New SMB password:
Retype new SMB password:
LDAPS option set...!
ldap_connect_system: Binding to ldap server as "cn=admin,dc=example,dc=com"
Bind failed: Can't contact LDAP server
LDAPS option set...!
ldap_connect_system: Binding to ldap server as "cn=admin,dc=example,dc=com"
Bind failed: Can't contact LDAP server
Failed to add entry for user smbldaptest.
Failed to modify password entry for user smbldaptest
yusuke@hoge:~$ 

上のようなメッセージが出ている場合は、smb.conf の [global] セクションに "ldap ssl = off" のような記述があるかチェック。なければ追加する。on とか Yes になってたら off とか No にする。