Linux configuration file

xiaoxiao2021-03-06  100

What is a system profile?

The kernel itself can also be seen as a "program". Why is the kernel need a configuration file? Nuclear needs to understand the system

The list of users and groups, thereby managing file privileges (ie, determine if the specific user (UNIX_USERS) is

To open a file). Note that these files are not explicitly read by the program, but provided by the system library.

A function is read and is used by the kernel. For example, the program should not be a user's (encrypted) password

Open / etc / passwd file. Instead, the program should call the GetPW () function of the system library. This function is also

System call. Open / etc / passwd files and then find the password of the requested user by the kernel

(Through the system library) is determined.

Most of the configuration files in the Red Hat Linux system are in the / etc directory unless otherwise specified. Profile

In the following categories:

Access file

/etc/host.conf tells the network domain name server how to find the host name. (Usually / etc / hosts, then

Is a name server; can be changed by NetConf)

/ etc / hosts contains a list of known hosts in the local network. If the IP of the system is not dynamically generated,

You can use it. For simple hostname parsing (dot score representation), in requesting DNS or NIS network name

Before the server, / etc / hosts.conf usually tells the resolution first.

/etc/hosts.allow See the Hosts_Access's online help page. At least read by TCPD.

/etc/hosts.deny Please refer to the Hosts_Access's online help page. At least read by TCPD.

Guide and login / logout

/ etc / issue & /etc/issue.net These files are read by MINGETTY (and similar programs) to

Terminal (Issue) or user connected to the Telnet session displays a "welcome" character

string. They include several lines of information about the Red Hat version number, name and kernel ID. They are made from rc.local

use.

/ etc / redhat-release information includes information on the RED HAT version number and name. Used by rc.local

.

/etc/rc.d/rc typically runs at all run levels, levels as parameters. For example, to be graphically (Grap

HICS) Mode (X-Server) boot machine, run the following command: init 5 on the command line: init 5. Running level 5

Represents the system with a graphical mode.

/etc/rc.d/rc.local is informal. You can call 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 The script running from the RC (X represents any number between 1 to 5). These directories

It is a directory of specific "run levels". When the system starts, it recognizes the run level to start, and then call the

All startup scripts existing in a specific directory of running levels. For example, when the system starts, it will usually be behind the boot message.

Show "Entering Run-Level 3" message; this means all of the /etc/rc.d/rc3.d/ directory

The feet will be called.

File system

The kernel provides an interface to display some of its data structures, which may be useful for determining system parameters such as interrupts used, initialized devices and memory statistics. This interface is as a

The independent but virtual file system is provided, called / proc file system. Many system utilities use this article

The value existing in the system to display system statistics. For example, / proc / modules file listing system currently

The module is loaded. The lsmod command reads this information and then displays it in the format that people can understand. Below

The MTAB file specified in the grid reads the / proc / mount file containing the currently installed file system in the same way.

.

/ etc / mtab This will continue to change as the / proc / mount file changes. In other words, the file system is installed

When uninstalled, the change will immediately be reflected in this file.

/ etc / fstab lists the computer current "can install" file system. This is very important because computer boots

The mount -a command will be run, which is responsible for installing the "1" tag with the "1" tag in the second column of the FSTAB.

A file system.

/etc/mtools.conf dos type file system all operations (create directory, copy, formatting, etc.)

Configuration.

System Management

/ etc / group contains valid group names and users included in the specified group. Single users If you do multiple tasks, you can

To exist in multiple groups. For example, if a "user" is a member of the "Project 1" engineering group, it is also

Administrators, then his entry in group files will look like this: user: *: group-id:

Project1

/ etc / nologin If there is / etc / nologin file exists, login (1) will only allow root users to visit

ask. It will display other users to this file and reject its login.

Etc / Passwd See "Man Passwd". It contains some user account information, including passwords (if not

Shadow program is encrypted).

/ etc / rpmrc rpm command configuration. All rpm command line options can be set together in this file, this

When any RPM command is running in the system, all options are available globally.

/ etc / securetty includes the device name, consisting of TTY lines (one name per line, does not include front / dev /

), The root user is allowed here to log in.

/ etc / usertty

/ etc / shadow contains the encrypted user account password information, and can also include password aging information. Field included

Have:

log-in name

Encrypted password

From January 1, 1970 to the last number of days to password

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 password expires before the password

Post-expiration of the account is disabled

From January 1, 1970 to the number of days to be disabled

/ etc / shells contains a list of possible "shells" available for system.

/ etc / motd daily message; use when administrators want to communicate a message to all users of the Linux server.

networking

/etc/gated.conf Gated configuration. Can only be used by the Gated daemon.

/etc/gated.version contains the version number of the GATed daemon.

/ etc / gateway is optionally used by the ROUTED daemon.

/ etc / networks enumerate the network name and network address that can be accessed from the network connected to the machine. Via routing command

use. Allow the use of the network name.

/ etc / protocols enumerate the currently available protocol. See NAG (Network Administrator Guide, Network Admin

iStrators Guide and online help pages.

The C interface is GetProtoent. Never change it. /etc/resolv.conf tells the kernel to query which name service when the program requests "parsing" an IP address

.

/ etc / rpc contains RPC instructions / rules, these instructions / rules can be installed in NFS, remote file system installation

Use it in the like.

/ etc / exports To export the file system (NFS) and the permissions to it.

/ etc / services convert the network service name to the port number / protocol. From inetd, telnet, tcpdump and one

Some other programs are read. There are some C access routines.

/etc/inetd.conf inetd configuration file. See the inetd online help page. Contains each network service

The entry, inetd must be a daemon or other service to control these network services. Note that the service will run,

However, they commented in / etc / services, so even if these services are running in operation. format

for:

/etc/sendmail.cf Mail Program Sendmail configuration file. It is more embarrassing and it is difficult to understand.

/ etc / sysconfig / network pointing out NetWorking = YES or NO. At least it is read by rc.sysinit.

/ etc / sysconfig / network-scripts / if * Red HAT network configuration script.

System command

The system command should be exclusively control the system and let everything work. All like logins (complete console user identity)

Verification phase) or programs such as Bash (providing user and computers) are system commands. Therefore, and

Their related documents are also particularly important. This category has the following documents that make users and administrators interested.

/etc/lilo.conf contains the default boot command line parameters of the system, as well as different images used during startup. You are

This list can be seen when the LILO boot prompt is pressed.

The /etc/logrotate.conf Maintains the log file in the / var / log directory.

/etc/identd.conf identd is a server, which implements T in the manner specified in the RFC 1413 document

CP / IP proposed standard Ident user identity identification protocol. IdentD's operating principle is to find specific TCP / IP

Connect and return the username of the process that has this connection. As a choice, it can also return other information instead of using

Account name. Please refer to the IdentD online help page.

/etc/ld.so.conf "Dynamic Linker" configuration.

/ etc / inittab In the year, this is the first configuration file in UNIX. After opening a UNIX machine

The first program launched is init, which knows what to start, this is due to the existence of inittabs. Run level

Don't change, initTab is read, and then control the startup of the main process.

/ etc / termcap A database contains all possible terminal types and performance of these terminals.

Daemon

The daemon is a program running in non-interactive mode. In general, the daemon task is that there is a network area.

Off: They are waiting to be connected to provide services through the connection. Linux can use from a web server to FTP

Many daemons of the server.

The /etc/syslogd.conf syslogd Profile of the daemon. Syslogd is a daemon, it is responsible

Record (write to disk) Send the message from other programs to the system. This service is especially often made by some daemon.

For use, these daemons do not have additional methods to issue signals that may have problems or send messages to the user.

/etc/httpd.conf web server Apache configuration file. This file is generally not in / ETC. It may be in / usr / local / httpd / conf / or / etc / httpd / conf / or / etc / httpd / conf / or / etc / httpd / conf / or to determine its location, you still

Need to check specific Apache installation information.

/etc/conf.modules or /etc/modules.conf Kerneld configuration file. Interestingly, kene

LD is not a "root" kernel as a daemon. It is actually responsible for "fast" loading additional kernel during need.

Module daemon.

Change the configuration file

When changing the configuration file, if the program is not controlled by the system administrator or kernel, be sure to restart

Use this configuration. Ordinary users usually do not start or stop the permissions of the system program and / or daemon.

Kernel

Changing the configuration files in the kernel will immediately affect the system. For example, change the Passwd file to increase users will immediately

This user becomes available. And there are some kernel tunable parameters in any Linux system / proc / sys directory.

. Only super users can get write access to all of these files; other users only read only access.

The classification of files in this directory is the same as the classification of the Linux kernel source code. Each file in this catalog

On behalf of a kernel data structure, these data structures can be dynamically modified to change system performance.

Note: Before changing any of the values ​​of any file, you should make sure you have a comprehensive understanding of the file to avoid

The system causes non-repairable damage.

/ proc / sys / kernel / directory file

file name

description

The maximum number of THREADS-MAX kernels can run.

Ctrl-Alt-DEL If the value is 1, then the sequence presses these keys to reboot the system.

Sysrq If the value is 1, Alt-SysRQ is an activation state.

OSRELEASE Displays the release version number of the operating system

Ostype displays the type of operating system.

Hostname system hostname.

The DomainName network field, the system is part of the network domain.

ModProbe specifies whether ModProbe should automatically run and load the required modules when startup.

Daemon process and system procedure

The daemon is the program that is always running in the background, and it silently performs its own task. The common daemon has in.

FTPD (FTP server daemon), in.telnetd (telnet server daemon) and syslogd

Quality log record daemon). Some daemons are strictly monitored in the operation, and the configuration file changes

It will automatically reload it. But most daemon does not automatically reload the configuration file. we need to

Taking some way "tell" these daemon configuration files have been changed and should be reloaded. Can

The service command is used to restart the service to achieve this purpose (on the Red Hat Linux system).

For example, if we change the network configuration, we need to issue:

Service Network Restart.

Note: These services are the most common is the scripts existing in the /etc/rc.d/init.d/* directory, when the system is booted

Started by init. So, you can also perform the following operations to restart the service:

/etc/rc.d/init.d/ start | stop | status

Start, STOP and STATUS are input values ​​for these scripts that are used to perform operations.

User program

The user or system program reads its configuration file at each startup. Despite this, keep in mind that some system programs

When the computer is opened, their behavior relies on the content read in the / etc / in the configuration file.

Therefore, the user program will read the default configuration from the / etc / directory when the user program is started. The user can then customize the program by using the RC and. (Point) file, as shown in the following section.

User profile:. (Point) file and RC file

We have seen how it is easy to configure programs. But if some people don't like the way to configure programs in / etc /

what can we do about it? "Ordinary" users do not simply enter / etc and change the configuration file; from the corner of the file system

From the perspective, the owner of the configuration file is root user! This is how most user programs define two profiles.

Reason: The first is "system" level, located in / etc /; another belongs to the user "dedicated", can be in him

Or found in her home directory.

For example, I have installed a very useful WGET utility in my system. / etc / there is a / etc / wget

RC file. In my home directory, there is a file called .wgetrc, which describes my custom configuration (only

In me, this configuration file is loaded when the user runs the wget command). Other users are self

There is also a .wgetrc file in the home directory (/ home / other); of course, only these users run WGE

This file will be read when the T command is read. In other words, the / etc / wgetrc file provides "default" for Wget.

Value, and /Home/xxx/.wgetrc files list "custom items" of a user. What is important is this is just "general

Rules, not all cases. For example, a program like Pine, there is no one in / etc /

What files, it only has a custom configuration file in the user home directory, named .pinerc. Other programs may only

/ etc / default configuration file, and may not allow users to "customize" these configuration files (/ etc directory

Only a few config. File is this case).

Usually used RC and. (Point) files

file name

description

~ / .bash_login Please refer to "Man Bash". If ~ / .bash_profile does not exist, Bash will ~ /.

Bash_login is processed as ~ / .bash_profile.

~ / .bash_logout Please refer to "Man Bash". Log in to the shell reference by the bash when exiting.

~ / .bash_profile is referenced after the Bash login shell reference / etc / profile.

~ / .bash_history list of previously executed commands.

~ / .bashrc Please refer to "Man Bash". BASH non-login interactive shell reference (no other file)

. Non-interactive shells do not quote any files unless the Bash_ENV or ENV is set.

~ / .Emacs is read by EMAC during startup.

~ / .forward

If you include an email address, then all mail sent to the owner will be forwarded to this electricity.

Subphone address.

~ / .fvwmrc ~ / .fvwm2rc FVWM and FVWM2 (Basic X Window Manager) profile.

~ / .hushlogin Please refer to "Man Login". Causes "no prompt" login (no email notification, last login

Information or MOD information).

~ / .mail.rc mail program user initialization file.

~ / .ncftp / NCFTP program directory; contain bookmarks, logs, macros, preferences, and tracking information. See Man

NCFTP. The purpose of NCFTP is to provide a powerful and flexible interface for Internet Standard File Transfer Protocol. It aims to replace the standard FTP program used by the system

.

~ / .profile Please refer to "Man Bash". If ~ / .bash_profile and ~ / .bash_login files are not available

In the case, Bash will be processed as ~ / .bash_profile, and inherited Bourn's SH

Ell is used.

~ / .pinerc pine configuration

~ / .muttrc MUTT configuration

~ / .exrc This file can control the configuration of the VI.

Example: SET AI SM RULER

Writing above this file will allow VI to set up automatic indentation, match parentheses, display line numbers and lines - column these selection

item.

~ / .vimrc default "VIM" profile. Like .exrc.

~ / .gtkrc gnome toolkit (GNOME Toolkit).

~ /. Kderc KDE configuration.

~ / .Netrc FTP default login name and password.

~ / .rhosts is used by R-tools such as RSH, Rlogin, and so on. Because it is easy to pretending host, safe

Sex is very low.

Must be owned by the user (~ / owner) or superuser.

List some hosts, users can access the account from these hosts.

If it is a symbolic link, it is ignored.

~ / .rpmrc See "Man RPM". If the / etc / rpmrc does not exist, it is read by RPM.

~ / .signature message text, will be automatically attached to the end of the message emitted from this account.

~ / .Twmrc TWM (The Window Manager) profile.

~ / .xinitrc starts by x read (not by xinit script). Some programs are usually started.

Example: Exec / USR / SBIN / STARTKDE

If there is the content of this line in this file, this line will be in this line when there is a STARTX command from this account.

Start the "KDE Window Manager".

~ / .xmodmaprc This file is transmitted to the XMODMAP program, and can be named any file (for example ~ /.

XMODMAP and ~ / .Keymap.km).

~ / .xserverrc If xinit can find the x, xinit will use the file as a X server

Row.

~ / News / Sent-Message-IDs Gnus default mail history file.

~ / .Xauthority is read and written by the XDM program to handle permissions. See the X, XDM and Xauth online help

page.

~ / .Xdefaults,

~ / .Xdefaults-hostname is read by the X application during the startup of the host hostname. If you can't find it

To the -hostname file, look for the .xdefaults file.

~ / .Xmodmap points to .xmodmaprc; red Hat has a .xinitrc file using this name.

~ / .XResources is usually transmitted to XRDB to load the name of the X resource database, aim to avoid applications

The program needs to read a very long .xdefaults file. (Some situations have been used ~ / .xr

ES. )

~ / mbox

User's old mail.

转载请注明原文地址:https://www.9cbs.com/read-122967.html

New Post(0)