{"id":599,"date":"2016-06-02T11:28:13","date_gmt":"2016-06-02T09:28:13","guid":{"rendered":"http:\/\/drfugazi.eu.org\/?p=599"},"modified":"2016-10-14T14:17:03","modified_gmt":"2016-10-14T12:17:03","slug":"ldap-server-for-solaris-and-linux-clients","status":"publish","type":"post","link":"https:\/\/drfugazi.eu.org\/en\/ldap-server-for-solaris-and-linux-clients\/","title":{"rendered":"LDAP server for Solaris and Linux clients"},"content":{"rendered":"<p><a  href=\"https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/LDAP-DIT.jpg\" data-rel=\"lightbox-gallery-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"627\" data-permalink=\"https:\/\/drfugazi.eu.org\/en\/ldap-server-for-solaris-and-linux-clients\/ldap-dit\/\" data-orig-file=\"https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/LDAP-DIT.jpg?fit=1267%2C1073&amp;ssl=1\" data-orig-size=\"1267,1073\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"LDAP-DIT\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/LDAP-DIT.jpg?fit=300%2C254&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/LDAP-DIT.jpg?fit=1024%2C867&amp;ssl=1\" class=\"alignleft wp-image-627 size-thumbnail\" src=\"https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/LDAP-DIT-150x150.jpg?resize=150%2C150\" alt=\"LDAP-DIT\" width=\"150\" height=\"150\" srcset=\"https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/LDAP-DIT.jpg?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/LDAP-DIT.jpg?resize=160%2C160&amp;ssl=1 160w, https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/LDAP-DIT.jpg?resize=320%2C320&amp;ssl=1 320w, https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/LDAP-DIT.jpg?zoom=3&amp;resize=150%2C150&amp;ssl=1 450w\" sizes=\"(max-width: 150px) 100vw, 150px\" data-recalc-dims=\"1\" \/><\/a>Few months ago I received a task to set up LDAP authentication for Solaris 10, Solaris 11 and Linux machines in Customer&#8217;s infrastructure. As LDAP server was chosen OpenLDAP 2.4.x in Master-Slave configuration with SSL\/TLS support. Servers was installed on Virtual Machines with CentOS 6.7.<br \/>\nI will not describe LDAP installation, because on modern Linuxes it&#8217;s simple like:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">$ sudo yum install openldap-servers<\/pre>\n<p><!--more-->Directory Information Tree configuration is also set during installation. I will use dc=mycompany,dc=com in this document. I will also use &#8220;o=mycompany&#8221; and &#8220;o=customer&#8221; as branches in my DIT to separate users and groups.<br \/>\nThere are lot of manuals how to configure Master-Slave replication in OpenLDAP, so this is out of scope, you&#8217;ll need to find one and configure it by yourself. I used dynamic configuration which is not well documented, but there is possibility (and sometimes the only way) to prepare static slapd.conf and convert it to dynamic configuration with &#8216;slaptest&#8217;. My recommendation is to use this method.<br \/>\nApart from &#8216;syncrepl&#8217; overlay, I&#8217;m also using &#8216;memberof&#8217; and &#8216;refint&#8217; overlays (<a href=\"http:\/\/www.schenkels.nl\/2013\/03\/how-to-setup-openldap-with-memberof-overlay-ubuntu-12-04\/\">here is HOWTO<\/a>) and &#8216;unique&#8217;. Overlays description you can find here: <a href=\"http:\/\/www.openldap.org\/doc\/admin24\/overlays.html\" target=\"_blank\">http:\/\/www.openldap.org\/doc\/admin24\/overlays.html<\/a><br \/>\nThere is a list of enabled modules in my configuration:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ndn: cn=module{0},cn=config\r\nobjectClass: olcModuleList\r\ncn: module{0}\r\nolcModuleLoad: {0}memberof.la\r\nolcModuleLoad: {1}syncprov.la\r\nolcModuleLoad: {2}refint.la\r\nolcModuleLoad: {3}unique\r\nolcModulePath: \/usr\/lib64\/openldap\r\n<\/pre>\n<p>and overlays configuration:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ndn: olcOverlay={0}memberof,olcDatabase={2}bdb,cn=config\r\nobjectClass: olcMemberOf\r\nobjectClass: olcOverlayConfig\r\nolcOverlay: {0}memberof\r\nolcMemberOfDangling: ignore\r\nolcMemberOfRefInt: FALSE\r\n\r\ndn: olcOverlay={1}syncprov,olcDatabase={2}bdb,cn=config\r\nobjectClass: olcSyncProvConfig\r\nobjectClass: olcOverlayConfig\r\nolcOverlay: {1}syncprov\r\nolcSpCheckpoint: 100 10\r\nolcSpSessionlog: 200\r\n\r\ndn: olcOverlay={2}refint,olcDatabase={2}bdb,cn=config\r\nobjectClass: top\r\nobjectClass: olcConfig\r\nobjectClass: olcOverlayConfig\r\nobjectClass: olcRefintConfig\r\nolcOverlay: {2}refint\r\nolcRefintAttribute: member memberof\r\n\r\ndn: olcOverlay={3}unique,olcDatabase={2}bdb,cn=config\r\nobjectClass: olcUniqueConfig\r\nobjectClass: olcOverlayConfig\r\nolcOverlay: {3}unique\r\nolcUniqueURI: ldap:\/\/\/dc=mycompany,dc=com?gidNumber?sub?(objectClass=posixGroup)\r\nolcUniqueURI: ldap:\/\/\/dc=mycompany,dc=com?uid,uidNumber?sub?(objectClass=posixAccount)\r\n<\/pre>\n<p>When LDAP server(s) is configured and running, we can focus on Solaris Profiles. Why to use Profiles? Because it&#8217;s faster and simpler to make a change in single LDAP entry than reconfigure every client connected to LDAP. I didn&#8217;t hear about Linux LDAP Profiles, but with Solaris 10 and 11 it works fine.<br \/>\nTo configure profiles you need to extend LDAP schema with Attributes and ObjectClasses defined in DUAConfigProfile:<br \/>\n<a href=\"http:\/\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/DUAConfigProfile.txt\">DUAConfigProfile<\/a><br \/>\nJust download it, rename to &#8216;duaconfig.schema&#8217; and put into &#8216;schema&#8217; directory under your LDAP server configuration directory, download also:<br \/>\n<a href=\"http:\/\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/nisdomain.txt\">NIS Domain schema extension<\/a> and put as &#8216;nisdomain.schema&#8217; in this directory (default: \/etc\/openldap\/schema).<br \/>\nInclude these files in &#8216;slapd.conf&#8217; with &#8216;include&#8217; directive and convert to dynamic config with &#8216;slaptest&#8217; if you use dynamic configuration.<br \/>\nExemplary profile for Solaris clients looks as follows:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ndn: cn=dev,ou=profile,dc=mycompany,dc=com\r\nobjectClass: DUAConfigProfile\r\nobjectClass: top\r\ncn: dev\r\nattributeMap: shadow:userpassword=userPassword\r\nattributeMap: passwd:loginshell=loginShell\r\nattributeMap: passwd:homedirectory=homeDirectory\r\nattributeMap: passwd:uidnumber=uidNumber\r\nattributeMap: passwd:gidnumber=gidNumber\r\nattributeMap: group:gidnumber=gidNumber\r\nattributeMap: automount:automountKey=cn\r\nattributeMap: automount:automountInformation=nisMapEntry\r\nattributeMap: automount:automountMapName=nisMapName\r\nauthenticationMethod: tls:simple\r\ncredentialLevel: proxy\r\ndefaultSearchBase: dc=mycompany,dc=com\r\ndefaultServerList: ldapsrvp01 ldapsrvp02\r\nobjectclassMap: shadow:shadowAccount=posixaccount\r\nobjectclassMap: passwd:posixAccount=posixaccount\r\nobjectclassMap: group:posixGroup=posixgroup\r\nobjectclassMap: automount:automount=nisObject\r\nobjectclassMap: automount:automountMap=nisMap\r\nprofileTTL: 300\r\nserviceSearchDescriptor: passwd:ou=people,o=mycompany,dc=mycompany,dc=com?su\r\nb?(|(memberof=cn=uxadmin,ou=groups,o=mycompany,dc=mycompany,dc=com)(membero\r\nf=cn=dev,ou=groups,o=mycompany,dc=mycompany,dc=com));ou=people,o=cu\r\nstomer,dc=mycompany,dc=com?sub?memberof=cn=dev,ou=groups,o=customer\r\n,dc=mycompany,dc=com\r\nserviceSearchDescriptor: group:ou=groups,o=mycompany,dc=mycompany,dc=com;ou=\r\ngroups,o=customer,dc=mycompany,dc=com\r\nserviceSearchDescriptor: shadow:ou=people,o=mycompany,dc=mycompany,dc=com?su\r\nb?(|(memberof=cn=uxadmin,ou=groups,o=mycompany,dc=mycompany,dc=com)(membero\r\nf=cn=dev,ou=groups,o=mycompany,dc=mycompany,dc=com));ou=people,o=cu\r\nstomer,dc=mycompany,dc=com?sub?memberof=cn=dev,ou=groups,o=customer\r\n,dc=mycompany,dc=com\r\nserviceSearchDescriptor: auto_master:ou=service,dc=mycompany,dc=com?sub?nisM\r\napName=auto_master\r\nserviceSearchDescriptor: auto_home:ou=service,dc=mycompany,dc=com?sub?nisMap\r\nName=auto_home\r\n<\/pre>\n<p>I know that this profile may look complex, especially serviceSearchDescriptor filters, but I want to show you, how to search for users\/groups when they are defined in different LDAP branches.<br \/>\nThis Profile is called &#8216;cn=dev&#8217;, and using MemberOf overlay, to allows access to system for members of &#8216;uxadmin&#8217; and &#8216;dev&#8217; groups from &#8216;o=mycompany,dc=mycompany,dc=com&#8217; and members of &#8216;dev&#8217; group from &#8216;o=customer,dc=mycompany,dc=com&#8217;.<br \/>\nOf course you can define as many profiles as you need. Description of parameters you will find in documentation on Oracle website.<br \/>\nI did not hear about profiles for Linux systems, and I didn&#8217;t define any on LDAP servers.<br \/>\nHow to connect Linux and Solaris clients I will describe in separate post.<\/p>","protected":false},"excerpt":{"rendered":"<p>Sorry, this entry is only available in Polish. For the sake of viewer convenience, the content is shown below in the alternative language. You may click the link to switch the active language.Kilka miesi\u0119cy&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":627,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[115,98,108],"tags":[6,99,9],"jetpack_publicize_connections":[],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/LDAP-DIT.jpg?fit=1267%2C1073&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7M9Tz-9F","jetpack-related-posts":[{"id":685,"url":"https:\/\/drfugazi.eu.org\/en\/autofs-in-ldap-configuration-linux-solaris\/","url_meta":{"origin":599,"position":0},"title":"Autofs in LDAP configuration &#8211; for Linux and Solaris","author":"drfugazi","date":"Friday November 25th, 2016","format":false,"excerpt":"If you have LDAP server as user repository it is also good to have NFS server to store their home directories. To avoid autofs map configuration on every host, you can use LDAP service to store maps. I assume that NFS server (NFSHOME) is already installed, LDAP server and client\u2026","rel":"","context":"In &quot;LDAP&quot;","block_context":{"text":"LDAP","link":"https:\/\/drfugazi.eu.org\/en\/category\/ldap\/"},"img":{"alt_text":"LDAP DIT","src":"https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/LDAP-DIT.jpg?fit=1200%2C1016&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/LDAP-DIT.jpg?fit=1200%2C1016&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/LDAP-DIT.jpg?fit=1200%2C1016&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/LDAP-DIT.jpg?fit=1200%2C1016&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/LDAP-DIT.jpg?fit=1200%2C1016&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":729,"url":"https:\/\/drfugazi.eu.org\/en\/sudoers-in-ldap\/","url_meta":{"origin":599,"position":1},"title":"Sudoers in LDAP","author":"drfugazi","date":"Wednesday June 28th, 2017","format":false,"excerpt":"In addition to the standard sudoers file, sudo may be configured via LDAP. This can be especially useful for synchronizing sudoers in a large, distributed environment. You need to have LDAP server and client configured, if you do not have already, see my previous posts. LDAP schema extension for sudo\u2026","rel":"","context":"In &quot;LDAP&quot;","block_context":{"text":"LDAP","link":"https:\/\/drfugazi.eu.org\/en\/category\/ldap\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2017\/06\/sudo-sudoers-make-me-sandwich.jpg?fit=360%2C299&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":692,"url":"https:\/\/drfugazi.eu.org\/en\/solaris-ldap-autofs-client-configuration\/","url_meta":{"origin":599,"position":2},"title":"Solaris LDAP autofs client configuration","author":"drfugazi","date":"Thursday December 15th, 2016","format":false,"excerpt":"Last time I wrote about autofs configuration on LDAP server, now it is time to configure autofs client in Solaris. I assume that in DUAConfigProfile, objectClasses and attributes are already defined. You can check this with simply commands: [bash] % ldaplist -l auto_master dn: automountMapName=auto_master,ou=service,dc=mycompany,dc=com automountMapName: auto_master objectClass: automountMap objectClass:\u2026","rel":"","context":"In &quot;LDAP&quot;","block_context":{"text":"LDAP","link":"https:\/\/drfugazi.eu.org\/en\/category\/ldap\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/02\/Solaris_OS_logo.png?fit=800%2C393&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/02\/Solaris_OS_logo.png?fit=800%2C393&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/02\/Solaris_OS_logo.png?fit=800%2C393&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/02\/Solaris_OS_logo.png?fit=800%2C393&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":641,"url":"https:\/\/drfugazi.eu.org\/en\/solaris-ldap-client-configuration\/","url_meta":{"origin":599,"position":3},"title":"Solaris LDAP client configuration","author":"drfugazi","date":"Tuesday June 21st, 2016","format":false,"excerpt":"Oracle Solaris has native LDAP support built in OS, so there is no need to install third-party software to configure Solaris to use LDAP as users\/groups and other repository. You can use different ways to do this, and I will describe few of them. If secure communication is required, and\u2026","rel":"","context":"In &quot;LDAP&quot;","block_context":{"text":"LDAP","link":"https:\/\/drfugazi.eu.org\/en\/category\/ldap\/"},"img":{"alt_text":"LDAP DIT","src":"https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/LDAP-DIT.jpg?fit=1200%2C1016&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/LDAP-DIT.jpg?fit=1200%2C1016&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/LDAP-DIT.jpg?fit=1200%2C1016&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/LDAP-DIT.jpg?fit=1200%2C1016&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/06\/LDAP-DIT.jpg?fit=1200%2C1016&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":672,"url":"https:\/\/drfugazi.eu.org\/en\/linux-ldap-client-configuration\/","url_meta":{"origin":599,"position":4},"title":"Linux LDAP client configuration","author":"drfugazi","date":"Thursday October  6th, 2016","format":false,"excerpt":"The simplest way to configure LDAP client in Linux is to use some kind of tool delivered with system. SuSE has yast (yast2), RedHat family has authconfig (authconfig-tui). This should install required packages like: nss-pam-ldapd, nscd, pam_ldap, ldapclient etc. Unfortunatelly I don't remember list of packages for particular distributions, because\u2026","rel":"","context":"In &quot;LDAP&quot;","block_context":{"text":"LDAP","link":"https:\/\/drfugazi.eu.org\/en\/category\/ldap\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/10\/linux-logo.jpg?fit=300%2C300&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":75,"url":"https:\/\/drfugazi.eu.org\/en\/","url_meta":{"origin":599,"position":5},"title":"Solaris 10","author":"drfugazi","date":"Wednesday December 10th, 2008","format":false,"excerpt":"Solaris 10 Instalacja, konfiguracja, administracja i codzienne zmagania. Znajdziesz tu troch\u0119 informacji na temat instalacji, konfiguracji oraz administrowania systemami Unixowymi. Jako, \u017ce pracuj\u0119 g\u0142\u00f3wnie na systemach Solaris 10, to wi\u0119kszo\u015b\u0107 tekst\u00f3w b\u0119dzie dotyczy\u0142a tego systemu. Zreszt\u0105 lepszych lub gorszych opis\u00f3w dotycz\u0105cych system\u00f3w opartych o j\u0105dro Linuxa jest w sieci pod\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/posts\/599"}],"collection":[{"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/comments?post=599"}],"version-history":[{"count":17,"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/posts\/599\/revisions"}],"predecessor-version":[{"id":683,"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/posts\/599\/revisions\/683"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/media\/627"}],"wp:attachment":[{"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/media?parent=599"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/categories?post=599"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/tags?post=599"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}