You are not logged in.

#1 2017-01-19 20:05:20

stewbond
Member
Registered: 2015-05-12
Posts: 32

[Resolved][PAM.d] Unable to change password

I've set up a ldap server according to
https://wiki.archlinux.org/index.php/OpenLDAP and https://wiki.archlinux.org/index.php/LD … entication.

This is intended to be a skeleton ldap server meant only for authentication so that I can sync users and passwords accross multiple computers.

Everything seems to work except for changing passwords:

[izzy@ldaptest root]$ passwd
(current) LDAP Password: 
New password: 
Retype new password: 
password change failed: Insufficient access
passwd: User not known to the underlying authentication module
passwd: password unchanged

I'm not sure how to troubleshoot this.

Here are some files on the client:

[izzy@ldaptest root]$ cat /etc/pam.d/passwd
#%PAM-1.0
password        sufficient      pam_ldap.so
#password	required	pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3
#password	required	pam_unix.so sha512 shadow use_authtok
password        required	pam_unix.so sha512 shadow nullok
[izzy@ldaptest root]$ cat /etc/pam.d/system-auth
#%PAM-1.0

auth      sufficient pam_ldap.so
auth      required  pam_unix.so     try_first_pass nullok
auth      optional  pam_permit.so
auth      required  pam_env.so

account   sufficient pam_ldap.so
account   required  pam_unix.so
account   optional  pam_permit.so
account   required  pam_time.so

password  sufficient pam_ldap.so
password  required  pam_unix.so     try_first_pass nullok sha512 shadow
password  optional  pam_permit.so

session   required  pam_limits.so
session   required  pam_unix.so
session   optional  pam_ldap.so
session   optional  pam_permit.so

[izzy@ldaptest root]$ ldapsearch -x -b 'dc=ferg,dc=aero' '(objectclass=*)'
# extended LDIF
#
# LDAPv3
# base <dc=ferg,dc=aero> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# ferg.aero
dn: dc=ferg,dc=aero
objectClass: dcObject
objectClass: organization
dc: ferg
o: Example
description: Example directory

# root, ferg.aero
dn: cn=root,dc=ferg,dc=aero
objectClass: organizationalRole
cn: root
description: Directory Manager

# Manager, ferg.aero
dn: cn=Manager,dc=ferg,dc=aero
cn: Manager
description: LDAP administrator
objectClass: organizationalRole
objectClass: top
roleOccupant: dc=ferg,dc=aero

# People, ferg.aero
dn: ou=People,dc=ferg,dc=aero
ou: People
objectClass: top
objectClass: organizationalUnit

# Group, ferg.aero
dn: ou=Group,dc=ferg,dc=aero
ou: Group
objectClass: top
objectClass: organizationalUnit

# izzy, People, ferg.aero
dn: uid=izzy,ou=People,dc=ferg,dc=aero
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
uid: izzy
cn: Iskandar
sn: Iskandar The Cat
givenName: Iskandar
title: Not so baby kitty
telephoneNumber: +31 123 345 567
mobile: +31 123 123 123
postalAddress: AllCats$GoTo$Heaven
userPassword:: XXXXXXXXXXXXXXXXXXXXXXXXXXXX
labeledURI: https://archlinux.org
loginShell: /bin/bash
uidNumber: 9999
gidNumber: 9999
homeDirectory: /home/izzy/
description: This is an example user

# search result
search: 2
result: 0 Success

# numResponses: 7
# numEntries: 6

And here is some stuff on the server:

[root@ldap ~]# cat /etc/openldap/slapd.conf
#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include		/etc/openldap/schema/core.schema
include  	/etc/openldap/schema/cosine.schema
include  	/etc/openldap/schema/inetorgperson.schema
include  	/etc/openldap/schema/nis.schema
#include 	/etc/openldap/schema/samba.schema
#
# Define global ACLs to disable default read access.

# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral	ldap://root.openldap.org

pidfile		/run/openldap/slapd.pid
argsfile	/run/openldap/slapd.args

# Load dynamic backend modules:
# modulepath	/usr/lib/openldap
# moduleload	back_mdb.la
# moduleload	back_ldap.la

# Sample security restrictions
#	Require integrity protection (prevent hijacking)
#	Require 112-bit (3DES or better) encryption for updates
#	Require 63-bit encryption for simple bind
# security ssf=1 update_ssf=112 simple_bind=64

# Sample access control policy:
#	Root DSE: allow anyone to read it
#	Subschema (sub)entry DSE: allow anyone to read it
#	Other DSEs:
#		Allow self write access
#		Allow authenticated users read access
#		Allow anonymous users to authenticate
#	Directives needed to implement policy:
# access to dn.base="" by * read
# access to dn.base="cn=Subschema" by * read
# access to *
#	by self write
#	by users read
#	by anonymous auth
#
# if no access controls are present, the default policy
# allows anyone and everyone to read anything but restricts
# updates to rootdn.  (e.g., "access to * by * read")
#
# rootdn can always read and write EVERYTHING!
access to attrs=userPassword
	by self write
	by anonymous auth
	by dn.base="cn=Manager,dc=ferg,dc=aero" write
	by dn.base="cn=root,dc=ferg,dc=aero" write
	by * none

access to *
	by self write
	by dn.base="cn=Manager,dc=ferg,dc=aero" write
	by dn.base="cn=root,dc=ferg,dc=aero" write
	by * read
#######################################################################
# MDB database definitions
#######################################################################

database	mdb
maxsize		1073741824
suffix		"dc=ferg,dc=aero"
rootdn		"cn=root,dc=ferg,dc=aero"
# Cleartext passwords, especially for the rootdn, should
# be avoid.  See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
# The database directory MUST exist prior to running slapd AND 
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory	/var/lib/openldap/openldap-data
# Indices to maintain
index	objectClass	eq
index	uid		pres,eq
index	mail		pres,sub,eq
index	cn		pres,sub,eq
index	sn		pres,sub,eq
index	dc		eq

rootpw    {SSHA}XXXXXXXXXXXXXXXXXXXXXXXX

Last edited by stewbond (2017-01-20 15:59:33)

Offline

#2 2017-01-20 15:58:44

stewbond
Member
Registered: 2015-05-12
Posts: 32

Re: [Resolved][PAM.d] Unable to change password

I think I've found an answer.  My LDAP server is completely unencrypted at the moment.  it isn't using TLS at all because I was simplifying it for the LAN. 

According to the following article:
https://onemoretech.wordpress.com/2014/ … -on-linux/

The LDAP uri you enter will depend upon whether you’re going to be connecting over unencrypted LDAP, SSL LDAPS or LDAP TLS. Password changes may not work using unencrypted LDAP, and it’s eventually going to be deprecated. LDAPS is also supposed to be deprecated in a future release (there are concerns about the efficacy of its security). As a result, using TLS is highly recommended.

This explains why the password doesn't change.  I'm going to close the question.

Offline

#3 2017-02-01 13:12:41

cafe
Member
From: Brasil
Registered: 2014-03-20
Posts: 165

Re: [Resolved][PAM.d] Unable to change password

I've managed to configure password change without TLS. I'll check my setup later (when I visit the lab) and return with the solution I've encountered back then

Offline

Board footer

Powered by FluxBB