インスコ(4) group user

[root@cent6-64-38 tmp]# ./create_user_ldif.sh 
ベースDN(例:dc=example,dc=com) : dc=hirasawa,dc=local
ユーザー名(例:testuser)        : testuser
ユーザーID(例:1001)            : 1001
グループID(例:1001)            : 1001
ユーザーパスワード(例:pass)    : pass
Home Directory(/home/testuser) : 

dn: uid=testuser,ou=People,dc=hirasawa,dc=local
uid: testuser
cn: testuser
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {SSHA}UbmTqhAtPFBkDj1ipaLr5qozX6kYXhSf
shadowLastChange: 15862
shadowMin: 0
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 1001
gidNumber: 1001
homeDirectory: 

[root@cent6-64-38 tmp]# 
[root@cent6-64-38 tmp]# ls -ltr
合計 16
-rw-r--r--. 1 root root 973  1月  7 14:01 2014 base.ldif
-rwxr-xr-x. 1 root root 329  1月  7 14:23 2014 create_group_idif.sh
-rw-r--r--. 1 root root 111  1月  7 14:30 2014 group0001.ldif
-rwxr-xr-x. 1 root root 800  1月  7 14:44 2014 create_user_ldif.sh
[root@cent6-64-38 tmp]# 
[root@cent6-64-38 tmp]# 
[root@cent6-64-38 tmp]# 
[root@cent6-64-38 tmp]# ./create_user_ldif.sh > user1001.ldif
ベースDN(例:dc=example,dc=com) : dc=hirasawa,dc=local
ユーザー名(例:testuser)        : testuser
ユーザーID(例:1001)            : 1001
グループID(例:1001)            : 1001
ユーザーパスワード(例:pass)    : test
Home Directory(/home/testuser) : /home/testuser 
[root@cent6-64-38 tmp]# 
[root@cent6-64-38 tmp]# ls -ltr
合計 20
-rw-r--r--. 1 root root 973  1月  7 14:01 2014 base.ldif
-rwxr-xr-x. 1 root root 329  1月  7 14:23 2014 create_group_idif.sh
-rw-r--r--. 1 root root 111  1月  7 14:30 2014 group0001.ldif
-rwxr-xr-x. 1 root root 800  1月  7 14:44 2014 create_user_ldif.sh
-rw-r--r--. 1 root root 376  1月  7 14:47 2014 user1001.ldif
[root@cent6-64-38 tmp]# 
[root@cent6-64-38 tmp]# 
[root@cent6-64-38 tmp]# 
[root@cent6-64-38 tmp]# 
[root@cent6-64-38 tmp]# ldapadd -x -D 'cn=Manager,dc=hirasawa,dc=local' -W -f ./user1001.ldif 
Enter LDAP Password: 
adding new entry "uid=testuser,ou=People,dc=hirasawa,dc=local"

[root@cent6-64-38 tmp]# 
[root@cent6-64-38 tmp]# ldapsearch -x -b 'dc=hirasawa,dc=local' 'uid=testuser'
# extended LDIF
#
# LDAPv3
# base <dc=hirasawa,dc=local> with scope subtree
# filter: uid=testuser
# requesting: ALL
#

# testuser, People, hirasawa.local
dn: uid=testuser,ou=People,dc=hirasawa,dc=local
uid: testuser
cn: testuser
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
shadowLastChange: 15862
shadowMin: 0
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 1001
gidNumber: 1001
homeDirectory: /home/testuser

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1
[root@cent6-64-38 tmp]# 
  • -x Use simple authentication instead of SASL.
  • -b searchbase