11, self-study--linux learning progress and Tasks "file System file Permissions"

Source: Internet
Author: User
Tags file permissions

File System file Permissions

File System file Permissions:

     Three types of users:

Master: Owner, U

Genus Group: Group, G

Others: Other, O

All: All,a

Permissions:

R:readable, readable

W:writable, writable

X:excutable, executable

     Rights Management:

File: 

r: You can use the Content view Class command to display its related content
W: You can use the editor to modify its contents
X: You can launch it into a process

Directory:
R: You can use the LS command to view file information for directory contents
W: can create, delete files
X: You can use the Ls-l command to view text information for the contents of the directory, and you can use the CD command to switch the directory to the working directory

The user does not have a bit of permission, then use-placeholder:

 001:--x:1
   010:-w-:2
011:-wx:3
                          100:r--:4
Span style= "font-size:14pt" >                         &NBS P 101:r-x:5
                  &NBS P       110:rw-:6
            &NBS P             111:rwx:7

File system Rights Management commands:

chmod command:

Role: Change file mode bits

           # chmod [OPTION] ... Mode[,mode] ... FILE ...

# Authorize in a Ugoa way

              # chmod [OPTION] ... Octal-mode FILE ...

# permission numbers are numeric patterns: octal numbers from one to four (0-7), with 4 (Read permission) 2 (Write permission) 1 (executable permission)

              # chmod [option]...–reference=rfile FILE ...

# Identity permissions refer to a file modification

(1) # chmod [OPTION] ... Mode[,mode] ... FILE ...

MODE:

Empowerment notation: Direct operation of a class of user's ownership limit rwx;u=,g=,o=,a=

Two types of user permissions are the same: ug=, go=

Different classes have different user rights: u=,g=,o=

Authorization notation: One or more permissions to operate a class of users; u+, u-;g+, g-;o+, o-;a+, A-

Two types of user rights receiving mechanism are the same: ug+, ug-, ...

Different classes have different user rights: u+,g+,o+

(2) # chmod [OPTION] ... Octal-mode FILE ...

Octal-mode: Permission ID

R:4

W:2

X:1
                    Note: You cannot omit the use of digital identity permissions, for example:
This is to change the owner of the file is 6 (rw), the file belongs to the group does not have permissions, but changed to become a group of 6, but the owner and other users do not have permissions

(3) # chmod [option]...–reference=rfile FILE ...

Common options:

-r,–recursive: recursive modification;
–reference=rfile:rfile refers to its permission model;


Chown command: Modify the owner or genus Group

           # Chown [OPTION] ... [OWNER] [: [GROUP]] FILE ...

           # Chown [option]...–reference=rfile FILE ...

            # This is also a reference to the file modification, but the change here is the owner and the group (note: Permissions are not modified here)
Common options:

-r,–recursive: recursive modification;

# Same as chmod use, not too much to introduce here

CHGRP command: Modify the genus Group

           # Chgrp [OPTION] ... GROUP FILE ...

            # Chgrp [option]...–reference=rfile FILE ...


Linux commands related to user groups:

CHSH command: Modify the user's login shell

       # CHSH [option] [username]

-S: Specify Shell

-L: View the list of available shells

CHFN command: Modify user details

        # CHFN [option] [username]

-f,–full-name Name

-o,–office Office Address

-p,–office-phone Office Phone

Finger command: User Information finder

        # Finger [-lmsp] [user ...] [[email protected] ...]

-S: Displays the user's account name, real name, login terminal, idle time, login time and address and telephone number of the user;

PWCK: Used to verify the content format integrity of/etc/passwd and/etc/shadow files

        # Pwck [Options] [passwd [Shadow]

-S: Sort files by User ID/etc/passwd/etc/shadow

-R: Read-only mode Run command

GRPCK: Used to verify the content format integrity of/etc/group/etc/gshadow pieces

       # GRPCK [Options] [Group [shadow]]

-S: Sort files by group ID/etc/group/etc/gshadow

-R: Read-only mode Run command

11, self-study--linux learning progress and Tasks "file System file Permissions"

Related Article

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.