Understanding Linux Configuration Files __linux

Source: Internet
Author: User
Understanding Linux Configuration Files

Classification and use

This article describes the configuration files for Linux systems, in multi-user, multitasking environments, where profiles control user rights, system applications, daemons, services, and other administrative tasks. These tasks include managing user accounts, assigning disk quotas, managing e-mail messages and newsgroups, and configuring kernel parameters. This article also classifies profiles in the current Red Hat Linux system based on the usage of the configuration file and the services it affects.

Introduced

Each Linux program is an executable file that contains a list of opcode that the CPU will execute to perform certain operations. For example, the LS command is provided by the/bin/ls file, which contains a list of machine instructions that need to be used when displaying a list of files in the current directory on the screen. Almost every program's behavior can be tailored to your preferences or needs by modifying its configuration file.

There is no standard configuration file format for Linux.

In a word, no. Users who are unfamiliar with Linux (and certainly) will be frustrated because each profile looks like a new challenge to meet. In Linux, each programmer is free to choose his or her preferred profile format. You can choose a lot of formats from the/etc/shells file (which contains a list of shells separated by a newline) to Apache's complex/etc/httpd.conf file.

What is a system configuration file.

The kernel itself can also be viewed as a "program." Why the kernel requires a configuration file. The kernel needs to understand the list of users and groups in the system to manage file permissions (that is, whether a particular user (Unix_users) can open a file based on the permissions). Note that these files are not explicitly read by the program, but are read by a function provided by the system library and used by the kernel. For example, a program that requires a user's (encrypted) password should not open the/etc/passwd file. Instead, the program should call the GETPW () function of the system library. This function is also called a system call. Opening the/etc/passwd file and then finding the password for the requested user is determined by the kernel (through the system library).

Unless otherwise specified, most of the configuration files in the Red Hat Linux system are in the/ETC directory. Configuration files can be roughly grouped into the following categories:



Back to the top of the page


accessing files

/etc/host.conf Tells the network domain name server How to find the host name. (usually/etc/hosts, then the name server; can be changed by netconf)
/etc/hosts Contains a list of known hosts (on the local network). If the system's IP is not dynamically generated, it can be used. For simple host name resolution (dot notation),/etc/hosts.conf usually tells the parser to view this first before requesting a DNS or NIS network name server.
/etc/hosts.allow See the online help page for hosts_access. Read at least by TCPD.
/etc/hosts.deny See the online help page for hosts_access. Read at least by TCPD.



Back to the top of the page

Boot and Logon/logoff

/etc/issue &/etc/issue.net These files are read by Mingetty (and similar programs) and are used to display a "welcome" string to a user connected from a terminal (issue) or through a Telnet session (Issue.net). They include several lines of information declaring the Red Hat version number, name, and kernel ID. They are used by rc.local.
/etc/redhat-release Includes a line of information declaring Red Hat version number and name. Used by rc.local.
/etc/rc.d/rc Typically run at all run levels, and the level is passed as a parameter. For example, to boot a machine in graphical (Graphics) mode (x-server), run the following command at the command line: Init 5. Run Level 5 indicates that the system is booted in graphical mode.
/etc/rc.d/rc.local Informal. Can be invoked from RC, Rc.sysinit, or/etc/inittab.
/etc/rc.d/rc.sysinit is usually the first script for all run levels.
/etc/rc.d/rc/rcx.d Scripts run from RC ( X represents any number between 1 and 5). These directories are directories that are specific to the run level. When the system starts, it recognizes the run level to start, and then calls all the startup scripts that exist in a specific directory at that run level. For example, the system typically displays the message "Entering Run-level 3" After the boot message, which means that all initialization scripts in the/etc/rc.d/rc3.d/directory will be invoked.



Back to the top of the page

File system

The kernel provides an interface to display some of its data structures, which can be useful for determining system parameters such as the use of interrupts, initialized devices, and memory statistics. This interface is provided as an independent but virtual file system, called the/proc file system. Many system utilities use the values that exist in this file system to display system statistics. For example, the/proc/modules file enumerates the modules currently loaded in the system. The Lsmod command reads this information and then displays it in a format that people can read. The mTAB file specified in the following table reads the/proc/mount file containing the currently installed file system in the same way.

/etc/mtab This will change as the/proc/mount file changes. In other words, changes are immediately reflected in the file system when it is installed and uninstalled.
/etc/fstab Enumerates the file systems at which the computer is currently "installable". This is important because when the computer boots, the Mount-a command is run, which is responsible for installing each file system with the "1" tag in the penultimate column of Fstab.
/etc/mtools.conf Configuration of all operations on the DOS type file system (create directory, copy, format, and so on).



Back to the top of the page


System Management

/etc/group Contains valid group names and users that are included in the specified group. A single user can exist in more than one group if they perform multiple tasks. For example, if a user is a member of the Project 1 engineering group and is also an administrator, his entry in the group file looks like this: User: *: Group-id:project1
/etc/nologin If a/etc/nologin file exists, login (1) will only allow root users to access it. It will display the contents of this file to other users and deny them logon.
etc/passwd See "Man passwd". It contains some user account information, including the password (if not encrypted by the shadow program).
/etc/rpmrc RPM command configuration. All RPM command-line options can be set together in this file, so that when any RPM command is running on the system, all options will be applied globally.
/etc/securetty Contains the device name, which consists of a TTY row (one name per line, excluding the previous/dev/), where the root user is allowed to log in.
/etc/usertty
/etc/shadow
Contains the encrypted user account password information and may include the password limitation information. The included fields are: The password after the login is encrypted from January 1, 1970 to the last day of the password change the number of days before the password can be changed the number of days before the password must be changed the number of days before the password expires the password expires account the number of days the user has been disabled from January 1, 1970 to the account number Days that are disabled
/etc/shells Contains a list of possible "shells" available to the system.
/etc/motd Daily message, used when the administrator wants to communicate a message to all users of the Linux server.



Back to the top of the page

Networking

/etc/gated.conf The configuration of the gated. Can only be used by the gated daemon.
/etc/gated.version Contains the version number of the gated daemon.
/etc/gateway Optionally used by the routed daemon.
/etc/networks Lists the network names and network addresses that can be accessed from the network to which the machine is connected. Used by routing commands. Allow network name to be used.
/etc/protocols Enumerates the currently available protocols. See NAG (Network Administrator's Guide, network Administrators Guide), and online help page. The C interface is getprotoent. Must not be changed.
/etc/resolv.conf Tell the kernel which name server should be queried when the program requests "resolve" an IP address.
/etc/rpc Contains RPC directives/rules that can be used in NFS calls, remote file system installations, and so on.
/etc/exports The file system (NFS) to export and the permissions on it.
/etc/services Converts the network service name to the port number/protocol. Read by inetd, Telnet, tcpdump, and some other programs. There are some C access routines.
/etc/inetd.conf The inetd configuration file. See the inetd online help page. Contains entries for each network service, inetd must control daemons or other services for these network services. Note that the services will run, but they will be commented out in/etc/services so that they will not be available even if they are running. Format for:<service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
/etc/sendmail.cf The configuration file for the mail program sendmail. More obscure, difficult to understand.
/etc/sysconfig/network Indicate Networking=yes or No. Read at least by Rc.sysinit.
/etc/sysconfig/network-scripts/if* Red Hat Network configuration script.



Back to the top of the page

System commands

System commands to control the system exclusively and to keep everything working properly. All programs such as login (completing the console user authentication phase) or bash (providing interaction between users and computers) are system commands. Therefore, the documents relating to them are of particular importance. The following files are of interest to users and administrators in this category.

The
/etc/lilo.conf contains the system's default boot command-line arguments, as well as the different mappings used at startup. You can see this list when you press the Tab key at the LILO boot prompt. The
/etc/logrotate.conf maintains the log files in the/var/log directory.
/etc/identd.conf Identd is a server that is implemented in the manner specified in the RFC 1413 document tcp/i P proposed standard IDENT user identification protocol. The Identd operation is to find a specific TCP/IP connection and return the user name of the process that owns the connection. As a selection, it can also return other information, not the user name. See the Identd online help page. The configuration of the
/etc/ld.so.conf dynamic Linker.
/etc/inittab in chronological terms, this is the first configuration file in UNIX. The first program that starts after a UNIX machine is opened is INIT, which knows what to start, due to the presence of Inittab. When the run level changes, Init reads the Inittab and then controls the start of the main process.
/etc/termcap A database that contains all possible terminal types and the performance of these terminals.



Back to the top of the page


Daemon process

A daemon is a program that runs in non-interactive mode. In general, the daemon tasks are related to networking areas: they wait for connections to provide services through a connection. Linux can use many daemons from the WEB server to the FTP server.

/etc/syslogd.conf The configuration file for the syslogd daemon. SYSLOGD is a daemon that is responsible for logging (write to disk) messages sent from other programs to the system. This service is especially used by some daemons, which do not have an alternative way to send a signal that may be problematic or to the user.
/etc/httpd.conf The configuration file for the WEB server Apache. This file is generally not in/etc. It may be in/usr/local/httpd/conf/or/etc/httpd/conf/, but to determine its location, you also need to check for specific Apache installation information.
/etc/conf.modules or/etc/modules.conf The Kerneld configuration file. Interestingly, Kerneld is not "the daemon's" kernel. It is actually a daemon that is responsible for "fast" loading of additional kernel modules when needed.



Back to the top of the page


User Programs

There are countless "user" programs in Linux (and General UNIX). The most common type of user program configuration file is/etc/lynx.cfg. This is the well-known text browser lynx configuration file. With this file, you can define the proxy server, the character set to use, and so on. The following code sample shows a portion of the Lynx.cfg file, and modifying this section of the code can change the proxy server settings for the Linux system. By default, these settings apply to all users running lynx in their own shell, unless a user resets the default profile by specifying--CFG = "Mylynx.cfg". Proxy server settings in the
/etc/lynx.cfg

. H1 Proxy. H2 http_proxy. Https_proxy h2. Ftp_proxy h2. Gopher_proxy H2. News_proxy H2 version Nntp_proxy a nd beyond supports the use of proxy servers, can act as # Firewall gateways and caching servers. They are preferable to the older # gateway servers. Each protocol used by Lynx can is mapped separately using # Protocol_proxy environment (in the variables Users Lynx).
If you have # isn't set them externally, you can set them on run time via this configuration file. # They won't override external settings. The No_proxy variable can be used # to inhibit proxying to selected of the Web (the "* regions)." Note This on # VMS this proxy variables are set as process logicals rather than symbols, to # Preserve lowercasing, and W
Ill outlive the Lynx image. #. Ex-http_proxy:http://proxy3.in.ibm.com:80/ftp_proxy:http://proxy3.in.ibm.com:80/#http_proxy: http:// penguin.in.ibm.com:8080 #ftp_proxy: http://penguin.in.ibm.com:8080/h2 no_proxy # No_proxy variable CAn is a comma-separated list of strings defining # No-proxy zones in the DNS domain name space. If a tail substring of the # Domain-path for a host matches one of these strings, transactions and that # node would not B
E proxied. . ex no_proxy:demiurge.in.ibm.com, Demiurge




<

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.