Linux '--stdin ' ERROR-Bulk Change password

Source: Internet
Author: User
Tags stdin

Virtual machines: VMware virtual machines

System: Linux ubuntu 4.4.0-31-generic #50 ~14.04.1-ubuntu SMP Wed Jul 01:07:32 UTC x86_64 x86_64 x86_64 gnu/linux

See "bird Brother's private food-server set up" when, with the book to hit the command when encountered a problem, batch add users and modify password failed.

The shell command is as follows:

    

The following error occurred while running the script with SH:

  

Both the measured user and the user group have been added successfully, but there was an error in bulk modifying the password and could not be passed.

Find the data to understand that the bulk of the creation of users in general will use the Passwd–stdin parameters, in Debian/ubuntu without this parameter, and I am using the Ubuntu system. The word Ubuntu thinks that using this parameter to bulk change password is not safe, so it is not added to the instruction.

is not in the Ubuntu system can not be batch modification properties, obviously do the system when the problem does not occur.

By looking up I found a directive that would be a good solution to this problem (without regard to security)----"CHPASSWD"

CHPASSWD is a batch update user password command that reads the paired user name and password from the standard input in bulk and uses that information to update an existing set of users in the format--username:password

The middle is separated by a colon, and no spaces appear. Specific syntax operations, you can view the system's internal instructions through man, here only to do simple application.

After knowing the instructions, I made a simple change to the script:

  

Small do test:

  

The user is created successfully and can then log on with a password.

Note: User creation, script writing is under the root user operation, the general user if the operation may involve permissions issues;

This method modifies the password security is not very good, only suitable for individual learning to use;

Linux contact is not deep, may not understand the instructions thoroughly, such as errors and unreasonable places to welcome correct.

Linux '--stdin ' ERROR-Bulk Change 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.