Create a user with a password under Linux

  

Has been doing the account management system of the Linux server in the lab. At this stage, after receiving the application, I receive the email and manually create it. This is a little troublesome and I plan to completely automate it. After the user applies, I can directly create a user by clicking the approval in the management interface, and send the email to the user at the same time.

The automation is built on a certain basis, firstly, the user is created, and the user is created under linux. Is useradd, you can use passwd to set the password after creation, but if you make it automated, you don't have to manually enter anything. Look carefully and find that there is a -p parameter in useradd to set the password, but the password after p parameter is crypt. , that is, must be ciphertext. The ciphertext can be generated using the openssl command, as follows:


The password is the password, the plaintext password is the above line, create a name Test, the password for "i am a codeformer" users are as follows:

useradd -p "S0dAmthh3vjPQ" test

Of course useradd There are many other parameters, just add it as needed.

This step is over, but more than one server in the lab needs to be managed. Here you can configure ssh to log in directly, and execute the ssh command remotely. You can view the .ssh free login, please check http://blog.csdn.net/dliyuedong/article/details/17792783.

Copyright © Windows knowledge All Rights Reserved