Important linux configuration files


Main Linux files:
/etc/aliases
This file describes user ID aliases used by sendmail. The file resides in /etc and is formatted as
a series of lines, each alias per line.
Eg:- support: postmaster
This line states that all mails addressed to user 'support' will be send to user 'postmaster' .
/etc/crontab
This file specifies the running times for system wide tasks, not that of individual users. A typical
entry in this file is as follows:
-----------
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
-----------
/etc/fstab
The file fstab contains descriptive information about the various file systems. It is the duty of
the system administrator to properly create and maintain this file. Each filesystem is described on a
separate line; fields on each line are separated by tabs or spaces.
This consists of the
• filesystem device, say a Hard disk partition
• its mount point, say /boot , /home etc.
• the filesystem type, say vfat, ext3, ntfs
• mount options for the fs, such as ro, rw, for a particular user or nouser
• the fsck options, of how often the checks must be done etc.
/etc/group
This holds all the usergroups and the respective group ID (GID).
group_name:x:GID:user1,user2
group_name: It is the name of group. If you run ls -l command, you will see this name printed in the
group field.
x is Password field: Generally password is not used, hence it is empty/blank. It can store encrypted
password. This is useful to implement privileged groups.
Group ID (GID): Each user must be assigned a group ID. You can see this number in your /etc/passwd
file.
Group List: It is a list of user names of users who are members of the group. The user names, must be
separated
/etc/hosts
This file is a simple text file that associates IP addresses with hostnames, one line per IP
address. For each host a single line should be present with the following information:
IP_address canonical_hostname [aliases...]
hosts_access files /etc/hosts.allow & /etc/hosts.deny
A level of fire-walling can be implemented using the two above files for specific services.
In each file, one can specify an IP or HOST that should be allowed access to or denied.
Eg:- Sshd : 192.168.1.56
The above line if added to allow file will grant access to that IP for service ssh, on the other
hand if added to hosts.deny, then that IP will be denied by ssh service.
/etc/inittab
This describes the default runlevel the system will be on at its boot.
The different runlevels are:
0 - halt (Do NOT set initdefault to this)
1 - Single user mode
2 - Multiuser, without NFS (The same as 3, if you do not have networking)
3 - Full multiuser mode
4 - unused
5 - X11
6 - reboot (Do NOT set initdefault to this)
Eg:- id:3:initdefault:
/etc/passwd
This file contains the account information, such as username, password, UID, GID, home
directory, and default shell. All normal users on the system can read this file, however, the passwords
are encrypted, so even though everyone can read the file, it doesn't automatically guarantee access to
the system.
Eg:-
admin:x:508:508::/home/admin:/bin/bash
/etc/shadow
This file stores actual password in encrypted format for user's account with additional properties
related to user password i.e. it stores secure user account information. All fields are separated by a
colon (:) symbol. It contains one entry per line for each user listed in /etc/passwd .
It contains:-
User name : login name
Password: In encrypted format.
Last password change (lastchanged): Days since Jan 1, 1970 that password was last changed
Minimum: The minimum number of days required between password changes
Maximum: The maximum number of days the password is valid
Warn : The number of days before password is to expire that user is warned that his/her password must
be changed
Inactive : The number of days after password expires that account is disabled
Expire : days since Jan 1, 1970 that account is disabled i.e. an absolute date specifying when the login
may no longer be used
/etc/rc.local
This script will be executed after all the other init scripts. You can put your own initialization
stuff in here.
/etc/redhat-release
This file will be there in redhat based systems, and will hold the exact OS that the system is
installed with. Just try 'cat /etc/redhat-release'.
/etc/resolv.conf
It contains information that determines the operational parameters of the DNS resolver. The
DNS resolver allows applications running in the operating system to translate human-friendly domain
names into the numeric IP addresses that are required for access to resources on the local area network
or the Internet. The process of determining IP addresses from domain names is called resolving. The
resolv.conf file typically contains directives with the IP addresses of nameservers available to a host.
Eg:-
nameserver 192.168.1.1
/etc/sysctl.conf
The sysctl command is used to modify kernel parameters at runtime. /etc/sysctl.conf is a text
file containing sysctl values to be read in and set by sysctl at boot time.
sysctl -a ; To view current values.
sysctl -p ; To reload any changes settings.
Eg:- To turn on IP forwarding, one would use the following line:
net.inet.ip.forwarding=1

Comments

Reply to this post

Post a Comment