My question is similar to this. I use pam_ldap for users auth. /etc/nsswitch.conf file contains:
passwd: files ldap
group: files ldap
shadow: files ldap
All seems to be OK, but I need to hide password hashes of LDAP users in getent passwd output.
- I have read man 5 pam_ldap and didn't find any useful parameter for
/etc/ldap.conffile. - I read about
sssd,nslcdand findenumerateoption. It useful but I don't want install any of these services for now.
Is it possible to hide password hashes if I use pam_ldap?
Example of user tester:
dn: cn=tester,ou=users,dc=example,dc=org
objectClass: inetOrgPerson
objectClass: person
objectClass: organizationalPerson
objectClass: top
objectClass: posixAccount
cn: tester
gidNumber: 10000
homeDirectory: /home/tester
sn: Tester
uid: tester
uidNumber: 10000
loginShell: /bin/bash
userPassword: {CRYPT}$1$......
My openldap access configuration:
access to attrs=userPassword
by self write
by anonymous auth
by users none
access to * by * read
My pam_ldap configuration:
uri ldap://my_host
base dc=example,dc=org
binddn cn=admin,dc=example,dc=org
bindpw myPass
ldap_version 3
port 389
scope one
timelimit 30
bind_timelimit 10
bind_policy soft
nss_connect_policy persist
idle_timelimit 3600
nss_paged_results yes
pagesize 1000
pam_filter objectclass=posixAccount
pam_login_attribute uid
pam_lookup_policy yes
pam_password md5
nss_initgroups_ignoreusers root
nss_schema rfc2307bis
nss_base_passwd ou=users,dc=example,dc=org?one
nss_base_shadow ou=users,dc=example,dc=org?one
nss_base_group ou=groups,dc=example,dc=org?sub
ssl no
TLS_REQCERT allow