You might want to check the "useradd/usermod" options with the "useradd/usermod 
--help" command. If you want to add a password the flag would be "-p", and this 
argument expects the password to be encrypted. You can generate this encrypted 
password with the command: " openssl passwd -1 <password_to_hash_encrypt> ", 
for example.

Now, I've just noticed that we are referring to the 'root' user, which already 
exists! In this case, you just need to change its password, and you can use the 
'usermod' command with the '-p' flag. Here are the two scenarios:

# Case for adding a new user with password
EXTRA_USERS_PARAMS : append = "\

useradd -m -s /bin /bash -p '<encrypted password>' <new_user>; \
"

# Case for adding a password to an existent user like root
EXTRA_USERS_PARAMS : append = "\
usermod -p '<encrypted password>' root; \
"

Note. Remember to escape characters from the encrypted password. For example, 
if there are any dollars in your string, escape them with the backslash. For 
instance:

- '$7abc.$8'
+ '\$7abc.\$8'

—Daniel
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#63006): https://lists.yoctoproject.org/g/yocto/message/63006
Mute This Topic: https://lists.yoctoproject.org/mt/105736532/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to