The Rwx__linux of Linux file Rights Management

Source: Internet
Author: User
Tags chmod file permissions

Introduction to a file permission

Linux from the file point of view, the user is divided into owners, groups, other people, three types of users, file permissions are divided into R-readable, W-writable, X-executable three kinds of permissions, and Linux under the new file does not have permission to execute. In Linux, directories and files have different meanings for the rwx permissions they have.

With the Ls-l command, you can view the permissions and owners of the file, others

  


Two modify file Permissions chmod

1. Command format: chmod {u/g/o/a} {+-=} {r/w/x} File/directory name



2. Command format: chmod num File/directory name (r = 4, W = 2, x = 2)



three modify default permissions Umask

1. View New file default permissions: Umask-s

Umask-s the right to create a new directory, the permissions for new files need to be-X because Linux requires no new files to have executable permissions


2. Modify default New file permissions:

If you want to specify a default permission of Rwx Rx R,

First, compute the RWX rx R's Permission mask: 777-754 = 023

Second: Set default permissions Umask 023


Four modifying owners & owning groups

In Linux, a file can have only one owner and one owning group, and you can view the owner and the owning group of the file through the ls-l command. The default owner of the file is the user who created the file, and the default group for the file is the default group for the user who created the file, that is, the group name for the user group ID in/etc/passwd. The owner of the file and the group to which it belongs can only be executed by the root user. When modified, the file owner and the owning group must exist to do so.

1. Modify file Owner: Chown

Command format: Chown username file name

2. Modify the file belongs to group: Chgrp

Command format: CHGRP username file name

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.