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.