Hi,
I need to create password hash. Reason I need it so I can use it to create user account with one line "useradd" command.
Some thing like this.
#useradd username -p <hash>
What I have found out is
"makepasswd"
is different as it use to be ??
What I found on the Internet makepasswd seems like it has what I need.
Code:
makepasswd(1) UNIX Reference Manual makepasswd(1)
NAME
makepasswd - generate and/or encrypt passwords
SYNOPSIS
makepasswd [ --chars N ] [ --clearfrom file ] [ --count N ] [ --crypt |
--nocrypt | --crypt-md5 ] [ --cryptsalt N ] [ --help ] [ --maxchars N ]
[ --minchars N ] [ --randomseed N ] [ --rerandom N ] [ --repeatpass N ]
[ --string string ] [ --verbose | --noverbose ]
DESCRIPTION
makepasswd generates true random passwords by using the /dev/random
feature of Linux, with the emphasis on security over pronounceability.
It can also encrypt plaintext passwords given on the command line.
OPTIONS
--chars N
Generate passwords with exactly N characters (do not use with
options --minchars and --maxchars).
--clearfrom FILE
Use password from FILE instead of generating passwords.
Requires the --crypt or the --crypt-md5 options; may not be used
with these options: --chars, --maxchars, --minchars, --count,
--string, --nocrypt. Trailing newlines are removed but other
white space is not.
--count N
Produce a total of N passwords (the default is one).
--crypt
Produce encrypted passwords.
--crypt-md5
Produce encrypted passwords using the MD5 digest (hash) algo-
rithm.
<TRIMMED>
But I was only able to find makepasswd from freashmeat.org. Afetr installing it what I have is
Code:
$ makepasswd --help
Usage: makepasswd [option [value]] ...
-c, --chars string of allowed characters (A..Za..z0..9)
-e, --encrypt encryption algorithm {none,des,md5,shmd5} (none)
-l, --length password length
-M, --max password maximum length (8)
-m, --min password minimum length (8)
-n, --number number of passwords to generate (1)
-p, --password password to use
-s, --salt salt to use (random)
-h, --help display this help screen
-V, --version display program version
Its not the same utility.
Any suggestion about,
1-where to find real makepasswd.
2-If not, how do I get password hash exactly the way it looks in "/etc/shadow" file.
Thanks