diff options
author | jr2158@student.uni-lj.si <jr2158@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2017-02-17 11:09:37 +0000 |
---|---|---|
committer | jr2158@student.uni-lj.si <jr2158@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414> | 2017-02-17 11:09:37 +0000 |
commit | dcddaaf82f418bc024c444682e892a039f2e6ab5 (patch) | |
tree | 5afda9d2175702f80ee476e85cd92b65be1f600e /kpov_judge/tasks/ldap_search/howtos | |
parent | e11077772bf32f25613f4f559feee8c963ea5dda (diff) |
How to for ldap_search task.
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@378 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge/tasks/ldap_search/howtos')
18 files changed, 74 insertions, 23 deletions
diff --git a/kpov_judge/tasks/ldap_search/howtos/en/Pic1.jpg b/kpov_judge/tasks/ldap_search/howtos/en/Pic1.jpg Binary files differnew file mode 100644 index 0000000..fecb706 --- /dev/null +++ b/kpov_judge/tasks/ldap_search/howtos/en/Pic1.jpg diff --git a/kpov_judge/tasks/ldap_search/howtos/en/Pic2.1.jpg b/kpov_judge/tasks/ldap_search/howtos/en/Pic2.1.jpg Binary files differnew file mode 100644 index 0000000..085f1cc --- /dev/null +++ b/kpov_judge/tasks/ldap_search/howtos/en/Pic2.1.jpg diff --git a/kpov_judge/tasks/ldap_search/howtos/en/Pic2.2.jpg b/kpov_judge/tasks/ldap_search/howtos/en/Pic2.2.jpg Binary files differnew file mode 100644 index 0000000..cb9975c --- /dev/null +++ b/kpov_judge/tasks/ldap_search/howtos/en/Pic2.2.jpg diff --git a/kpov_judge/tasks/ldap_search/howtos/en/Pic2.3.jpg b/kpov_judge/tasks/ldap_search/howtos/en/Pic2.3.jpg Binary files differnew file mode 100644 index 0000000..1069e1a --- /dev/null +++ b/kpov_judge/tasks/ldap_search/howtos/en/Pic2.3.jpg diff --git a/kpov_judge/tasks/ldap_search/howtos/en/Pic3.1.jpg b/kpov_judge/tasks/ldap_search/howtos/en/Pic3.1.jpg Binary files differnew file mode 100644 index 0000000..0c00ddd --- /dev/null +++ b/kpov_judge/tasks/ldap_search/howtos/en/Pic3.1.jpg diff --git a/kpov_judge/tasks/ldap_search/howtos/en/Pic3.2.jpg b/kpov_judge/tasks/ldap_search/howtos/en/Pic3.2.jpg Binary files differnew file mode 100644 index 0000000..d488e43 --- /dev/null +++ b/kpov_judge/tasks/ldap_search/howtos/en/Pic3.2.jpg diff --git a/kpov_judge/tasks/ldap_search/howtos/en/Pic3.3.jpg b/kpov_judge/tasks/ldap_search/howtos/en/Pic3.3.jpg Binary files differnew file mode 100644 index 0000000..2ea916c --- /dev/null +++ b/kpov_judge/tasks/ldap_search/howtos/en/Pic3.3.jpg diff --git a/kpov_judge/tasks/ldap_search/howtos/en/Pic3.4.jpg b/kpov_judge/tasks/ldap_search/howtos/en/Pic3.4.jpg Binary files differnew file mode 100644 index 0000000..24db305 --- /dev/null +++ b/kpov_judge/tasks/ldap_search/howtos/en/Pic3.4.jpg diff --git a/kpov_judge/tasks/ldap_search/howtos/en/Pic3.5.jpg b/kpov_judge/tasks/ldap_search/howtos/en/Pic3.5.jpg Binary files differnew file mode 100644 index 0000000..d2ff304 --- /dev/null +++ b/kpov_judge/tasks/ldap_search/howtos/en/Pic3.5.jpg diff --git a/kpov_judge/tasks/ldap_search/howtos/en/Pic3.6.jpg b/kpov_judge/tasks/ldap_search/howtos/en/Pic3.6.jpg Binary files differnew file mode 100644 index 0000000..0ab07d0 --- /dev/null +++ b/kpov_judge/tasks/ldap_search/howtos/en/Pic3.6.jpg diff --git a/kpov_judge/tasks/ldap_search/howtos/en/Pic3.7.jpg b/kpov_judge/tasks/ldap_search/howtos/en/Pic3.7.jpg Binary files differnew file mode 100644 index 0000000..44ca494 --- /dev/null +++ b/kpov_judge/tasks/ldap_search/howtos/en/Pic3.7.jpg diff --git a/kpov_judge/tasks/ldap_search/howtos/en/Pic3.8.jpg b/kpov_judge/tasks/ldap_search/howtos/en/Pic3.8.jpg Binary files differnew file mode 100644 index 0000000..855353b --- /dev/null +++ b/kpov_judge/tasks/ldap_search/howtos/en/Pic3.8.jpg diff --git a/kpov_judge/tasks/ldap_search/howtos/en/Pic4.jpg b/kpov_judge/tasks/ldap_search/howtos/en/Pic4.jpg Binary files differnew file mode 100644 index 0000000..4aab71d --- /dev/null +++ b/kpov_judge/tasks/ldap_search/howtos/en/Pic4.jpg diff --git a/kpov_judge/tasks/ldap_search/howtos/en/Pic5.jpg b/kpov_judge/tasks/ldap_search/howtos/en/Pic5.jpg Binary files differnew file mode 100644 index 0000000..07a60de --- /dev/null +++ b/kpov_judge/tasks/ldap_search/howtos/en/Pic5.jpg diff --git a/kpov_judge/tasks/ldap_search/howtos/en/Pic6.jpg b/kpov_judge/tasks/ldap_search/howtos/en/Pic6.jpg Binary files differnew file mode 100644 index 0000000..48c6606 --- /dev/null +++ b/kpov_judge/tasks/ldap_search/howtos/en/Pic6.jpg diff --git a/kpov_judge/tasks/ldap_search/howtos/en/Pic7.jpg b/kpov_judge/tasks/ldap_search/howtos/en/Pic7.jpg Binary files differnew file mode 100644 index 0000000..58b8bdf --- /dev/null +++ b/kpov_judge/tasks/ldap_search/howtos/en/Pic7.jpg diff --git a/kpov_judge/tasks/ldap_search/howtos/en/Pic8.jpg b/kpov_judge/tasks/ldap_search/howtos/en/Pic8.jpg Binary files differnew file mode 100644 index 0000000..c9d053e --- /dev/null +++ b/kpov_judge/tasks/ldap_search/howtos/en/Pic8.jpg diff --git a/kpov_judge/tasks/ldap_search/howtos/en/index.html b/kpov_judge/tasks/ldap_search/howtos/en/index.html index 28b0ae0..0ee5f2a 100644 --- a/kpov_judge/tasks/ldap_search/howtos/en/index.html +++ b/kpov_judge/tasks/ldap_search/howtos/en/index.html @@ -1,23 +1,74 @@ -<html> -<head> -<meta http-equiv=Content-Type content="text/html; charset=utf-8"> -</head> -<body> -<h1>Task: ldap search</h1> -<p> -<h2>Summary</h2> -Create 2 virtual sistems called SimpleArbiterDhcp and LDAPServer. Using SimpleArbiterDhcp connect to the LDAP server on the other virtual sistem and create an user. -</p> -<p> -<h2>Instructions</h2> - 1. Download disk SimpleArbiterDhcp from the page where drives for our tasks are. - 2. Using the downloaded drive, create a new virtual machine called SimpleArbiterDhcp in Virtualbox(Image 1) - 3. Create a second virtual machine called LDAPServer. - 4. Log in using username root and password kaboom. - 5. Set up the LDAP server on the LDAPServer machine using apt-get install ldap-utils.(Image 2) - 6. After you have done that, restart the server. - 7. From SimpleArbiterDhcp connect to the LDAP server on the machine LDAPServer. - 8. Create an user or supervise the data you need on the server. -</p> -</body> -</html> +<!DOCTYPE html>
+<html>
+<head>
+ <title>ldap_search</title>
+ <meta charset="utf-8">
+</head>
+<body>
+</body>
+<h1>ldap_search</h1>
+<h2>Purpose of the exercise</h2>
+<p>How to setup a LDAP Server, to add entries to a LDAP Server, and to change users' rights to be able to add entries and change the attributes of entries.</p>
+
+<h2>How To</h2>
+
+<ol>
+ <li>Create two virtual machines, <b>SimpleArbiterDhcpGWLDAP</b>(simpleArbiterDhcpGWLDAP.vdi) and <b>LDAPServer</b>(student-LDAPServer.vdi).
+ <br><img src="Pic1.jpg" alt="No img" width=600 height=400></li>
+ <br>
+ <li>Change the network settings to both virtual machines. <b>SimpleArbiterDhcpGWLDAP</b>: Adapter 1 is set to "NAT" for internet access and
+ adapter 2 to "internal network" for local network. <b>LDAPServer</b>: Adapter 1 set to "internal network" sot that it is in the same internal network as SimpleArbiterDhcpGWLDAP.
+ <br><img src="Pic2.1.jpg" alt="No img" width=600 height=400>
+ <br><img src="Pic2.2.jpg" alt="No img" width=600 height=400>
+ <br><img src="Pic2.3.jpg" alt="No img" width=600 height=400></li>
+ <br>
+ <li>In <b>SimpleArbiterDhcpGWLDAP</b> log in as user "tester", in <b>LDAPServer</b> log in as user "root", run the command <b>"apt-get update"</b> to update the list of packages and
+ open up another terminal by pressing <b>"ALT+F2"</b> and log in as user "student".</li>
+ <br>
+ <li>In <b>LDAPServer</b> run the command <b>"apt-get install slapd ldap-utils"</b> to install these packages which are the LDAP server and tools to access and manage the LDAP server.
+ <br>During the LDAP server installation you'll have to provide the password for the user "admin", the administrator of the server and confirm the password chosen.</li>
+ <br>
+ <li>Configure the LDAP server by choosing the appropriate domain name and other configuration parameters. Execute the commmand <b>"dpkg-reconfigure slapd"</b>.
+ <br><img src="Pic3.1.jpg" alt="No img" width=600 height=400>
+ <br><img src="Pic3.2.jpg" alt="No img" width=600 height=400>
+ <br><img src="Pic3.3.jpg" alt="No img" width=600 height=400>
+ <br><img src="Pic3.4.jpg" alt="No img" width=600 height=400>
+ <br><img src="Pic3.5.jpg" alt="No img" width=600 height=400>
+ <br><img src="Pic3.6.jpg" alt="No img" width=600 height=400>
+ <br><img src="Pic3.7.jpg" alt="No img" width=600 height=400>
+ <br><img src="Pic3.8.jpg" alt="No img" width=600 height=400>
+ <br>a) If you will configure the <b>"slapd"</b> again don't forget to remove the old database <b>"rm -rf /var/backups/unknown-2.4.44+dfsg-2.ldapdb"</b>.</li>
+ <br>
+ <li>Now that the LDAP server is configured for use, try to open a third console and log in as user "student" and execute the command <b>"ldapsearch -D cn=admin,dc=ceres-20,dc=kpov,
+ dc=lusy,dc=fri,dc=uni-lj,dc=si -W -b dc=ceres-20,dc=kpov,dc=lusy,dc=fri,dc=uni-lj,dc=si"</b>, which will show the entries in the server.
+ <br>Because you will be using a lot the domain name to access the LDAP server you can set the environment variable "D", which will allow for quicker typing of commands.
+ <br><b>"export D=dc=ceres-20,dc=kpov,dc=lusy,dc=fri,dc=uni-lj,dc=si"</b>
+ <br><b>"ldapsearch -D cn=admin,$D -wvaje -b $D"</b></li>
+ <br>
+ <li>Create the file(LDIF format) "users.ldif" which will contain the objects(users) that we want to add to the LDAP server database.
+ <br><img src="Pic4.jpg" alt="No img" width=600 height=400>
+ <br>Execute the following command to add users to the LDAP server:
+ <br><b>"ldapadd -D cn=admin,$D -wvaje -f users.ldif"</b>
+ <br>Add password to the users added to the LDAP server:
+ <br><b>"ldappasswd -D cn=admin,$D -wvaje -sj2531e cn=ninavidmar,ou=users,$D"</b>
+ <br><b>"ldappasswd -D cn=admin,$D -wvaje -scTyRM0 cn=natalijaribnikar39,ou=users,$D"</b>
+ <br>Execute command <b>"ldapsearch -D cn=natalijaribnikar39,ou=users,$D -wcTyRM0 -b $D"</b> to bind to the LDAP server with the newly added user <b>"natalijaribnikar39"</b> and to see the entries currently in the LDAP server.
+ <br><img src="Pic5.jpg" alt="No img" width=600 height=400></li>
+ <br>
+ <li>In order to change the users' rights settings, which allows a user to add entries to the directory and change values of attributes of entries in the directory you need to create an additional file acl.ldif:
+ <br>To see which backend database is used and other settings related to the users' rights execute command <b>"ldapsearch -Y EXTERNAL -H ldapi:/// -b cn=config"</b> as root user in the system, which does not need the user authentication to the LDAP server.
+ <br><img src="Pic6.jpg" alt="No img" width=600 height=400>
+ <br>The settings in the acl.ldif file:
+ <br><img src="Pic7.jpg" alt="No img" width=600 height=400>
+ <br>Now to change users' rights run the command <b>"ldapmodify -Y EXTERNAL -H ldapi:/// -f acl.ldif"</b> as user "root" in the system.</li>
+ <br>
+ <li>The user <b>"natalijaribnikar39"</b> has the right to add or change objects in the LDAP server.
+ <br>Now try to bind to the LDAP server using <b>"natalijaribnikar39"</b> user's credentials and add a new user to the server directory.
+ <br><b>"ldapadd -D cn=natalijaribnikar39,ou=users,$D -wcTyRM0 -f newuser.ldif"</b></li>
+ <br>
+ <li>Now to test your result go to the <b>SimpleArbiterDhcpGWLDAP</b> virtual machine and run <b>"./test_task.py"</b> to run the test and see your score.
+ <br><img src="Pic8.jpg" alt="No img" width=600 height=400></li>
+
+</ol>
+
+</html>
|