Hi Greg,
Well, I suppose I wrote the book you are referring to...
Using
useradd -p PASSWORD USER
takes the password hash for PASSWORD hence the use of openssl in:
useadd -p `openssl passwd PASSWORD` USER
openssl password creates the password hash using the original crypt hash
algorithm if no other options are specified. e.g.
$ openssl passwd hello
6hEsTksgRkeiI
With this the first two characters of the output is the salt and the
rest is the password hash. If you want openssl to create the same result
again:
$ openssl passwd -salt "6h" hello
6hEsTksgRkeiI
You can use newer algorithms like MD5 based BSD password algorithm 1:
$ openssl passwd -1 hello
$1$4Mu8Fcs.$eIKgPP7RCYrb3lFZjhADA1
$1 : password algorithm 1
$4Mu8Fcs. : salt
$eIKgPP7RCYrb3lFZjhADA1 : password hash
If you log into the system you have to use the clear password. The
system reads the salt, creates the password hash and compares the results.
:rjs
On 5/14/19 5:34 PM, Greg Wilson-Lindberg wrote:
I'm trying to use the example in "Embedded Linux Systems with the Yocto
Project" to add a user to my Yocto build. In the book the sample code:
useradd -p `openssl passwd ${DEV_PASSWORD}` developer; \
uses openssl to generate the encrypted password string to pass to useradd. I
have never been able to get this to work. When I run the openssl
command on the cmd line I get a different value every time, this seems wrong,
How can the password code compare against it if every encode
produces a different value?
I am getting the user added to the system, the home directory shows up and the
user is in the passwd and group files. I just can't login to the
account.
I've obviously got something confused, any help would be appreciated.
Greg Wilson-Lindberg
--
-----
Rudolf J Streif
CEO/CTO ibeeto
+1.855.442.3396 x700
--
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto