{"id":1235,"date":"2017-03-29T12:29:56","date_gmt":"2017-03-29T11:29:56","guid":{"rendered":"http:\/\/diablo.craem.net\/?p=1235"},"modified":"2017-03-29T12:29:56","modified_gmt":"2017-03-29T11:29:56","slug":"debian-client-login-ldap-server","status":"publish","type":"post","link":"https:\/\/diablo.craem.net\/?p=1235","title":{"rendered":"Debian client login ldap server"},"content":{"rendered":"<p>otra entrada que es un apunte.<\/p>\n<p>En esta ocasi\u00f3n, vamos a hacer en nuestros servers, que el login vaya centralizado contra nuestro ldap.<\/p>\n<p>Primero de todo, instalamos las dependencias:<\/p>\n<p><code><br \/>\nroot@pbxshared:\/etc\/asterisk# apt-get install libpam-ldap nscd<br \/>\n<\/code><\/p>\n<p><code><br \/>\naptitude -y install libnss-ldap libpam-ldap ldap-utils<br \/>\n<\/code><\/p>\n<p>instalamos y nos pide la url del ldap:<\/p>\n<p><code><br \/>\nLDAP server URI<br \/>\nldap:\/\/mi.serverldap.com<br \/>\n<\/code><\/p>\n<p><code><br \/>\nDistinguished name of the search base:<br \/>\ndc=exemple,dc=local<br \/>\n<\/code><\/p>\n<p><code><br \/>\nLDAP version to use:<br \/>\n3<br \/>\n<\/code><\/p>\n<p><code><br \/>\nConfiguring libpam-ldap<br \/>\nhis option will allow password utilities that use PAM to change local passwords.<br \/>\nThe LDAP admin account password will be stored in a separate file which will be made readable to root only.<br \/>\nIf \/etc is mounted by NFS, this option should be disabled.<br \/>\nAllow LDAP admin account to behave like local root?     <\/code><\/p>\n<p><code>\n<\/code><\/p>\n<p><code>YES<br \/>\n<\/code><\/p>\n<p><code><br \/>\nDatabase requires login<br \/>\nYES<br \/>\n<\/code><\/p>\n<p><code><br \/>\nConfiguring libpam-ldap<br \/>\ncn=manager,dc=example,dc=net<br \/>\n<\/code><\/p>\n<p><code><br \/>\nConfiguring libpam-ldap<br \/>\nmipassword<br \/>\n<\/code><\/p>\n<p>Ahora editamos el fichero \/etc\/nsswitch.conf y dejamos tal cual:<br \/><code><br \/>\n<strong>passwd:         ldap compat<br \/>\ngroup:          ldap compat<br \/>\nshadow:         ldap compat<\/strong><br \/>\ngshadow:        files<\/code><\/p>\n<p><code><code><\/code><\/code><\/p>\n<p>hosts: files dns<br \/>networks: files<\/p>\n<p><code><code><\/code><\/code><\/p>\n<p>protocols: db files<br \/>services: db files<br \/>ethers: db files<br \/>rpc: db files<\/p>\n<p><code>\n<\/code><\/p>\n<p><code>netgroup:       nis<br \/>\n<\/code><\/p>\n<p>Editamos el fichero \/etc\/pam.d\/common-session y a\u00f1adimos al final:<br \/><code><br \/>\nsession required    pam_mkhomedir.so skel=\/etc\/skel umask=0022<br \/>\n<\/code><\/p>\n<p>reiniciamos el servicio nscd<br \/><code><br \/>\n \/etc\/init.d\/nscd restart<br \/>\n<\/code><br \/>Instalamos sudo si no est\u00e1..<br \/><code><br \/>\napt-get install sudo<br \/>\n<\/code><\/p>\n<p>Y modificamos el visudo<\/p>\n<p><code><br \/>\n#visudo<br \/>\n<\/code><\/p>\n<p>a\u00f1adimos el grupo que podr\u00e1 hacer sudo su<br \/><code><br \/>\n# User privilege specification<br \/>\nroot    ALL=(ALL:ALL) ALL<br \/>\n%admin_users ALL=(ALL) ALL<br \/>\n<\/code><\/p>\n<p>Admin_users es el grupo LDAP donde se encuentren nuestros usuarios.<\/p>\n<p>ahora vamos a reestringir a un grupo de ldap el login al server. Editamos el fichero \/etc\/pam.d\/common-auth y a\u00f1adimos:<br \/><code><br \/>\nauth    required                        pam_access.so<br \/>\n<\/code><\/p>\n<p>Editamos el fichero \/etc\/security\/access.conf y a\u00f1adimos el grupo al cual permitiremos acceso, a\u00f1adiendo al final:<br \/><code><br \/>\n-:ALL EXCEPT root (admin_users):ALL EXCEPT LOCAL<br \/>\n<\/code><\/p>\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>otra entrada que es un apunte. En esta ocasi\u00f3n, vamos a hacer en nuestros servers, que el login vaya centralizado contra nuestro ldap. Primero de todo, instalamos las dependencias: root@pbxshared:\/etc\/asterisk# apt-get install libpam-ldap nscd aptitude -y install libnss-ldap libpam-ldap ldap-utils instalamos y nos pide la url del ldap: LDAP server URI ldap:\/\/mi.serverldap.com Distinguished name of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-1235","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/diablo.craem.net\/index.php?rest_route=\/wp\/v2\/posts\/1235","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/diablo.craem.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/diablo.craem.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/diablo.craem.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/diablo.craem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1235"}],"version-history":[{"count":0,"href":"https:\/\/diablo.craem.net\/index.php?rest_route=\/wp\/v2\/posts\/1235\/revisions"}],"wp:attachment":[{"href":"https:\/\/diablo.craem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/diablo.craem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/diablo.craem.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}