Most Linuxes I've seen are configured so that passwd doesn't ask root for the old password:
root@xxx ~# passwd root
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Even if passwd does ask for it, you could try chpasswd, or edit /etc/passwd and /etc/shadow by hand (the password hash is the second field, the long ...
For all the dancing around with read and cat and heredocs, ultimately command substitution will result in $(provide_pw) being replaced by the actual password. It will then be part of the process details.
From man curl, about -u:
On systems where it works, curl will hide the given option argument from process listings.
So, on such systems, and also on ...
The standard documentation from man shadow should be installed on your system. On my Debian system it explains it like this:
Each line of this file contains 9 fields, separated by colons (":"),
in the following order:
It must be a valid account name, which exist on the
Refer to crypt(3) for ...
x is not a hashed password, so its presence disables login by that username
the ! on root has the same effect but it can be removed using usermod.
An empty password column allows log-in with no password, so these filler symbols are needed.