how to reset user's password using command line?

Joined
Dec 26, 2009
Messages
3
Reaction score
0
Points
1
I have Mac OS 10.5, specifically Darwin Kernel Version 9.8.0.

I need to reset a user password at the command line. In other Unix flavors, there is a command usermod for this; I am trying to find the Darwin equivalent of this...if it exists.

I cannot use the System Preferences/Accounts for this because, bizarrely, this user does not appear in that list. The user is the mysql user that got created for the sake of managing MySQL. Somehow, I have managed to get that user created, but no longer have access to the password.

I've searched many other places and forums for this info to no avail; hope I can find good intel here!

TIA,
Rick
 
OP
R
Joined
Dec 26, 2009
Messages
3
Reaction score
0
Points
1
Thanks, but that's not the equivalent command; passwd only works if you are logged in that user. I need to be logged in as root and modify the password for another user on the system.

Anybody else know what I mean? There's a difference between usermod and passwd.
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
No, you're incorrect you can use passwd to modify any users password. You just can't do it as a non-privileged user.


sudo passwd <username>

that will allow you to reset a users password. man passwd should have covered that

btw, since root isn't really an enabled account out of the box.. sudo works. Well, sudo works on any Unix.. there is no need to log on as root, just be allowed to sudo.
 
OP
R
Joined
Dec 26, 2009
Messages
3
Reaction score
0
Points
1
Dysfunction

I appreciate that correction of my understanding of the passwd command. The ability to correct another user's password in that way is not covered in the man page on my version Darwin; here's the Synopsis:

SYNOPSIS
openssl passwd [-crypt] [-1] [-apr1] [-salt string] [-in file] [-stdin] [-noverify] [-quiet]
[-table] {password}

Nonetheless, I tried it on my problematic mysql user account. It took the new password without complaint -- but did not work. When I logged out, and tried to login to my system with username mysql and the new password, the system would not let me in. (Interestingly, it "thought" about the password for a few seconds, then the login window vibrated (wigggled?), the password field in the window went blank, apprarently saying "Password incorrect; try again".

It appears whatever I have done with my mysql installation is more subtle than this simple password correction can correct....

If anyone has any ideas, any comments much appreciated....

--Rick
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top