Removing a password with Terminal.

How can I remove a password with terminal? I can change it, but I can't seem to remove it... Is there a way to do it (without the install disk).

Macbook, Mac OS X (10.4.10)

Posted on Sep 3, 2007 6:18 PM

Reply
15 replies

Sep 3, 2007 9:37 PM in response to Owen Pragel

There are various forms that could be used, but the simplest might be something like this, executed from an "admin" account:<pre>sudo /usr/bin/dscl . -passwd /Users/username ''</pre>Again, the usual warnings that a passwordless account may constitute a security risk. As others have already suggested, there may be a better approach depending on what the objective is...

In particular:
... How would I use dscl to reset a password?"...
Note that the above ' dscl' command sets the password to a blank.
That isn't the same as "resetting" or even "removing" the password (as the thread title says).
Hmm, so now I'm not so sure of the question you were actually asking, or if my response actually addressess it.

An account with a blank password can log in (in some contexts) without a password. An account that doesn't have a password won't be able to log in. They are sort of opposites...

Nov 13, 2007 12:23 AM in response to Owen Pragel

Hey I’m new to this site and I saw you post about removing a password with a terminal.
http://discussions.apple.com/thread.jspa?messageID=5256807&tstart=0
And, ironically enough, the exact same thing happened to me! So I would appreciate it if you would tell me how you removed the password, and if you used the dscl, because it is kind of hard to tell from that post. Thank you very much

Sep 3, 2007 10:38 PM in response to Owen Pragel

It might help if you described what the goal is. For example, sometimes this sort of question is motivated by the sudden inability to log in - i.e. the system suddenly stops accepting a known password. That sort of problem could be caused by a problem with the "NetInfo" database, which could in turn lead to an "invalid path" error. This is all speculation of course, but that's sort of my point - right now, there isn't much to go on.

For what it's worth, I have tested the command as posted in 10.4.10 (and in the past under 10.3.9) and an "Invalid Path" will result if a non-existent user is specified, or if there is some other error in the path. However, the "new Password" prompt should not appear at all with that form of the command, so there are two things happening that shouldn't be. Too many unexpected results to speculate without further information...

Sep 3, 2007 11:13 PM in response to biovizier

OK: An account with restricted access that is not allowed to change passwords was used in this. Wanting to see if it was still possible to set a password on the account by using Terminal, I used the passwd command. Once I found I could put a password on the account, I wanted to take it off. But the passwd command doesn't do that, so I was stuck with a password I didn't want on a restricted account. Now I don't know remove it from the restricted account.

So I tried what you said, and it gives me an Invalid Path message.
Edit: I'm going too sleep.

Message was edited by: Owen Pragel

Sep 4, 2007 5:44 AM in response to Owen Pragel

Just rename that user's home folder, delete that account, then re-create the account however you did it before. Finally, delete that new home directory and rename the old one back to its original name.

To be on the safe side, use NetInfo manager to find the user's uid and gid values and record them. After you have recreated the account, make sure those values are the same as they were before.

Sep 4, 2007 8:21 AM in response to etresoft

If I recall, the "Parental Controls" only removes access to the checkbox in the "Accounts" pref pane for the managed user. It is pretty lame. I believe it is possible to really prevent someone from changing their password through "NetInfo", by setting password policy options...

I see that you have updated your profile to 10.4.10. I can definitively say that under that version of OS X, if everything is working correctly, entering the above command (with the user short name substituted) should not give an "Invalid Path" error if the user exists (assuming this is a local account on a stand-alone machine), and should not prompt for "New Password" whether the path is valid or not. It might help if you posted the exact command entered and error messages via cut and paste.

Also, the output of these commands might help in the diagnosis if there is something else going on (substitute the user's short name anywhere it says ' username', as before):<pre>

nigrep username .
nicl . -read /users/username</pre>

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Removing a password with Terminal.

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