Benches macOS

15

Removing a password with Terminal.

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

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).

15 replies

Sign in or join Beachball Help to reply.

  1. 0

    etresoft

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Why do you want to? I'm sure there are several other, better ways of accomplishing what you want, if you tell us.

  2. 0

    Bill Scott

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I don't think you can do it with passwd (the terminal way).

    I was able to do it using System Preferences > Accounts.

    There is also a way to invoke sudo without having to enter a password (edit the suders file).

    There is also a way to have passwordless login via ssh.

    Tell us more if the above isn't what you want.

  3. 0

    Owen Pragel

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I cannot do it with system preferences, accounts. Is there a way with terminal, besides passwd, which doesn't work? If there isn't, thats all I want to know.

  4. 0

    biovizier

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I don't think '
    passwd' will either, but '
    dscl' will allow a blank password to be set.

    I haven't tested it lately, but I also thought it was possible through "System Preferences" > "Accounts", although a user can't set their own password to a blank. If I recall correctly, an "admin" could set someone else's password to a blank.

  5. 0

    Owen Pragel

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Forgive me, I'm not terribly experienced with terminal. How would I use dscl to reset a password? Like: Dscl ? what do I type, thanks in advance.

  6. 0

    biovizier

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    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...

  7. 0

    Owen Pragel

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hi, you are saying what I want, I just don't know how to phrase things very well.

    However, I did what you said and it told me:

    "passwd: Invalid Path"

  8. 0

    biovizier

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hmm, I should clarify - where it says 'username', substitute what is listed as "Short Name" in the "Accounts" pref pane for that user. Also, note that everything is case-sensitive.

  9. 0

    Owen Pragel

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Heh, I'm not
    that stupid.

    I type the command then it says:

    New Password:

    So I hit enter because I want no password.

    Then it says passwd: Invalid Path.

  10. 0

    biovizier

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    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...

  11. 0

    Owen Pragel

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    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

  12. 0

    etresoft

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    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.

  13. 0

    biovizier

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    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>

  14. 0

    Owen Pragel

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Heh.. I was doing something wrong with the command its working now. Problem solved, thanks.

  15. 0

    Um, i guess an alias

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    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