Linux commands (eight) Rights Management chown, CHGRP, chmod, umask

Source: Internet
Author: User

Rights Management:
R:
W:
X:

Three types of users:
U: Owner
G: Genus Group
O: Other users

Chown: Change file owner (only administrators can use this command)

-R: Modify the owner of the directory and its internal files

--reference=/path/to/somefile file,... Refer to a file, set the relevant file permissions for the reference file permissions, while changing to the main, belong to the group Chown Username:group file

Chgrp

chmod: Modify permissions for a file

Modify permissions for three categories of users:

-R
--reference=/path/to/somefile file,...

To modify a class of users or some class user rights:

U,g,o,a

chmod u=rwx,g=,o= File

Modify some or some bit permissions for a class of users:

chmod u+x,g-x File

Create a user by changing the file

Nano/etc/group

nano/etc/passwd

Nano/etc/shadow

Cp-r/etc/skel//home/hive/

Chown-r hive:hive/home/hive

Umask: Masking Code

666-umask
777-umask

The file cannot have Execute permission by default, and if the result has Execute permission, it will add 1 to its permission;

umask:023
Files: 666-023=643 + 1
Catalog: 777-023=754

Linux commands (eight) Rights Management chown, CHGRP, chmod, umask

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.