LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-23-2021, 03:24 AM   #1
nanfackj
LQ Newbie
 
Registered: Jun 2021
Posts: 1

Rep: Reputation: Disabled
Issue with password policies 389-ds


Hi all,

Please can you help me identify why I'm not able to configure a password policy ?

As you can see below, the password policy has been configured, but when I test it, It's not working....

I'm running the 389-ds server on Linux Suse15 sp2
# uname -a
Linux dl360s-04 5.3.18-24.15-default #1 SMP Thu Sep 3 22:48:37 UTC 2020 (b3a3711) x86_64 x86_64 x86_64 GNU/Linux


- Here is the definition of the password policy I want to apply :

According to the last line for example, it should not accept any password length below 20.

LDAP_SERVER:~ # dsconf -D "cn=Directory Manager" ldap://LDAP_SERVER.example.fr localpwp get "ou=people,dc=example,dc=fr"
Enter password for cn=Directory Manager on ldap://LDAP_SERVER.example.fr:
Local Subtree Policy Policy for "ou=people,dc=example,dc=fr": cn=cn\3DnsPwPolicyEntry3\2Cou\3Dpeople\2Cdc\3Dexample\2Cdc\3Dfr,cn=nsPwPolicyContainer,ou=people,dc= example,dc=fr
------------------------------------
passwordstoragescheme: PBKDF2_SHA256
passwordchange: off
passwordmustchange: on
passwordinhistory: 4
passwordwarning: 2500
passwordmaxage: 6000
passwordminage: 2000
passwordgracelimit: 1
passwordlockout: on
passwordlockoutduration: 1000
passwordmaxfailure: 1
passwordresetfailurecount: 300
passwordminlength: 20


- Here is the definition of the container :
# ldapsearch -x -v -LL -h LDAP_SERVER -p 389 -D cn="Directory Manager" -w PASSWORD1234 -b "cn=nsPwPolicyContainer,ou=people,dc=example,dc=fr"

dn: cn=nsPwPolicyContainer,ou=people,dc=example,dc=fr
objectClass: top
objectClass: nsContainer
cn: nsPwPolicyContainer

dn: cn=cn\3DnsPwTemplateEntry\2Cou\3Dpeople\2Cdc\3Dexample\2Cdc\3Dfr,cn=nsPwPolicyContainer,ou=people,dc =example,dc=fr
cn: cn=nsPwTemplateEntry,ou=people,dc=example,dc=fr
cn: cn\=nsPwTemplateEntry\,ou\=people\,dc\=example\,dc\=fr
cosPriority: 1
objectClass: top
objectClass: cosTemplate
objectClass: extensibleObject

- Here the definition of the template :
# ldapsearch -x -v -LL -h LDAP_SERVER -p 389 -D cn="Directory Manager" -w PASSWORD1234 -b "cn=cn\3DnsPwTemplateEntry\2Cou\3Dpeople\2Cdc\3Dexample\2Cdc\3Dfr,cn=nsPwPolicyContainer,ou=people,d c=example,dc=fr"
filter: (objectclass=*)
requesting: All userApplication attributes
version: 1

dn: cn=cn\3DnsPwTemplateEntry\2Cou\3Dpeople\2Cdc\3Dexample\2Cdc\3Dfr,cn=nsPwPolicyContainer,ou=people,dc =example,dc=fr
cn: cn=nsPwTemplateEntry,ou=people,dc=example,dc=fr
cn: cn\=nsPwTemplateEntry\,ou\=people\,dc\=example\,dc\=fr
cosPriority: 1
objectClass: top
objectClass: cosTemplate
objectClass: extensibleObject


- Here is the definition of the user demo_user6 (created for testing):

# ldapsearch -x -v -LL -h LDAP_SERVER -p 389 -D cn="Directory Manager" -w PASSWORD1234 -b "uid=demo_user6,ou=people,dc=example,dc=fr" pwdpolicysubentry
filter: (objectclass=*)
requesting: pwdpolicysubentry
version: 1

dn: uid=demo_user6,ou=people,dc=example,dc=fr
pwdpolicysubentry: cn=cn\3DnsPwPolicyEntry3\2Cou\3Dpeople\2Cdc\3Dexample\2Cdc\3Dfr,cn=nsPwPolicyContainer,ou=people,dc= example,dc=fr


# ldapsearch -x -v -LL -h LDAP_SERVER -p 389 -D cn="Directory Manager" -w PASSWORD1234 -b "uid=demo_user6,ou=people,dc=example,dc=fr"
filter: (objectclass=*)
requesting: All userApplication attributes
version: 1

dn: uid=demo_user6,ou=people,dc=example,dc=fr
shadowLastChange: 18799
userPassword:: XXXXXX
uid: demo_user6
objectClass: posixAccount
objectClass: shadowAccount
objectClass: account
objectClass: top
loginShell: /bin/bash
homeDirectory: /home/demo_user6
gecos: Demo User6
description: No description
gidNumber: 10005
uidNumber: 10006
cn: demo_user6


TEST :

Here we'll try an ldapmodify, by logging with the test user (user6), we try to edit the password of the user which is less than 20 characters, but unfortunately it works...

# ldapmodify -D "uid=demo_user6,ou=people,dc=example,dc=fr" -w "oldpwd" -x -h LDAP_SERVER -v
ldap_initialize( ldap://LDAP_SERVER )

dn: uid=demo_user6,ou=people,dc=example,dc=fr
changetype: modify
replace: userPassword
userPassword: newpwd

replace userPassword:
newpwd
modifying entry "uid=demo_user6,ou=people,dc=example,dc=fr"
modify complete



Hope I can find some help,

THanks in advance,
 
Old 06-24-2021, 08:59 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,699

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by nanfackj View Post
Hi all,
Please can you help me identify why I'm not able to configure a password policy ? As you can see below, the password policy has been configured, but when I test it, It's not working.... I'm running the 389-ds server on Linux Suse15 sp2
# uname -a
Linux dl360s-04 5.3.18-24.15-default #1 SMP Thu Sep 3 22:48:37 UTC 2020 (b3a3711) x86_64 x86_64 x86_64 GNU/Linux

Here is the definition of the password policy I want to apply: According to the last line for example, it should not accept any password length below 20.
Code:
LDAP_SERVER:~ # dsconf  -D "cn=Directory Manager" ldap://LDAP_SERVER.example.fr localpwp get "ou=people,dc=example,dc=fr"
Enter password for cn=Directory Manager on ldap://LDAP_SERVER.example.fr:
Local Subtree Policy Policy for "ou=people,dc=example,dc=fr": cn=cn\3DnsPwPolicyEntry3\2Cou\3Dpeople\2Cdc\3Dexample\2Cdc\3Dfr,cn=nsPwPolicyContainer,ou=people,dc=example,dc=fr
------------------------------------
passwordstoragescheme: PBKDF2_SHA256
passwordchange: off
passwordmustchange: on
passwordinhistory: 4
passwordwarning: 2500
passwordmaxage: 6000
passwordminage: 2000
passwordgracelimit: 1
passwordlockout: on
passwordlockoutduration: 1000
passwordmaxfailure: 1
passwordresetfailurecount: 300
passwordminlength: 20
Here is the definition of the container :
Code:
# ldapsearch -x -v -LL -h LDAP_SERVER  -p 389 -D cn="Directory Manager" -w PASSWORD1234 -b  "cn=nsPwPolicyContainer,ou=people,dc=example,dc=fr"

dn: cn=nsPwPolicyContainer,ou=people,dc=example,dc=fr
objectClass: top
objectClass: nsContainer
cn: nsPwPolicyContainer

dn: cn=cn\3DnsPwTemplateEntry\2Cou\3Dpeople\2Cdc\3Dexample\2Cdc\3Dfr,cn=nsPwPolicyContainer,ou=people,dc=example,dc=fr
cn: cn=nsPwTemplateEntry,ou=people,dc=example,dc=fr
cn: cn\=nsPwTemplateEntry\,ou\=people\,dc\=example\,dc\=fr
cosPriority: 1
objectClass: top
objectClass: cosTemplate
objectClass: extensibleObject
Here the definition of the template :
Code:
# ldapsearch -x -v -LL -h LDAP_SERVER  -p 389 -D cn="Directory Manager" -w PASSWORD1234 -b  "cn=cn\3DnsPwTemplateEntry\2Cou\3Dpeople\2Cdc\3Dexample\2Cdc\3Dfr,cn=nsPwPolicyContainer,ou=people,dc=example,dc=fr"
filter: (objectclass=*)
requesting: All userApplication attributes
version: 1

dn: cn=cn\3DnsPwTemplateEntry\2Cou\3Dpeople\2Cdc\3Dexample\2Cdc\3Dfr,cn=nsPwPolicyContainer,ou=people,dc=example,dc=fr
cn: cn=nsPwTemplateEntry,ou=people,dc=example,dc=fr
cn: cn\=nsPwTemplateEntry\,ou\=people\,dc\=example\,dc\=fr
cosPriority: 1
objectClass: top
objectClass: cosTemplate
objectClass: extensibleObject
Here is the definition of the user demo_user6 (created for testing):
Code:
# ldapsearch -x -v -LL -h LDAP_SERVER  -p 389 -D cn="Directory Manager" -w PASSWORD1234 -b  "uid=demo_user6,ou=people,dc=example,dc=fr" pwdpolicysubentry
filter: (objectclass=*)
requesting: pwdpolicysubentry
version: 1

dn: uid=demo_user6,ou=people,dc=example,dc=fr
pwdpolicysubentry: cn=cn\3DnsPwPolicyEntry3\2Cou\3Dpeople\2Cdc\3Dexample\2Cdc\3Dfr,cn=nsPwPolicyContainer,ou=people,dc=example,dc=fr


# ldapsearch -x -v -LL -h LDAP_SERVER  -p 389 -D cn="Directory Manager" -w PASSWORD1234 -b  "uid=demo_user6,ou=people,dc=example,dc=fr"
filter: (objectclass=*)
requesting: All userApplication attributes
version: 1

dn: uid=demo_user6,ou=people,dc=example,dc=fr
shadowLastChange: 18799
userPassword:: XXXXXX
uid: demo_user6
objectClass: posixAccount
objectClass: shadowAccount
objectClass: account
objectClass: top
loginShell: /bin/bash
homeDirectory: /home/demo_user6
gecos: Demo User6
description: No description
gidNumber: 10005
uidNumber: 10006
cn: demo_user6
TEST: Here we'll try an ldapmodify, by logging with the test user (user6), we try to edit the password of the user which is less than 20 characters, but unfortunately it works...
Code:
# ldapmodify -D "uid=demo_user6,ou=people,dc=example,dc=fr" -w "oldpwd" -x -h LDAP_SERVER -v
ldap_initialize( ldap://LDAP_SERVER )

dn: uid=demo_user6,ou=people,dc=example,dc=fr
changetype: modify
replace: userPassword
userPassword: newpwd

replace userPassword:
        newpwd
modifying entry "uid=demo_user6,ou=people,dc=example,dc=fr"
modify complete
Please use CODE tags when posting configs..makes things much easier to read. Have you had experience with Linux in the past? I ask, because what *MIGHT* be the problem is that the directives you've supplied for password policies are all lower-case. Have you looked at the logs related to this when you start the service?
https://directory.fedoraproject.org/...rd-syntax.html

Try passwordMinLength instead, and see if that helps. And have you tried going in through the GUI and setting those values, or have you restarted the service after making those changes?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to implement password policies? pinga123 Linux - Newbie 8 11-26-2010 03:35 AM
Problems setting Password policies kentrimble Linux - Newbie 2 01-31-2010 07:36 PM
Password Policies -- Tricky question?? sachinh Linux - General 3 02-08-2008 06:18 PM
Applying Password Policies to All Users kaplan71 Linux - Security 1 11-29-2007 10:03 AM
Howto change system password policies (passwd length, complexity) tisource Linux - Security 3 09-06-2005 12:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration