useradd can also add users and does not appear to have any form of prompting built in.
useradd -m -p <encryptedPassword> -s /bin/bash <user>
--create-home: Create user home directory
--password: Specify user password; skip to have it disabled
--shell: Default shell for logon user
Blank will use default login shell specified by the
SHELL variable in
<user> with the login name
<encryptedPassword> with the encrypted password
Generating a hashed password:
There are a lot of crypt3 implementations that can generate a hashed password. The whole thing is your hashed password.
The resulting output format: the hash mechanism (
$6 for sha-512), the random salt (the eight bytes after the second dollar sign
$ASDF1234), remainder is the payload.
The resulting output format: first 2 bytes is your salt, remainder is the payload. The whole thing is your hashed password.
mkpasswd (provided by
openssl passwd -crypt
perl -e "print crypt('password');"
python3 -c 'import crypt; print(crypt.crypt("password"))'