Create a user with a password in linux

Source: Internet
Author: User

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

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: 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.