About file permissions under Linux

Source: Internet
Author: User

The LS command plus the-l parameter can see the file permissions

Just like this:

Drwxrwxr-x 2 ASML users 4096 Jul 02:45 desktop

The first d indicates that this is a directory, if "-" is the file, "L" for the link, then the three sets of rwx (read and write run) settings, respectively: The file Attribution User (U) file Attribution Group (g) other users (O), display the letter is open, display horizontal line to reject

2 Don't know what it is yet.

ASML is the attribution user, indicating that the folder is ASML user, and users are the attribution group

4096 is the size, the back does not explain

------------------------------------------------------------

You can use chmod to set file permissions, Chown set file attribution

CHMOD provides both symbolic and numeric operations:

This is a letter operation: Indicates that the other user (O) Setting up desktop has permission to run (x) This is a folder,-R means including its sub-files and subdirectories

Chmod-r O-x desktop/

Digital operations (r=4 w=2 x=1 What permissions you want to add numbers together) this will set the user, group, Other (UGO):

Chmod-r 777 desktop/

--------------

Chown settings:

Single Set User:

Chown-r ASML desktop/

To set up users and groups:

Chown-r asml.users desktop/

-------------------------------------------------------------

Careless overall chmod-r XXX/ Solution:

This is a cup, because I just (July 24, 2017) accidentally killed a bit .... Suddenly feel the sky collapsed, thought hopeless, results actually search to rescue method:

Find a Linux system (as clean as possible), export the permissions of the system, and then import it to this machine.
Execute on a good machine (recommended to root directory)
Getfacl-r/> Linux.chmod.txt
And then upload it to the machine to be repaired through various channels.
Execute (recommended to root directory):
Setfacl--restore=chmods.txt

About file permissions under Linux

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.