Changes between Version 17 and Version 18 of ldap
- Timestamp:
- Nov 21, 2016, 5:25:41 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ldap
v17 v18 5 5 == Setting the Hostname and FQDN == 6 6 7 [wiki:ipallocation IP allocation table] 7 Remember this VM is a clone of your pc.userX.ws.ac.lk. Therefore you have to change some settings in order to make this vm unique. 8 9 === Setting up hostname === 10 11 - Login to the vm. change to root user 12 {{{ 13 $sudo su 14 }}} 15 - Give your password 16 - Edit /etc/hostname 17 {{{ 18 #nano /etc/hostname 19 }}} 20 * Change '''pc''' to '''idp''' 21 * Save and Exit 22 - also edit /etc/hosts file to change 127.0.0.1 pc."your domain".ws.ac.lk pc to 127.0.0.1 idp."your domain".ws.ac.lk idp 23 24 === IP Set up === 25 26 Edit /etc/network/interfaces files to include your IP addresses in your pc 27 28 - Login to the vm. change to root user 29 {{{ 30 $sudo su 31 }}} 32 - Give your password 33 - Edit /etc/network/interfaces 34 {{{ 35 #vi /etc/network/interfaces 36 }}} 37 - Find the following line 38 {{{ 39 iface eth0 inet dhcp 40 }}} 41 '''Note''': "eth0" is the name of your virtual interface. It could also be something like "enp0s3". If so you will use that instead of eth0 42 - Change it to 43 {{{ 44 #iface eth0 inet dhcp 45 }}} 46 - Add the following lines (Get your ldap IP Address from [wiki:ipallocation iptable]) 47 {{{ 48 iface eth0 inet static 49 address "Your ldap IP address" 50 netmask 255.255.255.0 51 network 192.248.6.0 52 broadcast 192.248.6.255 53 gateway 192.248.6.254 54 dns-nameservers 192.248.1.161 55 dns-search yourdmain 56 }}} 57 58 When you completed the IP settings of of VM, restart the vm and then login to confirm correct IP settings. 8 59 9 60 Before you get started, make sure you set up your server so that it correctly resolves its hostname to fully qualified domain name (FQDN). This will be necessary in order for your certificates to be validated by clients. … … 35 86 36 87 - Omit OpenLDAP server configuration? '''No''' (we want an initial database and configuration) 37 - DNS domain name: ''' yoursub-dmain.ac.lk''' (use the server's domain name, minus the hostname. This will be used to create the base entry for the information tree)88 - DNS domain name: '''"your domain".ws.ac.lk''' (use the server's domain name, minus the hostname. This will be used to create the base entry for the information tree) 38 89 - Organization name: '''Example Inc''' (This will simply be added to the base entry as the name of your institute) 39 90 - Administrator password: '''[whatever you'd like]''' … … 102 153 {{{ 103 154 organization = "Name of your institution" 104 cn = ldap.your-subdomain.ac.lk155 cn = idp.'your domain'.ws.ac.lk 105 156 tls_www_server 106 157 encryption_key … … 278 329 }}} 279 330 280 Now, if you search the '''dc= inst,dc=ac,dc=lk''' DIT, you will be refused if you do not use the -Z option to initiate a STARTTLS upgrade:331 Now, if you search the '''dc='your domain'dc=ws,dc=ac,dc=lk''' DIT, you will be refused if you do not use the -Z option to initiate a STARTTLS upgrade: 281 332 282 333 {{{ … … 295 346 TLS required success 296 347 {{{ 297 dn: dc= inst,dc=ac,dc=lk298 dn: cn=admin,dc= inst,dc=ac,dc=lk348 dn: dc='your domain'dc=ws,dc=ac,dc=lk 349 dn: cn=admin,dc='your domain'dc=ws,dc=ac,dc=lk 299 350 }}} 300 351 … … 307 358 Open a new file named as initial.ldif using nano or vi editor. Then copy following ldif content and do necessary adjustments to match with you institute. 308 359 {{{ 309 # group, inst.ac.lk310 dn: ou=group,dc= inst,dc=ac,dc=lk360 # group, 'your domain'.ws.ac.lk 361 dn: ou=group,dc='your domain'dc=ws,dc=ac,dc=lk 311 362 description: learn groups 312 363 objectClass: top 313 364 objectClass: organizationalUnit 314 365 ou: group 315 # adm staf, group, inst.ac.lk316 dn: cn=adm,ou=group,dc= inst,dc=ac,dc=lk366 # adm staf, group, 'your domain'.ws.ac.lk 367 dn: cn=adm,ou=group,dc='your domain'dc=ws,dc=ac,dc=lk 317 368 cn: adm 318 369 description: System Admin Staff … … 321 372 objectClass: top 322 373 323 # acadamic staf, group, inst.ac.lk324 dn: cn=acd,ou=group,dc= inst,dc=ac,dc=lk374 # acadamic staf, group, 'your domain'.ws.ac.lk 375 dn: cn=acd,ou=group,dc='your domain'dc=ws,dc=ac,dc=lk 325 376 cn: acd 326 377 description: Acadamic Staff … … 329 380 objectClass: top 330 381 331 # students, group, inst.ac.lk332 dn: cn=std,ou=group,dc= inst,dc=ac,dc=lk382 # students, group, 'your domain'.ws.ac.lk 383 dn: cn=std,ou=group,dc='your domain'dc=ws,dc=ac,dc=lk 333 384 cn: bod 334 385 description: Students … … 337 388 objectClass: top 338 389 339 # servers, inst.ac.lk340 dn: ou=servers,dc= inst,dc=ac,dc=lk390 # servers, 'your domain'.ws.ac.lk 391 dn: ou=servers,dc='your domain'dc=ws,dc=ac,dc=lk 341 392 description: inst servers that are LDAP clients 342 393 objectClass: top … … 344 395 ou: servers 345 396 346 # idp, servers, inst.ac.lk347 dn: cn=idp,ou=servers,dc= inst,dc=ac,dc=lk397 # idp, servers, 'your domain'.ws.ac.lk 398 dn: cn=idp,ou=servers,dc='your domain'dc=ws,dc=ac,dc=lk 348 399 cn: idp 349 400 description: Identity Server … … 355 406 userPassword: {crypt}idpldap 356 407 357 # irs, servers, inst.ac.lk358 dn: cn=irs,ou=servers,dc= inst,dc=ac,dc=lk408 # irs, servers, 'your domain'.ws.ac.lk 409 dn: cn=irs,ou=servers,dc='your domain'dc=ws,dc=ac,dc=lk 359 410 cn: irs 360 411 description: IRS Server … … 366 417 userPassword: {crypt}irsldap 367 418 368 # people, inst.ac.lk369 dn: ou=people,dc= inst,dc=ac,dc=lk419 # people, 'your domain'.ws.ac.lk 420 dn: ou=people,dc='your domain'dc=ws,dc=ac,dc=lk 370 421 description: inst users 371 422 objectClass: top … … 373 424 ou: people 374 425 375 # testme, people, inst.ac.lk376 dn: uid=testme,ou=people,dc= inst,dc=ac,dc=lk426 # testme, people, 'your domain'.ws.ac.lk 427 dn: uid=testme,ou=people,dc='your domain'dc=ws,dc=ac,dc=lk 377 428 cn: Test Me 378 429 departmentNumber: LEARN … … 416 467 417 468 {{{ 418 ldapadd -H ldap:// -x -D "cn=admin,dc= inst,dc=ac,dc=lk" -W -Z -f initial.ldif469 ldapadd -H ldap:// -x -D "cn=admin,dc='your domain'dc=ws,dc=ac,dc=lk" -W -Z -f initial.ldif 419 470 }}} 420 471 … … 422 473 423 474 {{{ 424 ldapsearch -H ldap:// -x -D "cn=admin,dc= inst,dc=ac,dc=lk" -W -Z -b "dc=inst,dc=ac,dc=lk"475 ldapsearch -H ldap:// -x -D "cn=admin,dc='your domain'dc=ws,dc=ac,dc=lk" -W -Z -b "dc='your domain'dc=ws,dc=ac,dc=lk" 425 476 }}} 426 477 Note that Clear-Text userPassword enconded in '''base64''' … … 429 480 430 481 {{{ 431 ldapdelete -H ldap:// "uid=user,ou=people,dc= inst,dc=ac,dc=lk" -D "cn=admin,dc=inst,dc=ac,dc=lk" -Z -W482 ldapdelete -H ldap:// "uid=user,ou=people,dc='your domain'dc=ws,dc=ac,dc=lk" -D "cn=admin,dc='your domain'dc=ws,dc=ac,dc=lk" -Z -W 432 483 }}} 433 484 … … 443 494 changetype: modify 444 495 replace: olcAccess 445 olcAccess: {0}to attrs=userPassword by self write by anonymous auth by dn.children="ou=servers,dc= inst,dc=ac,dc=lk" read by * none496 olcAccess: {0}to attrs=userPassword by self write by anonymous auth by dn.children="ou=servers,dc='your domain'dc=ws,dc=ac,dc=lk" read by * none 446 497 olcAccess: {1}to attrs=shadowLastChange by self write by * read 447 498 olcAccess: {2}to * by * read … … 470 521 {{{ 471 522 $servers->setValue('server','host','localhost'); 472 $servers->setValue('server','base',array('dc= inst,dc=ac,dc=lk'));473 $servers->setValue('login','bind_id','cn=admin,dc= inst,dc=ac,dc=lk');523 $servers->setValue('server','base',array('dc='your domain'dc=ws,dc=ac,dc=lk')); 524 $servers->setValue('login','bind_id','cn=admin,dc='your domain'dc=ws,dc=ac,dc=lk'); 474 525 $config->custom->appearance['hide_template_warning'] = true; 475 526 $servers->setValue('server','tls',true); … … 520 571 {{{ 521 572 <VirtualHost *:80/> 522 ServerAdmin webmaster@ inst.ac.lk573 ServerAdmin webmaster@'your domain'.ws.ac.lk 523 574 DocumentRoot /var/www/html 524 ServerName idp. inst.ac.lk525 Redirect permanent /phpldapadmin https:// idp.inst.ac.lk/phpldapadmin575 ServerName idp.'your domain'.ws.ac.lk 576 Redirect permanent /phpldapadmin https://'your domain'.ws.ac.lk/phpldapadmin 526 577 ErrorLog ${APACHE_LOG_DIR}/error.log 527 578 CustomLog ${APACHE_LOG_DIR}/access.log combined … … 550 601 551 602 {{{ 552 ServerAdmin webmaster@ inst.ac.lk553 ServerName idp. inst.ac.lk603 ServerAdmin webmaster@'your domain'.ws.ac.lk 604 ServerName idp.'your domain'.ws.ac.lk 554 605 }}} 555 606 Next, we need to set the SSL certificate directives to point to the key and certificate that we created. The directives should already exist in your file, so just modify the files they point to: … … 580 631 We can now move on to the actual interface. 581 632 582 ''https://idp. inst.ac.lk/phpldapadmin/''633 ''https://idp.'your domain'.'ws.ac.lk/phpldapadmin/'' 583 634 584 635 Enter your apache password first and then ldap admin password