password hashes are (wrongly) stored in /etc/passwd
I just realized than our /etc/passwd file holds the hash of passwords of freshly changed password users.
What I mean is usually the /etc/passwd file holds lines like:
But now I have some users having:
... It's the first time that I see the password in this place. Since 94 I've always been told that "now" passwords where stored in the '/etc/shadow' file, and that's what I've always observed since then.
We checked /etc/login.defs but couldn't find anything pointing us to an explaination.
So does anybody knows how to change this behavior ? (And so set back to the normal 'password shadowing')..
Edit: sorry, it's obvious and doesn't change the problem but I'm running Slack64 13.37 (up to date)...
I had this happen some time ago (like, years).
What I was doing was copying user home directories from another machine and made a mess of it.
If I remember correctly, I was fooling around and added two user accounts to /etc/passwd manually (with vi); i.e., I copy-pasted a line from the file, changed the login name, changed the UID and saved it. I did this manually rather than using passwd as root so there was no entry in /etc/shadow and, when I did use passwd, the hashed password was written into /etc/passwd (and still no entry in /etc/shadow if I remember right.
I think -- think! -- the fix was to remove both lines from /etc/passwd then create them again with passwd; first renaming the home directories to user.bak (because passwd wants to create the home directory). When the /etc/passwd and /etc/shadow entries had been created I simply removed the new home directory and renames the "bak" directory to the proper user name, and did
I seem to remember that I tried manually adding entries to /etc/shadow that didn't help but I can't be sure about that.
And I never did that dumbass thing again -- whatever you did and however you did it may vary, eh?
Hope this helps some.
Many thanx ! I haven't checked yet but it might be that I did the changes myself, that makes a lot of sense :).
I'm impressed how you remember the issue and solution from a problem so improbable !
I'll try to see if I can (pre-)modify the /etc/shadow file myself before overriding the password again with a final 'passwd'...
And that reminds me that on debian or so, you can't modify those files by hand without a warning and you need to use a special "vi-based" script that does all those things safely.
Anyway, I should have use the 'useradd' script, but I wanted "non interactive" user addition.
Really have no idea how you've ended up in this situation but pwck, pwconv commands might help you clean things up (remember to take a backup of your passwd and shadow files though just in case something goes wrong).
Also, you may find the newusers command of interest.
Yeah I knew for the 'useradd' (or 'adduser' I never remember which way it is :) ).
I end up there because I need to know the internals in order to develop tools for easy deployment and team installs... Yeah hacking time... Isn't it one of the reason why Slackware is THE distro of (our) choice ? :)
Actually, there's both useradd and adduser. IIRC, using useradd you can give options for everything from the command line, making it totally scriptable.
They're both installed by the 'shadow' package, BTW.
|All times are GMT -5. The time now is 02:25 PM.|