Linux System configuration Files

Source: Internet
Author: User
Tags nameserver


1,/etc/sysconfig/i18n (language configuration file).

Lang= "ZH_CN. UTF-8 "#中文

Lang= "en_US. UTF-8 "or lang=" "#英文

2./etc/sysconfig/network-scripts/ifcfg-eth0 (eth0 configuration file)


Static:

Device=eth0 #网卡接口名称

hwaddr=00:0c:29:13:5d:74 #网卡设备MAC地址


Type=ethernet #网卡类型

Onboot=yes #系统启动时是否自动加载

Bootproto=static #启用地址协议--static: Static protocol--BOOTP Protocol--DHCP Protocol

ipaddr=192.168.1.11 #网卡IP地址

netmask=255.255.255.0 #网卡网络地址

gateway=192.168.1.1 #网卡网关地址

dns1=10.203.104.41 #网卡DNS地址

broadcast=192.168.1.255 #网卡广播地址


Dynamic:

    DEVICE=eth0     BOOTPROTO=dhcp     TYPE=ethernet     HWADDR=xx:xx:xx:xx:xx:xx (网卡mac地址,不用改)

    ONBOOT=yes(开机自启动)


Nic interface shutdown and activation
# Ifdown Eth0 #关闭网络
# ifup Eth0 #启动网络


Network card status Query
# Service Network Status


Temporary configuration of network card information without rebooting.
# ifconfig eth0 10.1.1.10 netmask 255.0.0.0



View current Routing and gateway Information
# Netstat-r

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6C/2A/wKiom1VA-tSwdKUiAAEUQL_ORsI741.jpg "title=" Picture 1.png "alt=" Wkiom1va-tswdkuiaaeuql_orsi741.jpg "/>


Determine the location of the network port---tool ethtool

(1) Ethtool devname view device information corresponding to the device name Example:ethtool eth0

The last row shows link detected:yes/no

(2) Ethtool-p devname check the device location corresponding to the device name Example:ethtool–p eth0

The LED will blink next to the NIC interface corresponding to the eth0 after carriage return, so you can quickly determine the location of the Eth0 network port. (Press CTRL + C to end the command to stop flashing)


3./etc/sysconfig/network (default gateway and hostname configuration file)

In general, the default is read, etc/sysconfig/network as the default gateway. Do not take effect you first want to check the configuration file content is correct, next you check/etc/sysconfig/networking/devices/ifcfg-eth0 set gateway= ... If it is also set, it will be the default gateway in the Ifcfg-eth0, the network flag is invalid. Indicate Networking=yes or No. Read at least by Rc.sysinit.

This file is used to specify the network configuration information on the server, and here is an example:

Network=yes

Rorward_ipv4=yes

Hostname=server.wuxp.com

gareway=192.168.0.1

Gatewaydev=eth0

Whether the NETWORK=YES/NO network is configured
Forward_ipv4=yes/no whether IP forwarding is turned on
Hostname=Gareway=<address> <address> represents the network gateway
IP Address
Garewaydev=<device> <device> represents the device name of the gateway, such as: eth0


4./etc/resolv.conf (DNS configuration file)

Tells the kernel which name server should be queried when the program requests "resolve" an IP address.

# Generated by NetworkManager
Search cluster.com
NameServer 192.168.0.1
NameServer 8.8.8.8


5,/etc/hosts (local hostname resolution or binding)

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), before requesting a DNS or NIS Network name server,/etc/hosts.conf usually tells the resolver to check here first.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6C/43/wKiom1VCSTiCubEzAADVyNCNIOQ777.jpg "title=" Picture 2.png "alt=" Wkiom1vcsticubezaadvyncnioq777.jpg "/>

6,/boot/grub/grub.conf (Grup configuration file) or/boot/grub/menu.list.

Grub profiles generally refer to the/boot/grub/grub.conf file, which indicates which partition to load from when the system boots, kernel and memory mirroring (RAMDISK) files, The loss of this file will cause the computer to get stuck in the grub configuration interface when it starts. Addressing the loss of the file requires the administrator to remember the basic configuration information for grub.conf, such as:

[Email protected] ~]# cat/etc/grub.conf

default=0 # default loading of the first few systems, starting from 0

timeout=5 # time to stay in the Grub configuration interface at startup

splashimage= (hd0,0)/grub/splash.xpm.gz #Grub The background image

Hiddenmenu # whether to hide the menu

title Red Hat Enterprise Linux Server (2.6.18-8.el5) # the title of the operating system

root (hd0,0) # boot partition of the operating system

kernel/vmlinuz-2.6.18-8.el5 ro root=label=/rhgb quiet # set the loaded kernel

Initrd/initrd-2.6.18-8.el5.img # set the loaded memory disk file

7,/etc/passwd (System user database file)

Typically in Linux systems, the user's key information is stored in the system's/etc/passwd file, and each legal user account of the system corresponds to a row of records in the file. This line of records defines the properties of each user account. In this file, each data segment of the user record for each row is separated by ":", and each aspect of the user's attributes is defined separately. The order and meaning of each field are as follows:


Registration Name: Password: User id: Group ID: User name: Home directory: Command interpreter shell


Note: In the current unix/linux system, the password is no longer stored directly in the passwd file, usually the password field in the passwd file is replaced by an "X", the/etc/shadow as a true password file for saving data including personal passwords. Of course, shadow files cannot be read by ordinary users, only the superuser is entitled to read them.


8,/etc/shadow (store user password)

First field: User name

Second field: User password

Third field: Indicates the last time a password was modified

Fourth field: The number of days between the password two changes, at least the interval required

Fifth field: The expiration date of the password. This field indicates the number of days from the next time the password is changed.

Sixth field: Warning before password expires

Seventh field: Account logoff time.

Eighth field: The lifetime of the account. Not only does the password have a lifetime, but the account also has a period of use

Nineth field: This last field is now a reserved field to be used for subsequent operating system upgrades.

9,/etc/group (Group of database files)

All the information for the Linux user group is stored in the/etc/group file. A user group is a collection of users with a common feature. The user group profile mainly has/etc/group and/etc/gshadow, where/etc/gshadow is the/etc/group encrypted information file. Grouping users is a means of managing and controlling access to users in a Linux system. Each user belongs to a group of users, a group can have multiple users, and a user can belong to a different group. When a user is a member of more than one group at the same time, the primary group that the user belongs to is recorded in the/etc/passwd file, which is the default group to which the login belongs, and the other groups are called additional groups.

All the information for the user group is stored in the/etc/group file. The format of this file is separated by a colon (:) several fields, these fields are as follows:

Group Name: password: Group identification number: List of users in the group


Specific explanations:

Group Name:

The group name is the name of the user group, consisting of letters or numbers. As with logins in/etc/passwd, group names should not be duplicated.

Password:

The password field holds the password word after the user group is encrypted. The user groups in the General Linux system do not have a password, that is, the field is generally empty or *.

Group identification number:

The group identification number is similar to the user identification number and is an integer that is used internally by the system to identify the group. Alias Gid.

List of users in the group:

is a list of all users belonging to this group, separated by commas (,) between different users. This user group may be the user's primary group, or it may be an additional group.


10,/etc/gshadow (the password of the storage group)

/etc/gshadow is a/etc/group encrypted information file, such as user group management password is stored in this file. /etc/gshadow and/etc/group are complementary two files; for large servers, for many users and groups, custom some relational structure more complex permissions model, set user group password is very necessary. For example, we do not want to allow some non-user group members to permanently own the permissions and features of the user group, we can use the password authentication method to let some users temporarily have some user group features, the user group password will be used.

[Email protected] ~]# Cat/etc/gshadow

Root:::root

Bin:::root,bin,daemon

Group Name: Password: Group manager: Group members

Group name : is the name of the user group, consisting of letters or numbers.

Passwords : user group password, this segment can be empty or!, if it is empty or has!, means no password

Group Manager: This field can also be empty, if there are multiple user group managers, with the number of split

Group member: if there are more than one member, divide with the number


11,/etc/profile (System environment).
12,/ETC/BASHRC (System variable).
13,/etc/shells (storage shell).
14,/etc/sudoers (sudo config file).
15,/etc/inittab (set the start level).

16:/etc/fstab (File System Format table).
17:/var/log/(store log directory).
18:/var/spool/at/(the directory where the at time task is stored).
19:/etc/at.deny (Disables time tasks for the user).
20:/etc/at.allow (allows time tasks, for users).
21:/etc/crontab (crontab configuration file).

23:/etc/protocols (protocol).
24:/etc/services (port).
25:/ETC/DHCPD.CONF (DHCP configuration file, default does not exist).
26:/var/lib/dhcp/dhcpd.leases (see which user, use your DHCP server).

27:/etc/named.conf (DNS master configuration file).

28:/etc/httpd/conf/httpd.conf (Apache config file)
29:/etc/mail/(SendMail directory).
30:/etc/aliases (alias configuration file).
31:/etc/samba/smb.conf (SMB configuration file).
32:/ETC/PROFTPD.CONF (FTP configuration file).
33:/etc/squid/squid.conf (Squid configuration file).

34:/etc/secruetty (restrict root user to login terminal directly).
35:/etc/secrrity/access.conf (Restrict login to a user).
36:/etc/nologin (Restrict all users from logging in).
37:/etc/sudoers (Forces the user to enter a password each time using sudo).
38:/etc/security/time.conf (limit user Login system time).

39:/proc/sys/net/ipv4/ip_forward (even if the routing feature is turned on).
40:/etc/sysctl.conf (permanently opens the routing feature).
41:/proc/sys/net/ipv4/icmp_echo_igore_all (whether Ping is allowed).
42:/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts (broadcast ping).

Linux System configuration Files

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.