Create a user with a password in linux

Source: Internet
Author: User
I have been working as an account management system for the linux server in the lab. at this stage, after the user applies, I receive an email and create it manually. this is a little troublesome.

I have been working as an account management system for linux servers in the lab. at this stage, I have received an email and created it manually after applying for it. this is a little troublesome and I plan to make it completely automated. after applying for a user, I click "approve" on the management interface to create a user and send an email to the user.

Automation is based on a certain degree. The first step is to create a user. in linux, the command for creating a user is useradd. after creation, passwd can be used to set the password. However, if automation is enabled, you do not need to enter anything manually. after careful reading, we found that there is a-p parameter under useradd that you can set a password, but the password after the p parameter is encrypted, that is, the password must be ciphertext. you can use the openssl command to generate ciphertext:


The password is circled, and the plaintext password is the above line. create a user named test and the password is "I am a codeformer" as follows:

Useradd-p "S0dAmthh3vjPQ" test

Of course, there are many other parameters in useradd. just add them as needed.

This step is over, but the laboratory more than one server need to manage, here directly configure ssh login-free can be, remote execution of ssh command can. ssh login-free please view http://blog.csdn.net/dliyuedong/article/details/17792783.

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.