[Comm] /etc/passwd -> ldap: как задать пароль?
Eugene Prokopiev
=?iso-8859-1?q?john_=CE=C1_rmts=2Edonpac=2Eru?=
Чт Апр 15 14:39:45 MSD 2004
Здравствуйте!
Имеем openldap, nss_ldap и pam_ldap, сконфигурированные так:
# grep ^[a-z] /etc/openldap/slapd.conf
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/misc.schema
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/openldap.schema
include /etc/openldap/schema/dhcp.schema
include /etc/openldap/schema/internet-access.schema
pidfile /var/run/slapd.pid
argsfile /var/run/slapd.args
database ldbm
suffix "dc=myserver,dc=myprovider,dc=ru"
rootdn "cn=manager,dc=myserver,dc=myprovider,dc=ru"
rootpw secret
directory /var/lib/ldap/bases
loglevel -1
index objectClass,uid,uidNumber,gidNumber eq
index cn,mail,surname,givenname eq,subinitial
index dhcpHWAddress eq
index dhcpClassData eq
# grep ^[a-z] /etc/ldap.conf
host 127.0.0.1
base dc=myserver,dc=myprovider,dc=ru
bindpw secret
rootbinddn cn=manager,dc=myserver,dc=myprovider,dc=ru
# grep ^[a-z] /etc/nsswitch.conf
passwd: files ldap nisplus nis
shadow: tcb ldap files nisplus nis
group: files ldap nisplus nis
hosts: files nisplus nis dns
ethers: files
netmasks: files
networks: files
protocols: files
rpc: files
services: files
bootparams: nisplus [NOTFOUND=return] files
netgroup: nisplus
publickey: nisplus
automount: files nisplus
aliases: files nisplus
Делаем следующее:
$ ldapadd -x -D "cn=manager,dc=myserver,dc=myprovider,dc=ru" -w "secret"
-f users.ldif
adding new entry "dc=myserver, dc=myprovider, dc=ru"
adding new entry "cn=Users, dc=myserver, dc=myprovider, dc=ru"
adding new entry "cn=vasya, cn=Users, dc=myserver, dc=myprovider, dc=ru"
$ ldapsearch -LL -H ldap://localhost -b "dc=myserver,dc=myprovider,dc=ru"
version: 1
dn: dc=myserver, dc=myprovider, dc=ru
objectClass: top
dn: cn=Users, dc=myserver, dc=myprovider, dc=ru
objectClass: top
dn: cn=vasya, cn=Users, dc=myserver, dc=myprovider, dc=ru
objectClass: posixAccount
objectClass: shadowAccount
cn: vasya
uid: vasya
uidNumber: 1000
gidNumber: 10
homeDirectory: /home/vasya
loginShell: /bin/bash
userPassword:: e21kNX0kMSRJT040U0lJSSRFWXlHRWVZdDRnMmhFZTl0aklDYWMu
$ ldappasswd -x -D "cn=manager,dc=myserver,dc=myprovider,dc=ru" -w
"secret" -s "1" "cn=vasya, cn=Users, dc=myserver, dc=myprovider, dc=ru"
Result: Success (0)
И вот теперь пытаемся подключиться:
$ su - vasya
Password:
вводим 1
su: Authentication failure
# tail /var/log/messages
Apr 15 14:16:25 john-ws pam_tcb[23262]: su: Authentication failed for
vasya from john(uid=501)
Если сделать то же под рутом, то, никаких паролей спрашивать не станут,
пустят сразу.
Что я сделал не так?
--
С уважением, Прокопьев Евгений
Подробная информация о списке рассылки community