Linux system users, groups, and permissions

Source: Internet
Author: User
Tags md5 encryption user definition file permissions

First, the user

1,/etc/passwd file function: Store all the user's relevant information, the file is also known as the user information database

The specific meaning of each field:

The 1th field (column) records the name of the user (the root user when the user was created).

The 2nd field (column), if x, indicates that the user must use a password when logging on to the Linux system, and if it is blank, the user does not need to provide a password when logging in.

The 3rd field (column) records the UID of this user.

The 4th field (column) records the GID of the group to which the user belongs.

The 5th Field (column) records the comment information about the user (such as full name or mailing address).

The 6th field (column) records the path of the user's home directory.

The 7th field (column) records the first process to be executed after the user logs on.

2,/etc/shadow file function: Store all user's password, each user occupies a row of records, the file is actually the database that holds the user's password.

The specific meaning of each field:

The 1th field (column) is a user name.

The 2nd field (column) is the password, which is a password that has been encrypted by the MD5 encryption algorithm.

3, the function of/etc/group file: Store the information of all the groups in the Linux system, it is actually a database that holds the group information.

The specific meaning of each field:

The 1th field is the name of the group.

The X in the 2nd field indicates that the group must use a password when logging on to the Linux system.

The 3rd field records the GID of this group.

The 4th Field records which group members are in the group.

4./etc/gsdadow file function: Store passwords for all groups in the Linux system

5./etc/userl file function: User home directory

6./var/spool/mail/userl file function: Store user's mailbox

Some common commands: Vim file path: View the current file contents, click A, enter the edit mode, click Exit esc,shift+:, enter Wq, save exit (: wq! Add exclamation point to force save exit)

LS-DL View details of the current directory itself

7. User functions and commands

Useradd Command function: Add a user

function of the Usermod command: Modify the user's account information

Features of the Userdel command: deleting users

Groupadd Command function: Create a new group account

Ii. documents, Groups and permissions

1. View file Permissions command: Ls-l

"-" represents the file, "D" stands for the directory, "R" stands for read (read-only-4), "W" stands for writer (writable-2), "X" stands for execute (executable-1)

2. Modify the File Permissions command

chmod command: Modify permissions--chmod u= g= 0 = file name or chmod u+/-g+/-o+/-file name or chmod 777 file name

Chown command: Modify primary/Group user--chown User: User file name

Chmod-r recursively changes the user's permissions, chown-r recursively changes the primary/group user Chown-r Oldboy:oldboy/home/oldboy

3, the root user definition: The root user is also known as the superuser, it can access any user's account and all files and directories completely unrestricted.

4. The Linux system divides all users in the system into 3 categories:

Class 1th: Owner

Class 2nd: Owning group

Class 3rd: Other users who are not in the same group

5. Detailed File/directory operation rights

R: Represents the Read permission, which is the ability to read the file or the LS command to list the contents of the directory.

W: Represents the Write permission, which is the ability to edit files or create and delete files in a directory.

X: Represents execute permissions, that is, you can execute a program or use the CD command to switch to this directory and use the

Linux system users, groups, and permissions

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.