Linux non-interactive modified user's password

Source: Internet
Author: User
Tags stdin

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.