creating password for a shadow file
Hello!
I need to add users to a passwd/shadow file, but these files does not
reside in /etc dir. Thus I can not use the adduser or useradd tool to
add the users, because then they will be added to the /etc/passwd|shadow
file, and my passwd/shadow files are in another directory. These
passwd/shadow files are used by an ftp server. I have managed to create
a passwd file, and wrote the user name and uid, and homedir etc... by
hand. The shadow file's passwords must be encrytped with md5. So I used
the 'htpasswd' program to create a password for the user. I typed:
htpasswd -m shadow.ftp user
The problem is that this program doesn't create a password like the
adduser program used to create, and put to the /etc/shadow file. When I
try to login with 'user' via ftp (using the newly created shadow file),
it says username and/or password was not accepted, so the password
generation didn't work.
'htpasswd -bmn user password' output:
user:$apr1$DlJ9I...$E8VL0rjQKdl1pVgH2q10C.
'adduser user' (with same password as above) output:
user:$1$NR.fOvEF$.hOr7l7msiIfz6sP4l0yS/
As you can see they don't match.
So my question is, that is it possible to create passwords for a shadow
file with a command line tool? Is this htpasswd the right tool for this,
and I just can not use it? Or if this is not possible, then how can I
specify another destination shadow/passwd file for the adduser/useradd
program.
Thanks!
Daniel
--
LeVA
Reply to: