Some of the relevant users of the server password expired, we need to modify, but there are many machines, with the regular passwd command, the change will be very troublesome. Is there any way to solve this, we can use non-interactive way to modify the user's password.
1 chpasswd Command
[Email protected] ~]# echo "root:123456" |chpasswd
echo "username to set Password: new password" |chpasswd
This method of changing the password, after successful execution, does not have any prompt information
2 passwd command can also implement non-interactive work change password
[[email protected] ~]# echo "123456" |passwd--stdin Root
Change the password for the user root.
PASSWD: All the authentication tokens have been successfully updated.
echo "New password" |paswd--stdin "username required to set a new password"
This method of changing the password, after the successful execution, there will be information prompts.
If more than one machine needs to modify the user's password, the user's password can be modified via SSH command loop.
Linux non-interactive modified user's password