linux-Seventh Lesson Notes-[permissions]

Source: Internet
Author: User

Rights Management

Linux permissions:

R: Read

W: Write

X: Execute

-rw-r--r--1 root root

-File (d stands for directory)

3-bit one set

The first 3 bits represent the owner's permission rwx

Intermediate 3-bit delegate permissions for group RWX

The latter 3 bits represent the rights of other users rwx

R 4 W 2 x 1

Default permissions for new files

0664-----Rw-rw-r--.

Maximum privilege is 0666

Default permissions for new directories

0755----drwx-r-xr-x.

Maximum privilege is 0777

Modify Permissions: chmod

Usage: chmod File/directory

Chmod 664 1.txt

[email protected] ~]# ll 1.txt

-rw-r--r--1 root root 0 14:01 1.txt

[Email protected] ~]# chmod 664 1.txt

[email protected] ~]# ll 1.txt

-rw-rw-r--1 root root 0 14:01 1.txt

Chmod u+r 1.txt (-w/x) owner can be added and reduced

Chmod g+r 1.txt (-w/x) group can be added and reduced

Chmod o+r 1.txt (-w/x) other available plus and minus

Modified genera Group: Chown

Usage: chown [owner: Genus] 1.txt

For example:

[email protected] ~]# ll 1.txt

-rw-rw-r--1 root root 0 14:01 1.txt

[Email protected] ~]# Useradd test

[Email protected] ~]# chown test:test 1.txt

[email protected] ~]# ll 1.txt

-rw-rw-r--1 Test test 0 14:01 1.txt

[Email protected] ~]# chown root 1.txt

[email protected] ~]# ll 1.txt

-rw-rw-r--1 root Test 0 14:01 1.txt

[Email protected] ~]# Chown:root 1.txt

[email protected] ~]# ll 1.txt

-rw-rw-r--1 root root 0 14:01 1.txt

linux-Seventh Lesson Notes-[permissions]

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.