1
Most Linux distros I've used have a passwd
program which can be used to do things like forcibly expire passwords, or lock them to temporarily prevent password-based login. OS X does have a passed
program, but from its manual page, it doesn't seem to have any of these features. The Users & Groups
preference pane doesn't seem to offer anything either save for a Reset Password…
button, which is really not what I'm looking for.
How do I temporarily disable a user's password in OS X in such a way that I can reenable it without actually changing it?
I'm on Mountain Lion, which doesn't seem to have a
niutil
program at all. – Blacklight Shining – 2013-02-21T15:42:30.903Sorry. http://stackoverflow.com/a/856531/420156
– allquixotic – 2013-02-21T15:48:38.263Err, how is that related? – Blacklight Shining – 2013-02-21T15:51:52.213
Oh,
niutil
was replaced bydscl
.dscl
doesn't seem to haveinsertval
ordestroyval
commands, though. – Blacklight Shining – 2013-02-21T15:54:17.313If you have not tested it, why even suggest it, considering the command actually DOES not work. – Ramhound – 2013-02-21T16:46:06.557
He said
OS X
, and didn't state what version. It'd be like giving advice to click on the Start Menu to someone who says they're running "Windows" when they're actually running Windows 8. By not being specific, the burden is on the OP to clarify, not on me to magically divine what version he is using. – allquixotic – 2013-02-21T16:53:58.747@Ramhound Okay, so I didn't test it, but given that
which niutil
returned a not-found error, I think it's safe to assume thatniutil $anything
would only get mezsh: command not found: niutil
. – Blacklight Shining – 2013-02-21T17:25:19.923@allquixotic Apologies. I did actually add the
osx-mountain-lion
tag to the question when I said in a comment that I was on Mountain Lion. By “disable password”, I meant the equivalent of Linux'ssudo passwd --lock
, which adds a leading!
to the password field of the relevant line in/etc/shadow
, thus rendering the password hash invalid in an easily-undoable manner. This prevents password-based logins for that account in such a way that I can reenable [the password] without actually changing it, as I asked. OS X doesn't have such apasswd
option, however, so I posted here. – Blacklight Shining – 2013-02-21T17:26:41.780