Linux file permissions and attributes

1. Standard permissions rwx

Wherein r is applied to the file, read the file contents; is applied to the directory, the file list can list the directory

Where w is applied to the file, you can write to the file; act on the directory, you can delete or create a new file, directory

Wherein x is applied to the file, the executable file becomes; is applied to the directory, the directory may enter

Octal Description: r = 4 w = 2 x = 1, for the original directory permissions 777 + umask (default 022) = 0755

owner group other three sets of permissions

setuid act on the file, so that the current user can execute the file as the file owner, the directory is invalid

setgid act on the file, so that the current user can perform a file as the file owner, acting on the directory and all subdirectories under the newly created will make the directories, files, etc. This is a group of inherited

stick on file is invalid, acting on the directory, the directory, only the file owner can delete the file itself, even if other users have permission to delete can not be deleted

Common command: chmod chown chgrp

2. Extended permissions acl

In the Linux system, acl need file system support, xfs default acl support, as well as some support, but did not open, you can increase the parameter acl to support the expansion of rights, for more detailed permission settings hang in.

When the file or directory has extended rights, ls -l to see the other group, the +

It should be noted, had set acl file or directory ls -l see three sets of permissions in, owner permissions and consistent standard,, group permissions are permissions acl mask, not group rights; other group permissions with standard permissions.

chmod time, if you change the group permissions actually change the permissions acl mask.

Long with the command: setfacl getfacl

3.linux file system file attributes

Setting attributes for the file, in order to meet some requirements, such as backup, automatically skip the file, not inferior to modify the file, and so only the additional file.

Command: chattr, lsattr

Common attributes: i can not be modified to delete (super user nor), A only additional content files to the end, when d dump backup file skipped, A does not change the access time (STAT file can read three times). . .

 

 

Guess you like

Origin www.cnblogs.com/studying-linux/p/11961196.html