This shows you the differences between two versions of the page.
scgc:laboratoare:02 [2018/03/06 21:18] victor.ciurel [2. [45p] Linux integration] |
scgc:laboratoare:02 [2021/10/27 14:08] (current) maria.mihailescu |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Laboratory 02. Directory Services: LDAP ====== | + | ====== Directory Services: LDAP ====== |
===== Lab Setup ===== | ===== Lab Setup ===== | ||
- | * We will be using a virtual machine in the [[http://cloud.curs.pub.ro/|faculty's cloud]]. | + | * We will be using a virtual machine in the [[http://cloud.grid.pub.ro/|faculty's cloud]]. |
- | * When creating a virtual machine follow the steps in this [[https://cloud.curs.pub.ro/about/tutorial-for-students/|tutorial]]. | + | |
* Create a VM | * Create a VM | ||
* When creating a virtual machine in the Launch Instance window: | * When creating a virtual machine in the Launch Instance window: | ||
* Select **Boot from image** in **Instance Boot Source** section | * Select **Boot from image** in **Instance Boot Source** section | ||
* Select **Centos 7** in **Image Name** section | * Select **Centos 7** in **Image Name** section | ||
+ | * Select the **m1.small** flavor. | ||
* The username for connecting to the VM is ''student'' | * The username for connecting to the VM is ''student'' | ||
===== Tasks ====== | ===== Tasks ====== | ||
==== 1. [30p] 389-ds ==== | ==== 1. [30p] 389-ds ==== | ||
- | In order to setup and manage LDAP on our server, we will be using 389-ds. This tools offers a more user-friendly way of managing LDAP, rather than using cumbersome CLI commands. | + | We will be working entirely on the VM. In order to setup and manage LDAP on our server, we will be using 389-ds. This tools offers a more user-friendly way of managing LDAP, rather than using cumbersome CLI commands. |
=== 1.1 [5p] Initial preparation === | === 1.1 [5p] Initial preparation === | ||
Line 25: | Line 25: | ||
fs.file-max = 64000 | fs.file-max = 64000 | ||
</file> | </file> | ||
- | These are needed to allow more connections to the LDAP server. | + | These are needed to allow more connections to the LDAP server. To reload these settings run the following command: |
+ | <code> | ||
+ | sysctl -p | ||
+ | </code> | ||
Also add the following lines in the ''/etc/security/limits.conf'' file: | Also add the following lines in the ''/etc/security/limits.conf'' file: | ||
Line 359: | Line 362: | ||
The ''-x'' parameter uses simple authentication. In this case the connection is anonymous. The ''-b'' parameter specifies the node in the LDAP tree/directory to traverse. | The ''-x'' parameter uses simple authentication. In this case the connection is anonymous. The ''-b'' parameter specifies the node in the LDAP tree/directory to traverse. | ||
+ | <note important> | ||
The GUI alternative will need to connect with X fowarding through SSH and also install xauth (**yum install xauth**). To forward X through ssh just add the -X parameter to the ssh command. | The GUI alternative will need to connect with X fowarding through SSH and also install xauth (**yum install xauth**). To forward X through ssh just add the -X parameter to the ssh command. | ||
+ | </note> | ||
<note> | <note> | ||
Line 377: | Line 382: | ||
=== 1.4 [5p] Simple LDAP entry === | === 1.4 [5p] Simple LDAP entry === | ||
- | Using the GUI from the previous subtask, add a User to LDAP to the People Organizational Unit. Use your name for the User data. Hint: ''User and Groups'', ''Create'' | + | Using the GUI from the previous subtask, add a User to LDAP to the ''People'' Organizational Unit. Use your name for the User data. Hint: ''User and Groups'', ''Create'' |
Use ''ldapsearch'' to verify that the User is added. | Use ''ldapsearch'' to verify that the User is added. | ||
Line 411: | Line 416: | ||
session required pam_mkhomdir.so skel=/etc/skel umask=0027 | session required pam_mkhomdir.so skel=/etc/skel umask=0027 | ||
</file> | </file> | ||
+ | We will need to enable this functionality by running the command: | ||
+ | <code> | ||
+ | [root@server ~]# authconfig --enablemkhomedir --update | ||
+ | </code> | ||
Now when logging in for the first time, the home directories should be created. | Now when logging in for the first time, the home directories should be created. | ||
=== 2.4 [10p] Linux groups === | === 2.4 [10p] Linux groups === | ||
Line 423: | Line 432: | ||
We will follow the schema used to add hostnames from CLI through LDAP. This is presented in detail [[https://wiki.archlinux.org/index.php/LDAP_Hosts|here]]. | We will follow the schema used to add hostnames from CLI through LDAP. This is presented in detail [[https://wiki.archlinux.org/index.php/LDAP_Hosts|here]]. | ||
- | Firstly, we will create a new Organizational Unit for the hosts from the GUI. Select the Base DN as the Organizational Unit. | + | Firstly, we will create a new Organizational Unit for the hosts from the GUI. Select the Base DN as the Organizational Unit. The name of our new OU will be ''Hosts''. |
After creating our OU for our hosts, we will need more advanced functionality, so we will use the ''Directory Server'' from the ''Servers and Applications'' tabs. | After creating our OU for our hosts, we will need more advanced functionality, so we will use the ''Directory Server'' from the ''Servers and Applications'' tabs. | ||
{{ :scgc:laboratoare:screenshot_from_2018-03-06_17-48-57.png?300 |}} | {{ :scgc:laboratoare:screenshot_from_2018-03-06_17-48-57.png?300 |}} | ||
- | In the ''Directory Server'', in the ''Directory'' tab, we will select the ''Hosts'' from ''scgc''. Right clicking will bring up a menu from which we will select ''New...'' and ''Other''. From the list we will select iphost. We will add a new host for the server IP. | + | In the ''Directory Server'', in the ''Directory'' tab, we will select the ''Hosts'' from ''scgc''. Right clicking will bring up a menu from which we will select ''New...'' and ''Other''. From the list we will select ''iphost''. We will add a new host for the server IP. |
{{ :scgc:laboratoare:screenshot_from_2018-03-06_17-54-01.png?300 |}} | {{ :scgc:laboratoare:screenshot_from_2018-03-06_17-54-01.png?300 |}} | ||