Basic Linux Basics Review command Five (users and groups)

Source: Internet
Author: User

1: Users and Groups

Core elements: allocation of resources

User Category:

Administrator: ID number 0

Normal User: ID number

System User: ID number 1-499

User ID =uid; Name resolution

Group Id=gid

[[email protected] vp-tools]# ID
Uid=0 (Root) gid=0 (root) groups=0 (root), 1034 (Avayavpgroup)

Group Category:

Administrators group: 0

System Group: 1-499

User group: Researcher

2: Permissions

    • Linux all files, permissions control is actually the access to the file control.

R

W

X

    • File:

R: View File contents

W: Modify File Contents

X: Start this file as a running program

    • Directory:

R: LS to view the file name in the directory

W: can create files in this directory

X: You can CD to the directory, and LS-L displays the metadata for the catalog file.

[Email protected] vp-tools]# ls-l
Total 92
-r-xr-xr-x 1 root root 3866 Apr addserviceaccounts
3: User Management

    • /ETC/PASSWD: User account information

For example:

Format--account:password:uid:gid:gecos:directory:shell
Account: Password: User id: Group ID: note Information: User home directory: User's default shell (operating system interface)

Example:craft:x:1032:1032::/cpic/craft:/bin/bash

    • /etc/shadow: User password and related account settings

      Format: Username:passwd:lastchg:min:max:warn:inactive:expire:flag

      login : Password: Most recent password change time: Change password minimum interval: password expiration: Password expiration advance warning Time: Inactivity time : Failure time

      Example:craft:$6$1rmc/er7$hhd2rbgzhr3fyk0q6poshif5wnz8.eptr68006idexpejgiajgwixym8j5nkycxphaizfhp7cppjsqzkemg1n .: 16811:0:99999:7:::

  • /etc/group: Account information for the group

    Format: group_name:passwd:GID:user_list

    Example:avayavpgroup:x:1034:root,craft

  • /etc/gshaow: Group information, passwords and users in the group

    格式:groupname:password:admin,admin,...:member,member,...

    User group: User group Password: User Group manager: composition
    Example:avayavpgroup:!::root,craft

    4: Related commands

  • Useradd

    -U: Specify UID

    -G: Specify GID or GroupName

    -G: Specify additional groups

    -C ' comment content ': Comment information

    -D: Specify home directory, if present, prompt

    [Email protected] vp-tools]# Useradd user1
    [Email protected] vp-tools]# tail-1/etc/passwd
    User1:x:1036:1036::/home/user1:/bin/bash

  • Groupadd

    -g:gid

    -R: System Group

[Email protected] vp-tools]# Groupadd test
[Email protected] vp-tools]# tail-1/etc/group
test:x:1037:

    • Modify Password passwd command

      Normal User: passwd

      Administrator: passwd USERNAME

This article is from the "Reminder Flower Rain" blog, please make sure to keep this source http://chenwen.blog.51cto.com/771416/1752042

Basic Linux Basics Review command Five (users and groups)

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.