Linux User and user group knowledge

Source: Internet
Author: User
Tags linux

1)/etc/passwd The meaning of the file field

1th Domain: User name

2nd domain: Password

3rd domain: User ID

4th domain: User group ID (0 indicates belong to root group)

5th field: Comments and text

6th domain: User home directory

7th domain: User shell type

2)/etc/group The meaning of each field of the file

1th Domain: Group name

2nd domain: Group password

3rd domain: Group ID

4th domain: The list of users under this group, NULL to indicate the same user name and group name

3 Create user examples

Useradd–d/home/users–m–g root-g qcfang–s/bin/csh Test

3) Modify User example

Usermod–d/home–s/bin/bash–g Qcfangtest

4) chown Modify the file's owner and group (root operation)

Chown-r Test a.txt– Change the owner of the file A.txt to test

Chown-r test:test a.txt-Change file A.txt's owner is test, group is test;

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.