{"id":719,"date":"2017-05-10T15:05:29","date_gmt":"2017-05-10T13:05:29","guid":{"rendered":"http:\/\/drfugazi.eu.org\/?p=719"},"modified":"2017-05-24T12:08:17","modified_gmt":"2017-05-24T10:08:17","slug":"linux-ldap-autofs-client-configuration","status":"publish","type":"post","link":"https:\/\/drfugazi.eu.org\/en\/linux-ldap-autofs-client-configuration\/","title":{"rendered":"Linux LDAP autofs client configuration"},"content":{"rendered":"<p>There is a plenty of Linux distributions, so there is not my point to describe how to configure autofs in every one of them. This description is based on RedHat\/CentOS, but it can be applied to other distributions with very small changes.<br \/>\nIf you have local users and their directories located in <code>\/home<\/code> you may want to move their directories to e.g.: <code>\/export\/home<\/code>. Then you should change default HOME entry in <code>\/etc\/default\/useradd<\/code>:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# sed -i &quot;s|\/home|\/export\/home|&quot; \/etc\/default\/useradd\r\n<\/pre>\n<p>You should also change \/etc\/passwd entries for these users:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# usermod -m -d \/export\/home\/&lt;username&gt; &lt;username&gt;\r\n<\/pre>\n<p>or<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# sed -i &quot;s|:\/home|:\/export\/home|&quot; \/etc\/passwd\r\n<\/pre>\n<p>If <code>\/home<\/code> is separate filesystem, you should umount it, adjust the <code>\/etc\/fstab<\/code> and remount this as <code>\/export\/home<\/code>.<br \/>\nCheck the <code>\/etc\/autofs.conf<\/code> for <code>master_map_name<\/code>, default is:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nmaster_map_name = auto.master\r\n<\/pre>\n<p>then <code>\/etc\/auto.master<\/code> file, it should contain following entry:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n+auto.master\r\n<\/pre>\n<p>plus sign &#8220;+&#8221; means that the maps will be also read from the external source (NIS, LDAP).<br \/>\nYour LDAP configuration should be already defined in appropriate files (<code>\/etc\/ldap.conf<\/code>), please also check <code>\/etc\/autofs_ldap_auth.conf<\/code> file if it contains proper settings:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&lt;autofs_ldap_sasl_conf\r\n        usetls=&quot;yes&quot;\r\n        tlsrequired=&quot;yes&quot;\r\n        authrequired=&quot;no&quot;\r\n\/&gt;\r\n<\/pre>\n<p>Now it&#8217;s time to add ldap source to <code>\/etc\/nsswitch.conf<\/code>:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# grep auto \/etc\/nsswitch.conf\r\nautomount:  files ldap\r\n<\/pre>\n<p>and start automounter service:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n# service autofs start\r\n<\/pre>\n<p>Now, if you make <code>su - ldapuser<\/code> or <code>cd \/home\/ldapdir<\/code>, automounter should be able to mount user directory from NFS server defined in LDAP. <\/p>\n<p>Useful links:<br \/>\n<a href=\"https:\/\/access.redhat.com\/documentation\/en-US\/Red_Hat_Enterprise_Linux\/6\/html\/Storage_Administration_Guide\/s2-nfs-config-autofs-LDAP.html\" target=\"_blank\">Using LDAP to Store Automounter Maps<\/a><br \/>\n<a href=\"https:\/\/access.redhat.com\/documentation\/en-US\/Red_Hat_Enterprise_Linux\/6\/html\/Storage_Administration_Guide\/s2-nfs-config-autofs-augmenting.html\" target=\"_blank\">NFS autofs augmenting<\/a><br \/>\n<a href=\"https:\/\/help.ubuntu.com\/community\/AutofsLDAP\" target=\"_blank\">AutoFS LDAP<\/a><br \/>\n<a href=\"https:\/\/linux.die.net\/man\/8\/automount_selinux\" target=\"_blank\">Automount SELinux<\/a><br \/>\n<\/p>","protected":false},"excerpt":{"rendered":"<p>There is a plenty of Linux distributions, so there is not my point to describe how to configure autofs in every one of them. This description is based on RedHat\/CentOS, but it can be&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":675,"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":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[115,98],"tags":[6,99,44],"jetpack_publicize_connections":[],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/drfugazi.eu.org\/wp-content\/uploads\/2016\/10\/linux-logo.jpg?fit=300%2C300&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7M9Tz-bB","jetpack-related-posts":[{"id":692,"url":"https:\/\/drfugazi.eu.org\/en\/solaris-ldap-autofs-client-configuration\/","url_meta":{"origin":719,"position":0},"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":272,"url":"https:\/\/drfugazi.eu.org\/en\/mail-delivery-configuration-ldap\/","url_meta":{"origin":719,"position":1},"title":"Mail delivery configuration with LDAP","author":"drfugazi","date":"Wednesday May 25th, 2011","format":false,"excerpt":"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.Ostatnim razem pisa\u0142em o uwierzytelnianiu u\u017cytkownik\u00f3w w katalogu LDAP aby umo\u017cliwia\u0107 im odbieranie i nadawanie poczty. Teraz nadszed\u0142\u2026","rel":"","context":"In &quot;LDAP&quot;","block_context":{"text":"LDAP","link":"https:\/\/drfugazi.eu.org\/en\/category\/ldap\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":685,"url":"https:\/\/drfugazi.eu.org\/en\/autofs-in-ldap-configuration-linux-solaris\/","url_meta":{"origin":719,"position":2},"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":271,"url":"https:\/\/drfugazi.eu.org\/en\/berkeley-db-upgrade\/","url_meta":{"origin":719,"position":3},"title":"BerkeleyDB upgrade","author":"drfugazi","date":"Wednesday May 25th, 2011","format":false,"excerpt":"During switching LDAP directory to new environment with newer version of OpenLDAP (2.4.25) and new BerkeleyDB (5.1.25), I received following error message: Program version 5.1 doesn't match environment version 4.7 database ... cannot be opened, err -30969. Restore from backup! bdb(...): txn_checkpoint interface requires an environment configured for the transaction\u2026","rel":"","context":"In &quot;Solaris&quot;","block_context":{"text":"Solaris","link":"https:\/\/drfugazi.eu.org\/en\/category\/solaris\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":355,"url":"https:\/\/drfugazi.eu.org\/en\/dovecot-compilation-and-installation\/","url_meta":{"origin":719,"position":4},"title":"Dovecot &#8211; compilation and installation","author":"drfugazi","date":"Wednesday June 27th, 2012","format":false,"excerpt":"On Linux systems you can install Dovecot from packages. Appropriate packages supports also LDAP authentication, MySQL and so on. Unfortunatelly you probably would not find a newest versions, when you install in this manner. Eg. for today in Ubuntu packages you will find version 2.0.19-0ubuntu1, while on Dovecot page version\u2026","rel":"","context":"In &quot;Mail system&quot;","block_context":{"text":"Mail system","link":"https:\/\/drfugazi.eu.org\/en\/category\/mail-system\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":206,"url":"https:\/\/drfugazi.eu.org\/en\/dovecot-1213\/","url_meta":{"origin":719,"position":5},"title":"dovecot-1.2.13","author":"drfugazi","date":"Friday August 13th, 2010","format":false,"excerpt":"Dovecot jest Open Sourceowym serwerem IMAP i POP3 dla system\u00f3w Linux\/UNIX, napisanym z naciskiem na bezpiecze\u0144stwo. Dovecot jest doskona\u0142ym wyborem zar\u00f3wno dla ma\u0142ych jak i wielkich instalacji. Jest szybki, \u0142atwy do ustawienia, nie wymaga specjalnej administracji i u\u017cywa niewiele pami\u0119ci. \u0179r\u00f3d\u0142o: http:\/\/dovecot.org\/ Poni\u017cej znajdziecie zapis sesji konfiguracji i kompilacji serwera\u2026","rel":"","context":"In \"Dovecot\"","block_context":{"text":"Dovecot","link":"https:\/\/drfugazi.eu.org\/en\/tag\/dovecot\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/posts\/719"}],"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=719"}],"version-history":[{"count":8,"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/posts\/719\/revisions"}],"predecessor-version":[{"id":777,"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/posts\/719\/revisions\/777"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/media\/675"}],"wp:attachment":[{"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/media?parent=719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/categories?post=719"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/drfugazi.eu.org\/en\/wp-json\/wp\/v2\/tags?post=719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}