Linux Learning Notes-permissions and permissions management

Source: Internet
Author: User

Permissions and Permissions Management

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)

# chown USERNAME File,...

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

--reference=/path/to/somefile,... Specify the file or directory as the reference and set the operation's file or directory to the same

Chown username:grpname File,... At the same time change the owner of the file, and the name of the group

Chown USERNAME. GRPNAME file,... At the same time change the owner of the file, and the name of the group


#chgrp GRPNAME file,... Change the file genus Group

-R : Recursively modifies the genus of directories and their internal files

--reference=/path/to/somefile,... Specify the file or directory as the reference and set the operation's file or directory to the same

chmod: Modify permissions for a file


Modify permissions for three categories of users:

chmod MODE File,...

-R: Recursive modification

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


To modify the permissions of a class of users:

U,g,o,a

chmod [u,g,o,a]=mode file,...


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

U,g,o,a

chmod [U,g,o,a]+|-mode file,...


Umask: Masking Code

#:umask 022

$:umask 023


Files: 666-umask

Catalog: 777-umask


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


User's login:

The type of shell that stands in the user's Landing angle:

Log-in Shell:

Log in normally via a terminal

Su-username

Su-l USERNAME

Non-logon shell:

Su USERNAME

Open Command Window under graphics terminal

Shell scripts that are executed automatically

Bash configuration file:

Global configuration:

/etc/profile,/etc/profile.d/*.sh,/ETC/BASHRC


Personal configuration:

~/.bash_profile, ~/.BASHRC


File for Profile class:

Setting Environment Variables

Run a command or script


Files of the BASHRC class:

Setting Local Variables

Defining command aliases

How does the login shell read the configuration file?

/etc/profile-->/etc/profile.d/*.sh--~/.bash_profile-/ETC/BASHRC

How does a non-logon shell read a configuration file?

~/.BASHRC--/ETC/BASHRC-/etc/profile.d/*.sh


BASH: script interpreter






This article is from the "11913800" blog, please be sure to keep this source http://11923800.blog.51cto.com/11913800/1840070

Linux Learning Notes-permissions and permissions management

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.