How to manually create a user

Source: Internet
Author: User

1. Create a group named normalgroup. Assume that the GID 520 is not used! And gshadow Synchronization
[Root @ WWW ~] # Vi/etc/group
# Add the following line to the last line!
Normalgroup: X: 520:
[Root @ WWW ~] # Maid
[Root @ WWW ~] # Grep 'normalgroup'/etc/group/etc/gshadow
/Etc/group: normalgroup: X: 520:
/Etc/gshadow: normalgroup: X ::
# Make sure that the/etc/group and/etc/gshadow groups exist! Get the group done!

2. Create a normaluser account. Assume that uid 700 is not used!
[Root @ WWW ~] # Vi/etc/passwd
# Add the following line to the last line!
Normaluser: X: 700: 520:/home/normaluser:/bin/bash

3. Synchronize the password and create the password for this user.
[Root @ WWW ~] # Pwconv
[Root @ WWW ~] # Grep 'normaluser'/etc/passwd/etc/shadow
/Etc/passwd: normaluser: X: 700: 520:/home/normaluser:/bin/bash
/Etc/shadow: normaluser: X: 14307: 0: 99999: 7 :::
# Check whether/etc/passwd and/etc/shadow contain normaluser information! But the password is not correct ~
[Root @ WWW ~] # 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 modify the permission!
[Root @ WWW ~] # Cp-A/etc/skel/home/normaluser
[Root @ WWW ~] # Chown-r normaluser: normalgroup/home/normaluser
[Root @ WWW ~] # Chmod 700/home/normaluser # You can skip this step!
 

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.