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
wants to create the home directory). When the /etc/passwd
entries had been created I simply removed the new home directory and renames the "bak" directory to the proper user name, and did
chown -R user.group /home/user
for each user name and all was well that ended.
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.