Linux Kernel super privilege user root

Source: Internet
Author: User

We recommend a very good Linux kernel system with great learning value. Here I will mainly explain the application of the Linux kernel system, including introduction to the knowledge of the Linux kernel system. When using the Linux kernel, if you use ls-la/, you will find that there are many directories under/, such as etc, usr, var, and bin, in these directories, let's look at them and find that there are also many directories or files. The Linux File System looks like a tree structure, so we can call the structure image of the file system a tree structure.

Brief description of the organizational structure of the Linux kernel system;

You can use the tree Command to view the structure of the file system. [root @ localhost ~] # Tree, however, the tree Command has disappeared from Fedora Core 5.0 and is retained in Slackware 10.2. However, Linux kernel systems of other versions should be available;

From the output result of the tree Command, the top part should be/, which we call/as the root of the Linux kernel system, that is, the file system of the Linux operating system. The Linux kernel system entry is/. All directories, files, and devices are under/./is the organizer of the Linux kernel system and the leader of the kernel system. Next we will list the main directories in the tree structure of the Linux kernel system.

Analysis of the organizational structure of the file system;

What can we analyze the organizational structure of a file system? That is, when we see the/usr,/etc ...... /var and other directories are used for specific purposes. No matter which version of Linux has these directories, these directories should be standard. Of course, there will also be some minor differences in each Linux release version, but in general, it is still roughly the same.

In fact, there are few differences between Linux kernel releases. The differences are mainly manifested in the differences between system management tools and software package management methods. In addition, there is no major difference; for example, the rpm ora software package management tool is rpm, And the Slackware is pkgtool or installpkg;

Let's get down to the point. Next we will talk about the organizational structure of the file system. /The Linux kernel system entry is also the directory at the highest level; the commands required by the/bin basic system are located in this directory, which is also required by the minimum system; such as ls, cp, mkdir, and other commands. The functions are similar to those of/usr/bin. files in this directory are executable and can be used by common users. The most basic command required for the basic system is put here.

The files required by/boot Linux kernel and boot system programs, such as vmlinuz initrd. img files, are all in this directory. In general, GRUB or LILO System Boot manager is also located in this directory;/dev device file storage directory, such as sound card, disk ...... the location of the/etc system configuration file, where some server configuration files are also located, such as the user account and password configuration files;

/Home is the default storage directory of the home directory for normal users;/lib library file storage directory/lost + found is in the ext2 or ext3 file system. When the system crashes or the machine shuts down unexpectedly, some file fragments are generated here. When the system is started, The fsck tool checks this and fixes the damaged Linux kernel. Sometimes a system problem occurs. Many files are moved to this directory and may be repaired manually or moved to the original location.

/The mount point of the media plug-and-play storage device is automatically created under this directory. For example, after the USB disk system is automatically mounted, a directory is generated under this directory; after CDROM/DVD is automatically mounted, a directory will also be created in this directory, similar to the cdrom directory. This is available only on the latest release kit, such as Fedora Core 4.0 5.0. See the definition of/etc/fstab;

The/misc/mnt directory is generally used to store the mounted directory of the mounted storage device, such as the cdrom directory. See the definition of/etc/fstab. Sometimes we can enable the system to automatically mount the file system at startup and put the mount point here. It mainly depends on the definition in/etc/fstab. For example, the optical drive can be mounted to/mnt/cdrom.

/Opt indicates the optional meaning. Some software packages will also be installed here, that is, custom software packages. For example, in Fedora Core 5.0, OpenOffice is installed here. Some software packages compiled by ourselves can be installed in this directory. The software installed through the source package can be installed through the./configure -- prefix =/opt/directory.

/Program running in the proc operating system) and kernel information such as cpu, hard disk partition, and memory information) are stored here. The/proc directory is the mounted directory of the file system proc disguised. proc is not a real file system. For its definition, see/etc/fstab.

/Root Linux kernel root's home directory;/sbin stores mostly commands related to system management, and is the place where Super root can execute commands, normal users have no permission to execute commands in this directory, which is similar to/usr/sbin;/usr/X11R6/sbin or/usr/local/sbin; remember, all the contents in sbin can be executed only with the root permission.

/Tmp temporary file directory. Sometimes, when you run a program, a temporary file is generated. /Tmp is used to store temporary files. The/var/tmp directory is similar to this directory. /Usr is the directory where the system stores programs, such as commands and help files. This directory contains many files and directories.

Most of the software packages officially provided by the Linux kernel release are installed here. If a server configuration file is involved, the configuration file will be installed in the/etc directory. The/usr directory contains the/usr/share/fonts directory, the help directory/usr/share/man or/usr/share/doc,

Common users can execute the file directory/usr/bin or/usr/local/bin or/usr/X11R6/bin. The root executable command can be stored in the directory, for example,/usr/sbin or/usr/X11R6/sbin or/usr/local/sbin, And the header file directory of the Program/usr/include.

The content of the/var directory is changed frequently. You can see the name of the Directory, which is abbreviated as vary./var contains/var/log, which is the directory used to store system logs. The/var/www directory defines the directory where the Apache server site is stored;/var/lib is used to store some library files, such as MySQL and the location where the MySQL database is stored;

Let's add some important usage of directories;/etc/init. d. This directory is used to store the scripts started by the System or server in System V mode, which is common in Systems started or initialized in System V mode. For example, Fedora/RedHat;

/Etc/xinit. d if the server runs in xinetd mode, put its script in this directory. Some systems do not have this directory, such as Slackware, and some old versions do not. In Rehat/Fedora, a new version is compared.

/Etc/rc. d is a directory of the Slackware release, where the bsd startup script is stored, such as defining the NIC and enabling the script on the server. /Etc/X11 is the location for storing configuration files related to X-Windows;

For example:
[Root @ localhost ~] #/Etc/init. d/sshd start Note: start the sshd server
[Root @ localhost ~] #/Etc/init. d/sshd stop Note: stop the sshd server
Start sshd: [OK]

The Linux kernel System is a typical sshd server System v startup script. You can run this script to start the sshd server. The/usr/bin directory is the directory of executable programs, and normal users have the permission to execute them. When we install a program from the software package that comes with the system, most of his executable files are stored in this directory. For example, when installing the gaim software package.

A similar directory is/usr/local/bin. Sometimes the file in/usr/bin is a link file of/usr/local/bin; the/usr/sbin directory is also the directory of executable programs, but most of them store commands related to system management. Only the root permission can be executed. Similar directories include/sbin or/usr/local/sbin or/usr/X11R6/sbin;

The/usr/local directory is generally used to store the user's self-compiled and installed software. It is generally installed through the source code package. If the installation directory is not specified, it is usually installed in this directory. This directory contains subdirectories. Let's take a look.

The/usr/lib directory is similar to the/lib directory, which is the storage directory of the library files. the/usr/share system stores the shared items. For example,/usr/share/fonts is the font directory, it is shared by all users. /Usr/share/doc and/usr/share/man help files are also shared;

/Usr/src is the directory of the linux kernel system source code storage, such as the following kernel source code directory, such as linux, linux-2.xxx.xx directory. Some systems also install the source code package here. For example, Fedora/Redhat. When we install file. src. rpm, these packages will be installed in the corresponding directory of/usr/src/redhat.

See file. src. rpm for a brief introduction. In addition, for Fedhat 4.0 5.0, the Directory of his kernel source code package is located in a directory under the/usr/src/kernels directory and the corresponding directory is generated only after installation );
/Var/adm, such as the installation information, logs, and management information of the software package, has this directory in the Slackware operating system. It does not seem to exist in Fedora; check it yourself.
/Var/log system log storage. The log analysis depends on the contents in this directory;
/Var/spool printer, email, proxy server, and other offline directories;

  1. Linux Kernel configuration Compilation
  2. The Linux kernel version has become the first reason for my criticism.
  3. Run the Linux kernel and start Fedora.
  4. Linux Kernel compilation and installation of RTAI
  5. Linux Kernel code 75% is developed by staff

Related Article

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.