Permissions changes under Linux and directory configuration

Source: Internet
Author: User

./Represents the meaning of this catalogue.

(1): User and user Group,

1: File owner, file owned by a user

2: User group: Assign one or more user rights to the file configuration

3: Other people:

(2): Linux user identity and user group record files

1:root related information recorded in/etc/passwd

2: Personal password recorded in/etc/shadow

3:linux all group names are recorded in/etc/group

(3): Linux file permissions concept

: Permission deny, no permission prompt

(4): Linux Permissions property------Use Ls–al to view permissions and file

Command View result: drwxrrwxrwx 4 root root 4096 Sep 8 14:06

1:drwxrrwxrwx

First column: If D represents a file as a directory, if-represents a file, if L represents a connection file

If c indicates that there is a file inside a serial port device, such as a keyboard, mouse, if the

b means a device stored in the file that is available for storage

Second-fourth: attribute that represents the owner of the file

V-Seventh: Represents the permissions of the same user group as the file

Seventh-9th: Indicates other rights other than this user group, other

The file has R, W,x property, which is readable, writable, executable, and can be executed in the directory related to whether the directory is accessible

2:4

Represents how many file names are connected to this node, I-node

3:root

Account number on behalf of owner

4:root

The owning user group that represents this file

5:4,096

Represents the size of the file, the default unit is byte (B)

6:SEP 4 18:26

Represents the creation time or the last modified time, month/day time

Changes to file permissions

Command:

CHGRP: Change user group name, CHGRP user group name file. The parameter-r changes the file recursively,

itself and the file changes under the subdirectory.

Chown:chown user file name, parameter-r recursive modification, chown Group name: User name File name

CP copy files and properties and permissions for files

chmod change the permissions of the file, the change is the accumulation of three kinds of permissions, for example, R---4,w---2,x---1

Own 4 +2+1=7

Group 4+2+1=7

Other 4+2+1=7

Command for chmod 777 file name

Use symbols to change file permissions, chmod a+w name, chomod a-w file name

Chomod U=RW,GO=RW and other usage

(5): Types of Linux files

Plain files, plain text files, binary files, data format files, directories, connection files, device files (usually centered on/dev), character device files, sockets (/var/run), pipe files (FIFO attribute P),

(6): Linux file extension name, whether a file can be executed regardless of the extension name,

1:.sh, script live This batch of processing files

2:*.z,*.tar,*tar.gz,*.zip,*.tgz,*.html,*.php,

(7): Limitations on the length of Linux files

The Ext2/ext3 file system is used by default under Linux,

(8): Linux directory configuration standard, FHS '

/bin: Placing general commands and commands that can be executed under a single user

/sbin: Special Permissions command

/boot: includes Linux kernel files and configuration files required for boot

/dev: Any device and interface stored with this file

/etc: Many important configuration files of the system, the ape's account password file, the starting files of various services,

/ETC/INIT.D All Services default startup script drop location.

/home: Place system Default User main folder create account

/lib: System function Library

/media: Place a removable device,

/MNT: Used to temporarily mount some additional equipment

/OPT: Karma Third party Let's see the placed directory. KDE, for example, is easy to place in this directory.

/root: The main folder of the system administrator, if you enter the single user maintenance mode and silently mount the root directory, the directory will be able to have the root of the home folder, so we would like to root the home folder and root directory into the same partition

/sbin: Including the boot, repair, restore the system required commands, some server software programs placed in the/usr/sbin/, the native installation of the software generated by the system execution files, placed in/usr/local/sbin, common commands include fdisk,fsck, Ifconfig,init,mkfs.

/srv: After the start of some network services, the data directory that these services need to access, common services such as WWW.FTP, etc., for example, the Web data required by the WWW service can be placed in the./srv/www

/tmp: This is where the general user or the executing program temporarily holds the file, the important data can not be placed in this directory, FHS even suggest that the data in the TMP is deleted.

/lost+found: This directory is a standard ex2/ex3 file system to produce a directory, when the file system errors when the missing fragments placed in this directory, this directory will usually be at the top of the partition location, add you to install a hard disk in/disk, Then the system will automatically generate a directory like this/disk/lost+found

/proc: This directory itself is a virtual file system, he placed the data are in memory, such as the system kernel, process, external device status and network status, but this directory of the province does not occupy disk space, because its data in memory,

/sys: This directory is very similar to/proc, but also a virtual file system is mainly to record the kernel-related information, including I have now loaded kernel modules and the kernel detects the hardware device information,

The boot process is related to the root directory, because the secondary/etc,/bin,/dev,/lib,/sbin, these five directories cannot be placed in a different partition than the root directory,

Introduction to/usr and/var

---------------------------------/usr-------------------------------------------------------

/USR/X11R6 the directory where important data for the X Windows system is placed

/usr/bin: Place most of the commands, here and/bin different point is that/bin with the boot process.

/usr/include:c/c++ and other program language header files and include files are placed, when we tarball way (*tar.gzd way to install the file will use some of the data inside.

/usr/lib: Contains a variety of application software library, target files, as well as some non-user-used executable files or script files, some software will provide some special commands for the five-fu settings, these commands are not often operated by the system administrator,

/usr/local: The system administrator installs its own downloaded software on the machine, not the distribution default provider,

/usr/sbin: The system commands that are encountered in the normal operation of the system, the most common is the service command of some network server software

/usr/share: Where the shared files are placed, the data placed in this directory is almost no data that can be read by the hardware architecture, because it is almost a text file,

/USR/SRC: The general source code is recommended to be placed in this directory, but the kernel source code is recommended to be placed in the/usr/scr/linux directory.

----------------------------------------------var---------------------------------------------------------------

If/usr is a directory that consumes large hard disk capacity during installation,/var is the directory that will gradually take up the hard drive after the system directory is running, because the/var directory is primarily for files that change in normal form, including cache, login files,

/var/cache: Some of the cache files that are generated during the application's native run

/var/lib/: Some data file square box directory.

/var/lock: Some devices or file resources can only be used once by one application at a time, and if more than one application is used, an error occurs, so you need to lock the file

/var/log: This is the directory where the login file is placed, the more important files such as/var/log/message,/var/log/wtmp, etc.

/var/mail: The directory where personal mailboxes are placed,

/var/run: After some programs or services are started, his PID will be placed in this directory

/var/spool: This directory is usually the data of some queues in a square box, or data that is queued for use by other programs.

For example, the system received a new message will be placed in the/var/spool/mail, but after the user receives the mailbox, the message will be deleted in principle, for example, the system received a new message will be placed.

  • Linux in each file, according to the rights are divided into users, groups and other people three kinds of identities;
  • One of the most useful features of a group is when you develop resources in a team, and each account can have multiple groups of support;
  • Using the file attributes shown in Ls-l, the first field is the file's permissions, a total of 10 bits, the first bit is the file type, the next three is a group of three groups, for users, groups, other people's rights, permissions have r,w,x three kinds;
  • If the file name is preceded by one more. ", the file is" hidden file ";
  • Change file group support available CHGRP, modify the owner of the file available chown, modify the file permissions available chmod
  • There are two methods to modify the chmod, namely the symbolic method and the digital method, and the r,w,x fraction in the digital method is 4,2,1.
  • In terms of files, the performance of the privilege is:
    • R: can read the actual content of this file, such as reading the text file content, etc.;
    • W: can edit, add, or modify the contents of the file (without deleting the file);
    • X: The file has permissions that can be executed by the system.
  • For the directory, the effectiveness of the permission is: to open the directory for anyone to browse, should at least give R and X permission, but W permissions can not be given;
    • R (Read contents in directory)
    • W (Modify contents of directory)
    • X (Access directory)
  • Linux file name is limited to: the maximum allowable file name for a single file or directory is 255 characters; full path name and directory (/) complete file name is 4,096 characters
  • According to FHS's official documents, their main purpose is to allow users to understand that the installed software is usually placed in that directory
  • FHS set out four kinds of directory features: shareable, unshareable, static, variable and other four categories;
  • The three-level main directory defined by FHS is:/,/var,/usr three layer;
  • There are five directories that cannot be placed with the root directory in different partition, such as/etc,/bin,/lib,/dev,/sbin five.

Permissions changes under Linux and directory configuration

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.