Steps to manually add a user

Source: Internet
Author: User
Article Title: Add a user manually. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

To extract the document from laruence, try to add a user without using useradd:

As follows:

Create the required group (vi/etc/group) first)

Create attributes of an account (vi/etc/passwd)

Synchronize passwd and shadow (pwconv)

Create a password for this account (passwd acount)

Create a user's home directory (cp-r/etc/skel/home/account)

6. Change the home Directory attributes (chown-R account. group/home/account)

Create a new group named test and set its GID to 520.

[Root @ test/root] # vi/etc/group

---- Omitted

Test: x: 520: test <= adds a group. The group is named test and the GID is 520.

Create attributes of test

[Root @ test/root] # vi/etc/passwd

---- Omitted

Test: x: 520: 520: testing account:/home/test:/bin/bash <= create attributes

Synchronize/etc/passwd and/etc/shadow

Create a new group named test and set its GID to 520.

[Root @ test/root] # vi/etc/group

---- Omitted

Test: x: 520: test <= adds a group. The group is named test and the GID is 520.

Create attributes of test

[Root @ test/root] # vi/etc/passwd

---- Omitted

Test: x: 520: 520: testing account:/home/test:/bin/bash <= create attributes

Synchronize/etc/passwd and/etc/shadow

[Root @ test/root] # pwconv <= Transfer passwd data to/etc/shadow!

Create Password

[Root @ test/root] # passwd test <= create the user test Password

Changing password for user test

New password:

Retype new password:

Passwd: all authentication tokens updated successfully

Create a home directory and convert the owner of the home directory

[Root @ test/root] # cp-r/etc/skel/home/test

[Root @ test/root] # chown-R test: test/home/test

OK.

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.