Openldap posix accounts: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
 
(23 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
 
+
=nsswitch und pam anbinden=
=nsswitch anbinden=
+
*apt install libnss-ldap libpam-ldap ldap-utils
apt-get install libnss-ldap
+
=ldap.conf=
 +
*[[ldap.conf]]
 
==Wir benutzen nur eine Konfigurationdatei==
 
==Wir benutzen nur eine Konfigurationdatei==
ln -sf /etc/ldap/ldap.conf /etc/ldap.conf
+
*ln -sf /etc/ldap/ldap.conf /etc/ldap.conf
 
+
*ln -sf /etc/ldap/ldap.conf /etc/libnss-ldap.conf
 +
*ln -sf /etc/ldap/ldap.conf /etc/pam_ldap.conf
 +
=Test=
 +
*ldapsearch -x | head  -20
 
==ergänzen /etc/nsswitch.conf==
 
==ergänzen /etc/nsswitch.conf==
 
  passwd:        compat ldap
 
  passwd:        compat ldap
Zeile 19: Zeile 23:
 
  uid=2001(leroy) gid=3001(it) Gruppen=3001(it)
 
  uid=2001(leroy) gid=3001(it) Gruppen=3001(it)
  
 +
*[[pam ldap]]
  
=ldap pam install=
+
=sudo opportunity 1=
apt-get install libpam-ldap
 
 
 
=Anpassen der Pam=
 
==Die Authentifizierung(installation nimmt einstellung schon vor)==
 
gawron:/etc/pam.d# cat common-auth
 
auth    sufficient  pam_ldap.so
 
auth    required    pam_unix.so nullok_secure use_first_pass
 
==Das Accounting(muss geändert werden)==
 
gawron:/etc/pam.d# cat common-account
 
account sufficient      pam_ldap.so
 
account sufficient      pam_unix.so
 
 
 
==Anmeldung mit Gruppenrichtlinien==
 
/etc/ldap.conf
 
pam_groupdn cn=it,ou=groups,dc=xinux,dc=net
 
pam_member_attribute memberUid
 
 
 
==Passwort änderungen==
 
gawron:/etc/pam.d# cat common-password
 
password    sufficient    pam_ldap.so
 
password    sufficient    pam_unix.so
 
password    required      pam_deny.so
 
==Die Session==
 
gawron:/etc/pam.d# cat common-session
 
session required pam_mkhomedir.so  skel=/etc/skel umask=0022
 
session required        pam_unix.so
 
==Passwort für den User setzen==
 
gawron:/etc/pam.d# passwd leroy
 
New password:
 
Re-enter new password:
 
LDAP password information changed for leroy
 
passwd: password updated successfully
 
 
 
=sudo opurtunity 1=
 
 
*/etc/pam.d/common-auth
 
*/etc/pam.d/common-auth
 
  #First entry should be
 
  #First entry should be
Zeile 61: Zeile 32:
 
*/etc/security/group.conf
 
*/etc/security/group.conf
 
  *;*;*;Al0000-2400;audio,cdrom,dialout,floppy,sudo,adm,video
 
  *;*;*;Al0000-2400;audio,cdrom,dialout,floppy,sudo,adm,video
=sudo opurtunity 2=
+
 
 +
=sudo opportunity 2=
 
*visudo
 
*visudo
 
  %it    ALL=(ALL:ALL) ALL
 
  %it    ALL=(ALL:ALL) ALL

Aktuelle Version vom 16. Januar 2023, 13:26 Uhr

nsswitch und pam anbinden

  • apt install libnss-ldap libpam-ldap ldap-utils

ldap.conf

Wir benutzen nur eine Konfigurationdatei

  • ln -sf /etc/ldap/ldap.conf /etc/ldap.conf
  • ln -sf /etc/ldap/ldap.conf /etc/libnss-ldap.conf
  • ln -sf /etc/ldap/ldap.conf /etc/pam_ldap.conf

Test

  • ldapsearch -x | head -20

ergänzen /etc/nsswitch.conf

passwd:         compat ldap
group:          compat ldap

nsswitch tests

passwd test

getent passwd | grep 3001
leroy:x:2001:3001:leroy:/home/leroy:/bin/bash

group test

getent group | grep 3001
it:*:3001:

id test

id leroy
uid=2001(leroy) gid=3001(it) Gruppen=3001(it)

sudo opportunity 1

  • /etc/pam.d/common-auth
#First entry should be
auth    required     pam_group.so use_first_pass
  • /etc/security/group.conf
*;*;*;Al0000-2400;audio,cdrom,dialout,floppy,sudo,adm,video

sudo opportunity 2

  • visudo
%it     ALL=(ALL:ALL) ALL