Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the files in the etc directory of the Linux system

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "what files are there in the etc directory of the Linux system". In the daily operation, I believe that many people have doubts about what files are in the etc directory of the Linux system. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "what files are there in the etc directory of the Linux system?" Next, please follow the editor to study!

Let's first take a look at what is generally contained in the etc directory:

/ etc directory

Contains a lot of files. Many network configuration files are also in / etc.

/ etc/rc or/etc/rc.d or/etc/rc*.d

Start, or change the directory of the scripts or scripts that runs at the runtime.

/ etc/passwd

User database, in which the domain gives the user name, real name, home directory, encrypted password and other user information.

/ etc/fdprm

Floppy disk parameter table. Describe different floppy disk formats. Set with setfdprm.

/ etc/fstab

The mount-a command at startup (in / etc/rc or equivalent startup file) automatically lists the file systems of mount. Linux also includes information about the swap area enabled with swapon-a.

/ etc/group

Similar to / etc/passwd, but not the user but the group.

/ etc/inittab

Configuration file for init.

/ etc/issue

Getty output information in front of the login prompt. It usually includes a short description or welcome message of the system. The content is determined by the system administrator.

/ etc/magic

Configuration file for file. Contains descriptions of different file formats, based on which file guesses the file type.

/ etc/motd

Message Of TheDay, automatically output after successful login. The content is determined by the system administrator. It is often used to announce information, such as a warning of a planned shutdown time.

/ etc/mtab

List of currently installed file systems. Initialized by scripts and automatically updated by the mount command. Use when you need a list of currently installed file systems, such as the df command.

/ etc/shadow

The shadow password file on the system where the shadow password software is installed. The shadow password file moves the encrypted password from the / etc/passwd file to / etc/shadow, which is readable only to root. This makes deciphering the password more difficult.

/ etc/login.defs

Configuration file for the login command.

/ etc/printcap

Similar to / etc/termcap, but for printers. The grammar is different.

/ etc/profile, / etc/csh.login, / etc/csh.cshrc

A file executed by Bourne or Cshells at login or startup. This allows the system administrator to establish a global default environment for all users.

/ etc/securetty

Confirm the secure terminal, that is, which terminal allows root to log in. Generally only virtual consoles are listed, so it is impossible (at least difficult) to break into the system through modem or network and get super user privileges.

/ etc/shells

Listing trusted shell.chsh commands allows users to change login shell. Exe within the scope specified in this file. The service process ftpd that provides a machine FTP service checks whether the user shell is listed in the / etc/shells file, and if not, the user will not be allowed to log in.

/ etc/termcap

Terminal performance database. Explain what "escape sequence" control is used by different terminals. Instead of directly outputting escape sequences (which can only work on specific brand terminals) when writing programs, look for the correct sequence of work to be done from / etc/termcap. In this way, most programs can be run on most terminals

In this section, we focus on a user profile in the / etc directory: / etc/passwd.

One row of records in / etc/passwd corresponds to a user, and each row of records is coloned (separated into 7 fields). The format and specific meaning are as follows:

User name: password: user identification number: group identification number: annotative description: home directory: login Shell

1) "user name" is a string that represents the user's account number. It is usually no more than 8 characters long and consists of uppercase and lowercase letters and / or numbers (Linux systems are generally case sensitive). There can be no colons in the login, because colons are delimiters here. For compatibility, it is best not to include a dot character (.) in the login name and not to start with a hyphen (-) and a plus sign (+).

2) password in some systems, encrypted user passwords are stored. Although this field holds only an encrypted string of user passwords, not clear text, this is still a security concern because the / etc/passwd file is readable to all users. Therefore, many Linux systems (such as SVR4) now use shadow technology to store the real encrypted user password in the / etc/shadow file, while only one special character, such as "x" or "*", is stored in the password field of the / etc/passwd file.

3) the "user identification number" is an integer that is used to identify the user within the system. In general, it corresponds to the user name one by one. If several user names have the same user identification number, they will be treated as the same user internally, but they can have different passwords, different home directories, different login Shell, and so on.

Usually the value range of the user identification number is 0-65-535. 0 is the identification number of the super user root, and 1x 99 is reserved by the system. As an administrative account, the identification number of the ordinary user starts from 100. In Linux systems, the limit is 500.

4) the Group Identification number field records the user group to which the user belongs. It corresponds to a record in the / etc/group file.

5) the "annotative description" field records some personal information of the user, such as the user's real name, phone number, address, etc., and this field has no practical use. The format of this field is not uniform in different Linux systems. In many Linux systems, this field holds an arbitrary annotative description text that is used as the output of the finger command.

6) the "home directory", which is the user's starting working directory, is the directory where the user is located after logging in to the system. In most systems, each user's home directory is organized under the same specific directory, and the name of the user's home directory is the user's login name. Each user has read, write, and execute (search) rights to his home directory, and other users' access to this directory is set on a case-by-case basis.

7) after the user logs in, it starts a process, which is responsible for passing the user's operation to the kernel. This process is the command interpreter or a specific program, namely Shell, that the user runs after logging in to the system. Shell is the interface between the user and the Linux system. There are many kinds of Shell for Linux, each of which has its own characteristics. The commonly used ones are sh (Bourne Shell), csh (C Shell), ksh (Korn Shell), tcsh (TENEX/TOPS-20 type C Shell), bash (Bourne Again Shell) and so on. The system administrator can specify a Shell for the user according to the system condition and the user's habit. If Shell is not specified, the system uses sh as the default login Shell, that is, the value of this field is / bin/sh.

The user's login Shell can also be specified as a specific program (this program is not a command interpreter). Taking advantage of this feature, we can restrict the user to run only the specified application, and when the application is finished, the user automatically exits the system. Some Linux systems require that only those programs that are registered in the system appear in this field.

At this point, the study of "what files are there in the etc directory of the Linux system" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report