Linux system Configuration and service Management _ No. 03 Chapter User Management

Source: Internet
Author: User

Hello everyone, I am a bully, yesterday because the work of things, forget more, this morning to make up yesterday's article, weekly Saturday Sunday stop more than two days.

1. User/Group Basic concept: ① concept: Users and Groups:
. Every process (running program) on the system runs as a particular user.
. Every file is owned by a particular user.
. Access to files and directories is restricted by user.
. The user associated with a running process determines the files and directories accessible to that process.
② view current logged-on user information:

                                                               ③ view file owner:[[email protected] ~]# ll/home/ DRWX------. 4 Alice Alice 4096 June 2 15:59 Alice drwx------ . 2 root root 16384 June 1 23:09 lost+found drwxr -xr-x 2 root root 4096 June 2 15:33 Tianyun④ view Run process                                                                            Username:user PID%cpu%MEM VSZ RSS TTY STAT START time COMMAND Root 1 0.0 0.0 19360 1536? Ss 13:29 0:00/sbin/init root 2 0.0 0.0 0 0 ? S 13:29 0:00 [Kthreadd] Root 3 0.0 0.0 0 0? S 13:29 0:00 [MigraTION/0] Root 4 0.0 0.0 0 0? S 13:29 0:00 [ksoftirqd/0]

2. User/Group Management: First of all, we are talking about users such as

Then the user group: the user group is divided into basic groups and additional groups
1 Creating a user
#useradd TestA
#useradd TESTB

2 View User Uid/gid
#cat/etc/passwd
testa:x:1000:1000 (uid:gid-Basic Group ID)
testb:x:1001:1001

3 Create a new group with a query group ID of 1002.
#groupadd Groupt
#cat/etc/group
GOUTPT::1002:

4 Please modify the user's base group to 1002 with "Usermod-g".
#usermod-G Groupt TestA

5 Querying user gid, from 1000 to 1002
#cat/etc/passwd
TESTA:X:1000:1002 (uid:gid-Basic Group ID)
testb:x:1001:1001

Additional groups: 1 creating users
#useradd TestA
#useradd TESTB
2 Viewing Group information
#cat/etc/group
TESTA::1001:
TESTB::1002:
3 Join the user to another group.
Syntax-G Append Group group name User name
Usermod-g Testb TestA
4 Viewing the members of additional groups
#cat/etc/group
TESTA::1001:
Testb::1002:testa (user)

Right (understanding): This part of the people understand that you can,

                                **今天的文章就到这里了,感谢大家的支持,在这里给大家道个歉,因为本人感冒,文章内容结构会整理的不太好,请大家多多包容,谢谢大家,明天见。**

Linux system Configuration and service Management-No. 03 Chapter user Management

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.