Manual addition of users in Linux

Source: Internet
Author: User

Create a user manually in linux, such as feng
 
 
Step 1:
 
Add a row to/etc/group
 
Feng: x: 5000:
 
Name: passwd location: GID: User List of the additional group
 
 
Step 2:
 
Add a row in/etc/passwd
 
Feng: x: 5000: 5000: Test User:/home/feng:/bin/bash
 
Name: passwd location: UID: GID: CECOS (Note): diecloud (Home Directory): shell
 
 
Step 3:
 
Add a row to/etc/shadow
 
Feng: $1 $12345678 $ 0ME5N6oDyoEAwUp7b5UDM/: 15355: 0: 99999: 7 :::
 
Name: encrypted password: time 1: Time 2: time 3: time 4: time 5: time 6: Reserved segment
 
Encrypted password: separated by $. the first $ is followed by 1, indicating that the encryption algorithm is md5, the second $ is followed by the added sail, and the third $ is followed by the added password.
 
Time 1: Number of days from January 1, January 1, 1970 to the last modification
 
Time 2: Minimum Password Validity Period
 
Time 3: Maximum Password Validity Period
 
Time 4: How many days before the password expires
 
Time 5: Number of days after the password expires
 
Time 6: users have been disabled for a long time since January 1, January 1, 1970.
 
# Openssl passwd-1-salt 12345678 enter this command and enter the password as prompted to obtain the md5 value, that is, the content after the third $
 
 
Step 4: Give the user skeleton
 
# Cp-r/etc/skel/home/feng
 
Copy the skeleton to the user
 
# Chown-R feng: feng/home/feng
 
Change the owner and group of the skeleton to user
 
# Chmod-R go =/home/feng
 
Change the owner Group of the skeleton and other user permissions to No permissions.
 
 
Then the feng user is created successfully.
 
 
 
 
This article is from the blog titled "zookeeper ".

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.