Bo's Oracle Station

查看: 3128|回复: 0

课程第8次

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2019-7-21 20:45:20 | 显示全部楼层 |阅读模式
2019-07-21
为什么LDAP基础节点叫"dc=example, dc=com"


  1. [root@instructor openldap]# grep -r  'dc=example'   ./
  2. ./slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/slapd.d/cn=config/olcDatabase={1}bdb.ldif:olcSuffix: dc=example,dc=com
  3. ./slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/cn=config/olcDatabase={1}bdb.ldif:olcSuffix: dc=example,dc=com
  4. ./slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/slapd.d/cn=config/olcDatabase={1}bdb.ldif:olcSuffix: dc=example,dc=com
  5. ./slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/cn=config/olcDatabase={1}bdb.ldif:olcSuffix: dc=example,dc=com
  6. ./slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/slapd.d/cn=config/olcDatabase={1}bdb.ldif:olcSuffix: dc=example,dc=com
  7. ./slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/cn=config/olcDatabase={1}bdb.ldif:olcSuffix: dc=example,dc=com
  8. ./slapd.d-glsorig/slapd.d-glsorig/slapd.d-glsorig/cn=config/olcDatabase={1}bdb.ldif:olcSuffix: dc=example,dc=com
  9. ./slapd.d-glsorig/slapd.d-glsorig/cn=config/olcDatabase={1}bdb.ldif:olcSuffix: dc=example,dc=com
  10. ./slapd.d-glsorig/cn=config/olcDatabase={1}bdb.ldif:olcSuffix: dc=example,dc=com
  11. ./slapd.d/cn=config/olcDatabase={1}bdb.ldif:olcSuffix: dc=example,dc=com
  12. ./ldap.conf:#BASE       dc=example,dc=com
  13. [root@instructor openldap]# pwd
  14. /etc/openldap
复制代码
为什么kerberos的验证域叫“EXAMPLE.COM”:
  1. [root@instructor etc]# vim krb5.conf
  2. [logging]
  3. default = FILE:/var/log/krb5libs.log
  4. kdc = FILE:/var/log/krb5kdc.log
  5. admin_server = FILE:/var/log/kadmind.log

  6. [libdefaults]
  7. default_realm = EXAMPLE.COM
  8. dns_lookup_realm = false
  9. dns_lookup_kdc = false
  10. ticket_lifetime = 24h
  11. renew_lifetime = 7d
  12. forwardable = true

  13. [realms]
  14. EXAMPLE.COM = {
  15.   kdc = kerberos.example.com
  16.   admin_server = kerberos.example.com
  17. }

  18. [domain_realm]
  19. .example.com = EXAMPLE.COM
  20. example.com = EXAMPLE.COM
  21. ~
复制代码
密码为什么是“kerberos”?  
/root/bin/gls-setup-krb5
  1. #!/bin/bash
  2. #
  3. # krb5script
  4. # Bowe Strickland <bowe@redhat.com>
  5. # version 1.0: 2010-09-23.  Initial release.
  6. #
  7. # Sets up instructor.example.com to act as a kerberos server.  Fortunately,
  8. # we're serving the EXAMPLE.COM domain, so many (all?) config files can be left
  9. # at their default settings.

  10. #set -x

  11. # no spaces/metachars please...
  12. MASTERPW=not_a_good_idea
  13. USERPW=kerberos

  14. if [ "$1" = "--reverse" ]; then

  15.         /sbin/service krb5kdc stop
  16.         /sbin/chkconfig krb5kdc off
  17.         /usr/sbin/kdb5_util destroy -f

  18.         rm -f /var/kerberos/krb5kdc/.k5.EXAMPLE.COM

  19. else
  20.         /usr/sbin/kdb5_util create -P "$MASTERPW" -s

  21.         for i in $(seq 20); do
  22.                 UNAME=$(printf ldapuser%d $i)
  23.                 echo "add_principal -pw $USERPW $UNAME" | kadmin.local
  24.         done

  25.         # don't immediately start service.
  26.         # /sbin/service krb5kdc start
  27.         /sbin/chkconfig krb5kdc on

  28. fi
复制代码
为什么家目录是"/home/guests/ldapuserX" ?
[root@desktop3 ~]# getent passwd ldapuser8
ldapuser8:*:1708:1708DAP Test User 8:/home/guests/ldapuser8:/bin/bash
/root/ldif/people.ldif:

  1. dn: uid=ldapuser1,ou=People,dc=example,dc=com
  2. uid: ldapuser1
  3. cn: LDAP Test User 1
  4. givenName: LDAP Test User
  5. sn: 1
  6. mail: ldapuser1@example.com
  7. objectClass: person
  8. objectClass: organizationalPerson
  9. objectClass: inetOrgPerson
  10. objectClass: posixAccount
  11. objectClass: top
  12. objectClass: shadowAccount
  13. userPassword: {SSHA}2RxVB3Cb+JZxqLDD4EucbGKEew9bhXNB
  14. shadowLastChange: 12797
  15. shadowMax: 99999
  16. shadowWarning: 7
  17. loginShell: /bin/bash
  18. uidNumber: 1701
  19. gidNumber: 1701
  20. homeDirectory: /home/guests/ldapuser1
  21. gecos: LDAP Test User 1
复制代码

------------------------------------------------------------------------------------------------------------
让server3 来做NFS服务器,故意做不对称的:

/rhosts/ldapuser*

mkdir /rhosts
for i in {1..20}
do
  mkdir /rhosts/ldapuser$i
  cp -a /etc/skel/.[!.]*  /rhosts/ldapuser$i
  chown -R $[ 1700 + $i ][ 1700 + $i ]  /rhosts/ldapuser$i
done


如果desktop3.example.com运行showmount  -e  server3.example.com报错的话,是因为server3.example.com上面firewall-config没有打开mountd/nfs/nfs3/rpcbind










回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-12-5 03:01 , Processed in 0.034150 second(s), 24 queries .

快速回复 返回顶部 返回列表