Ldap: Difference between revisions

From Halfface
Jump to navigation Jump to search
No edit summary
No edit summary
Line 5: Line 5:
  /usr/share/openldap/migration/migrate_passwd.pl /temp/user /temp/user.ldif
  /usr/share/openldap/migration/migrate_passwd.pl /temp/user /temp/user.ldif


Add user.
Import users.
ldapadd -x -D "cn=Manager,dc=halfface,dc=se" -w secret -f /temp/user.ldif -c
 
Example ldif to add user.
  dn: uid=bjorklun,ou=people,dc=halfface,dc=se
  dn: uid=bjorklun,ou=people,dc=halfface,dc=se
  uid: bjorklun
  uid: bjorklun
Line 22: Line 25:
  homeDirectory: /home/bjorklun
  homeDirectory: /home/bjorklun
  gecos: Andreas Bjorklund
  gecos: Andreas Bjorklund
/etc/auto.master
/home  ldap:ldap.halfface.se:ou=auto.home,dc=halfface,dc=se
Adding auto.home
dn: ou=auto.home,dc=halfface,dc=se
ou: auto.home
objectClass: top
objectClass: organizationalUnit
dn: cn=bjorklun,ou=auto.home,dc=halfface,dc=se
cn: bjorklun
objectClass: automount
automountInformation: -rw,hard,-rsize=8192,wsize=8192,intr nfs.halfface.se:/disk/0/home/bjorklun


Adding passwd and group.
Adding passwd and group.
Line 66: Line 55:
  objectClass: organizationalUnit
  objectClass: organizationalUnit
  ou: rootobject
  ou: rootobject
  dn: ou=People, dc=halfface,dc=se
  dn: ou=People, dc=halfface,dc=se
  ou: People
  ou: People
  description: All people in organisation
  description: All people in organisation

Revision as of 21:56, 4 July 2007

Change varables to suite your domain.

/usr/share/openldap/migration/migrate_common.ph

Convert local users to ldap users.

/usr/share/openldap/migration/migrate_passwd.pl /temp/user /temp/user.ldif

Import users.

ldapadd -x -D "cn=Manager,dc=halfface,dc=se" -w secret -f /temp/user.ldif -c

Example ldif to add user.

dn: uid=bjorklun,ou=people,dc=halfface,dc=se
uid: bjorklun
cn: Andreas Bjorklund
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {crypt}$1$encryptedpasswordheretowork
shadowLastChange: 13080
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 501
gidNumber: 501
homeDirectory: /home/bjorklun
gecos: Andreas Bjorklund

Adding passwd and group.

dn: ou=people,dc=halfface,dc=se
objectclass: organizationalUnit
ou: people

dn: ou=group,dc=halfface,dc=se
objectclass: organizationalUnit
ou: group

Organization Units.

dn: ou=Friends,dc=halfface,dc=se
ou: Friends
objectClass: top
objectClass: organizationalUnit
description: Members of Friends

dn: ou=Work,dc=halfface,dc=se
ou: Work
objectClass: top
objectClass: organizationalUnit
description: Members of Work

ldap attribute.

dn: dc=halfface,dc=se
dc: halfface
description: Root LDAP entry for halfface.se
objectClass: dcObject
objectClass: organizationalUnit
ou: rootobject
dn: ou=People, dc=halfface,dc=se
ou: People
description: All people in organisation
objectClass: organizationalUnit
dn: dc=halfface,dc=se
objectclass: dcObject
objectclass: organization
o: halfface
dc: halfface

dn: cn=Manager,dc=halfface,dc=se
objectclass: organizationalRole
cn: Manager
ldapadd -x -D "cn=Manager,dc=halfface,dc=se" -w secret -f /tmp/newentry -v
ldapsearch -x -b 'dc=halfface,dc=se' '(objectclass=*)'