Чтиво: установка сервера часть 029
Настройка и использование LDAP. Часть III.
На текущий момент в базе LDAP существует следующая структура
karavay-shops.ru
|
|-- admin
|-- users
|-- services
Для использования bind совместно с LDAP нужно занести данные о
зонах DNS, для этого создаем ldif-файлы следующего содержания:
begin ou_dns.ldif dn: ou=DNS,dc=karavay-shops,dc=ru
objectclass: organizationalUnit
ou: DNS
description: DNS entry
end ou_dns.ldif для прямой зоны зоны "localhost"
***********************************************************************
$TTL 86400
$ORIGIN localhost.
@ IN SOA bridge.karavay-shops.ru. root.bridge.karavay-shops.ru.
(
2003111001 28800 14400 3600000 86400 )
IN NS bridge.karavay-shops.ru.
IN A 127.0.0.1
***********************************************************************
begin ou_dns_loc.ldif dn: zoneName=localhost,ou=DNS,dc=karavay-shops,dc=ru
objectClass: dNSZone
zoneName: localhost
relativeDomainName: localhost
dn: relativeDomainName=@,zoneName=localhost,ou=DNS,dc=karavay-shops,dc=ru
objectClass: dNSZone
relativeDomainName: @
zoneName: localhost
dNSClass: IN
sOARecord: bridge.karavay-shops.ru. root.bridge.karavay-shops.ru. 2004022701
28800 14400 3600000 86400
nSRecord: bridge.karavay-shops.ru.
aRecord: 127.0.0.1
end ou_dns_loc.ldif для обратной зоны "0.0.127.in-addr.arpa"
***********************************************************************
$TTL 86400
@ IN SOA bridge.karavay-shops.ru. root.bridge.karavay-shops.ru. (
2003111001 28800 14400 3600000 86400 )
IN NS bridge.karavay-shops.ru.
1 IN PTR localhost.
***********************************************************************
begin ou_dns_loc_r.ldif dn: zoneName=0.0.127.in-addr.arpa,ou=DNS,dc=karavay-shops,dc=ru
objectClass: dNSZone
zoneName: 0.0.127.in-addr.arpa
relativeDomainName: 0.0.127.in-addr.arpa
dn: relativeDomainName=@,zoneName=0.0.127.in-addr.arpa,ou=DNS,dc=karavay-shops,dc=ru
objectClass: dNSZone
relativeDomainName: @
zoneName: 0.0.127.in-addr.arpa
dNSClass: IN
sOARecord: bridge.karavay-shops.ru. root.bridge.karavay-shops.ru. 2004022701
28800 14400 3600000 86400
nSRecord: bridge.karavay-shops.ru.
dn: relativeDomainName=1,zoneName=0.0.127.in-addr.arpa,ou=DNS,dc=karavay-shops,dc=ru
objectClass: dNSZone
relativeDomainName: 1
zoneName: 0.0.127.in-addr.arpa
dNSClass: IN
pTRRecord: localhost.
end ou_dns_loc_r.ldif Добавляю их в базу:
$ ldapadd -x -D cn=admin,dc=karavay-shops,dc=ru -W -f ou_dns.ldif
$ ldapadd -x -D cn=admin,dc=karavay-shops,dc=ru -W -f ou_dns_loc.ldif
$ ldapadd -x -D cn=admin,dc=karavay-shops,dc=ru -W -f ou_dns_loc_r.ldif
На этом пока остановлюсь. А добавлю еще пользователей, сервисов, и
почтовых транспортов, с помощью которых покажу правила работы с ACL и
примеры использования программы ldapsearch.
Итак, сервисы:
begin services.ldif dn: cn=postfix,ou=services,dc=karavay-shops,dc=ru
objectclass: person
cn: postfix
sn: postfix
description: postfix account
userPassword: {SSHA}BxMFldDbN1o/ZdyyQOwt/qyW7YYx290A
dn: cn=courier,ou=services,dc=karavay-shops,dc=ru
objectclass: person
cn: courier
sn: courier-imap
description: courier account
userPassword: {SSHA}5lZkHbUOdAQFIN6RT36chw/+x+mGT3bV
end services.ldif $ ldapadd -x -D cn=admin,dc=karavay-shops,dc=ru -W -f services.ldif
Сейчас - пользователи:
begin users.ldif dn: uid=koal,ou=users,dc=karavay-shops,dc=ru
objectClass: posixAccount
objectClass: mailAccount
cn: standart mail account
uid: koal
userPassword: {MD5}8s7qFTasG8ypIx/ByEHg2w==
mail: Kolotov.Alexan***@m*****.com
mailAccess: enable
mailAlias: koal@m*****.com
mailAlias: kolotov.alexan***@m*****.com
mailAlias: ebo***@m*****.com
uidNumber: 500
gidNumber: 500
gecos: Kolotov Alexandr
homeDirectory: /home/koal
loginShell: /bin/bash
mailBox: koal/
mailDirectory: /var/spool/mail
mailQuota: 0
mailForward: Kolotov.Alexan***@m*****.com
dn: uid=nina,ou=users,dc=karavay-shops,dc=ru
objectClass: posixAccount
objectClass: mailAccount
cn: standart mail account
uid: nina
userPassword: {MD5}8s7qFTasG4/tGhZ6nIvwTQ==
mail: Sykchina.Ni***@m*****.com
mailAccess: enable
mailAlias: nina@m*****.com
mailAlias: sykchina.ni***@m*****.com
uidNumber: 501
gidNumber: 501
gecos: Sykchina Nina Sergeevna
homeDirectory: /home/nina
loginShell: /bin/bash
mailBox: myvirual.mydomain.com/nina/
mailDirectory: /var/spool/mail
mailQuota: 20480000
mailForward: Sykchina.Ni***@m*****.com
dn: ou=myvirual.mydomain.com,ou=users,dc=karavay-shops,dc=ru
objectclass: organizationalUnit
ou: myvirual.mydomain.com
description: virtual domain
dn: uid=abuse,ou=myvirual.mydomain.com,ou=users,dc=karavay-shops,dc=ru
objectClass: posixAccount
objectClass: mailAccount
cn: virtual mail account
uid: abuse
mail: abu***@m*****.com
mailAccess: enable
uidNumber: 5002
gidNumber: 5002
homeDirectory: /var/spool/mail/myvirual.mydomain.com
mailBox: myvirual.mydomain.com/abuse
mailDirectory: /var/spool/mail
mailQuota: 0
dn: uid=postmaster,ou=myvirual.mydomain.com,ou=users,dc=karavay-shops,dc=ru
objectClass: posixAccount
objectClass: mailAccount
cn: virtual mail account
uid: postmaster
mail: postmast***@m*****.com
mailAccess: enable
uidNumber: 5001
gidNumber: 5001
homeDirectory: /var/spool/mail/myvirual.mydomain.com
mailBox: myvirual.mydomain.com/postmaster
mailDirectory: /var/spool/mail
mailQuota: 0
dn: mailAlias=mailer-daem***@m*****.com,ou=myvirual.mydomain.com,ou=users,dc=karavay-shops,dc=ru
objectClass: mailRecipient
mailAlias: mailer-daem***@m*****.com
mailAccess: enable
mailForward: postmast***@m*****.com
dn: mailAlias=ro***@m*****.com,ou=myvirual.mydomain.com,ou=users,dc=karavay-shops,dc=ru
objectClass: mailRecipient
mailAlias: root@m*****.com
mailAccess: enable
mailForward: abu***@m*****.com
dn: uid=tany,ou=myvirual.mydomain.com,ou=users,dc=karavay-shops,dc=ru
objectClass: posixAccount
objectClass: mailAccount
cn: virtual mail account
uid: tany
userPassword: {MD5}vsxSxnBrT8ypIx/ByEHg2w==
mail: Novikova.Tatya***@m*****.com
mailAccess: enable
mailAlias: tany@m*****.com
mailAlias: novikova.tatya***@m*****.com
uidNumber: 5003
gidNumber: 5003
gecos: Novikova Tat'yana Alexandrovna
homeDirectory: /var/spool/mail/myvirual.mydomain.com
mailBox: myvirual.mydomain.com/tany/
mailDirectory: /var/spool/mail
mailQuota: 20480000
mailForward: Novikova.Tatya***@m*****.com
end users.ldif $ ldapadd -x -D cn=admin,dc=karavay-shops,dc=ru -W -f users.ldif
И последнее - почтовый транспорт:
begin transport.ldif dn: ou=mail,dc=karavay-shops,dc=ru
objectclass: organizationalUnit
ou: mail
description: mail service tree
dn: ou=transports,ou=mail,dc=karavay-shops,dc=ru
objectclass: organizationalUnit
ou: transports
description: MTA routing table
dn: mailDomain=karavay-shops.ru,ou=transports,ou=mail,dc=karavay-shops,dc=ru
objectclass: mailDomainTransport
mailDomain: karavay-shops.ru
mailTransport: local
description: domain name
dn: mailDomain=bridge.karavay-shops.ru,ou=transports,ou=mail,dc=karavay-shops,dc=ru
objectclass: mailDomainTransport
mailDomain: bridge.karavay-shops.ru
mailTransport: local
description: host name
dn: mailDomain=localhost.karavay-shops.ru,ou=transports,ou=mail,dc=karavay-shops,dc=ru
objectclass: mailDomainTransport
mailDomain: localhost.karavay-shops.ru
mailTransport: local
description: host name
dn: mailDomain=myvirtual.mydomain.com,ou=transports,ou=mail,dc=karavay-shops,dc=ru
objectclass: mailDomainTransport
mailDomain: myvirtual.mydomain.com
mailTransport: virtual
description: virtual domain name
end transport.ldif $ ldapadd -x -D cn=admin,dc=karavay-shops,dc=ru -W -f transport.ldif
В итоге получилась следующая структура:
karavay-shops.ru
|
|-- admin
|-- users
| |
| |-- koal
| |-- nina
| |-- myvirual.mydomain.com
| | |
| | |-- abuse
| | |-- postmaster
| | |-- root -> abuse
| | |-- mailer-daemon -> postmaster
| | |-- tany
| |
|-- services
| |
| |-- postfix
| |-- courier
|
|-- DNS
| |
| |-- localhost
| | |
| | |-@
| |
| |-- 0.0.127.in-addr.arpa
| |
| |-- @
| |-- 1
|
|-- mail
|
|-- transports
|
|-- karavay-shops.ru
|-- bridge.karavay-shops.ru
|-- localhos.tkaravay-shops.ru
|-- myvirtual.mydomain.com
C уважением, Kolotov Alexandr aka mr. Эбола
отвечать: akmypo***@m*****.ru
ICQ: 100349254
| Registered Linux user # 236664 |
-*Информационный канал Subscribe.Ru
Написать в лист: mailto:comp.soft.linux.kirovlug-list@subscribe.ru
Отписаться: mailto:comp.soft.linux.kirovlug--unsub@subscribe.ru
http://subscribe.ru/ mailto:ask@subscribe.ru