ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] /etc/passwd -> ldap: как задать пароль?
@ 2004-04-15 10:39 Eugene Prokopiev
  2004-04-15 10:44 ` Eugene Prokopiev
  2004-04-15 10:56 ` Eugene Prokopiev
  0 siblings, 2 replies; 3+ messages in thread
From: Eugene Prokopiev @ 2004-04-15 10:39 UTC (permalink / raw)
  To: community

Здравствуйте!

Имеем 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)

Если сделать то же под рутом, то, никаких паролей спрашивать не станут, 
пустят сразу.

Что я сделал не так?

-- 
С уважением, Прокопьев Евгений



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Comm] /etc/passwd -> ldap: как задать пароль?
  2004-04-15 10:39 [Comm] /etc/passwd -> ldap: как задать пароль? Eugene Prokopiev
@ 2004-04-15 10:44 ` Eugene Prokopiev
  2004-04-15 10:56 ` Eugene Prokopiev
  1 sibling, 0 replies; 3+ messages in thread
From: Eugene Prokopiev @ 2004-04-15 10:44 UTC (permalink / raw)
  To: community

> Что я сделал не так?

И вот что интересно: к самому дереву ldap с именем vasya и паролем 1 я 
подключаюсь без проблем

-- 
С уважением, Прокопьев Евгений



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Comm] /etc/passwd -> ldap: как задать пароль?
  2004-04-15 10:39 [Comm] /etc/passwd -> ldap: как задать пароль? Eugene Prokopiev
  2004-04-15 10:44 ` Eugene Prokopiev
@ 2004-04-15 10:56 ` Eugene Prokopiev
  1 sibling, 0 replies; 3+ messages in thread
From: Eugene Prokopiev @ 2004-04-15 10:56 UTC (permalink / raw)
  To: community

Нет, с подключением к дереву ldap все несколько сложнее:

$ 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
loginShell: /bin/bash
userPassword:: e1NTSEF9VjBhVG41YUZRR1VKcUI5RXFQVlRNSHE1SFh3ZVowRVg=
homeDirectory: /home/vasya

$ ldapsearch -LL -H ldap://localhost -b 
"dc=myserver,dc=myprovider,dc=ru" -D "cn=vasya, cn=Users, dc=myserver, 
dc=myprovider, dc=ru" -x "1"
version: 1

dn: dc=myserver, dc=myprovider, dc=ru

dn: cn=Users, dc=myserver, dc=myprovider, dc=ru

dn: cn=vasya, cn=Users, dc=myserver, dc=myprovider, dc=ru

$ ldapsearch -LL -H ldap://localhost -b 
"dc=myserver,dc=myprovider,dc=ru" -D "cn=vasyaxxx, cn=Users, 
dc=myserver, dc=myprovider, dc=ru" -x "x1x"
version: 1

dn: dc=myserver, dc=myprovider, dc=ru

dn: cn=Users, dc=myserver, dc=myprovider, dc=ru

dn: cn=vasya, cn=Users, dc=myserver, dc=myprovider, dc=ru

Как это объяснить?

-- 
С уважением, Прокопьев Евгений



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-04-15 10:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-15 10:39 [Comm] /etc/passwd -> ldap: как задать пароль? Eugene Prokopiev
2004-04-15 10:44 ` Eugene Prokopiev
2004-04-15 10:56 ` Eugene Prokopiev

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git