Detailed steps for manually creating users under Linux systems __linux

Source: Internet
Author: User
1. Establish the required group (vi/etc/group) first;
2. Synchronization of/etc/group and/etc/gshadow (GRPCONV);
3. Set up the account of each attribute (VI/ETC/PASSWD);
4. Synchronization of/etc/passwd and/etc/shadow (PWCONV);
5. Establish the password of the account (passwd accountname);
6. Establishment of User home directory (cp-a/etc/skel/home/accountname);

7. Change the properties of the Consumer home directory (Chown-r accountname.group/home/accountname).

Example:

1. Create a group Normalgroup, assuming that 520 of this GID is not being used. and synchronized Gshadow
[Root@linux ~]# Vi/etc/group
# Join the line below on the last line.
normalgroup:x:520:
[Root@linux ~]# Grpconv
[Root@linux ~]# grep ' Normalgroup '/etc/group/etc/gshadow
/etc/group:normalgroup:x:520:
/ETC/GSHADOW:NORMALGROUP:X::
Simple Take care of the group. ^_^
2. Establish Normaluser This account, assuming that UID 700 has not been used.
[Root@linux ~]# vi/etc/passwd
# Join the line below on the last line.
Normaluser:x:700:520::/home/normaluser:/bin/bash
3. Synchronize the password and establish the user's password
[Root@linux ~]# Pwconv
[Root@linux ~]# grep ' Normaluser '/etc/passwd/etc/shadow
/etc/passwd:normaluser:x:700:520::/home/normaluser:/bin/bash
/etc/shadow:normaluser:x:13030:0:99999:7:::
Oh Yes, that's right. It's all set up, but the code's not right.
[Root@linux ~]# passwd Normaluser
Changing password for user normaluser.
New UNIX Password:
Retype new UNIX Password:
Passwd:all authentication tokens updated successfully.
4. Create a user's home directory and revise permissions.
[Root@linux ~]# cp-a/etc/skel/home/normaluser
[Root@linux ~]# chown-r Normaluser:normalgroup/home/normaluser

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.