Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

OSX Server - LDAP / pwpolicy - How to disable a account?

Hi.


For some reason, Apple is great at just changing the syntax or path of <insert random feature here>.

And thus, I'm having trouble disabling (not locking a account, that seems to work fine by setting pwdLastSet to 0) which should disable the user from logging in.


The reason being is that i'm creating a scenario where:


* User tries to login 3 times -> Gets locked out

* A script running in the background unlocks the account after 30min or so


In between or even after the system adminitrator has a neat button to disable accounts and it shouldn't just lock out the accounts because that would sort of defeat the purpose of the script and the whole locked-out mechanism but rather disable the account all togeather rendering the users account invalid for logins even if the correct password is supplied and the account is unlocked/never locked in the first place.



Is this possible? and where do i get & set this value because it sure isn't stored in the LDAP directory any longer (or wasn't even in the first place?).



Script language: PHP





(Note: I come from a Unix and some what Windows background and finding things in OSX is more confusing than not since 80% of the guides and documentation is obsolete if you even manage to find any on the interwebs, hence why i need help with even the basic stuff as figuring out how and where the mechanics are for different password/account parts)

Virtual and Some default server?-OTHER, OS X Server, PHP, Apache, OpenLDAP (?)

Posted on Apr 3, 2013 3:15 AM

Reply
4 replies

Apr 17, 2013 12:13 AM in response to hvornum

One solution is to:


pwpolicy -a diradmin -u ajohnson -setpolicy "isDisabled=1"


But this doesn't disable the local useraccount (if there is one),

so then you would have to do:


sudo dscl . -create /Users/ajohnson UserShell /usr/bin/false


And this must be synced via some sort of scrip (idiotic infrastructure server solution.. it's not a server unless the user depends on it, then it's just a can with a bunch of server software running standalone).


There's also some other workarounds described here:

http://serverfault.com/questions/61214/how-can-i-disable-a-user-account-from-the -cli-with-mac-os-x-server


But none of these does what i want to do, i want to unify the whole adminisration via a web-gui (or a opengl built gui) hat can interact with the system running the accounts (LDAP).

So why in the name of the green planet can't i access all the data where it's designed to be? deviant apple is deviant..

OSX Server - LDAP / pwpolicy - How to disable a account?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.