...making Linux just a little more fun! |
By AmirAli Lalji |
This article is focused towards Linux newbies providing them with a basic understanding of /etc sub-directory.
Newcomers to Linux, especially those coming from the Windows background, often find files in the /etc directory difficult to understand. In this article I will give a brief explanation of some of these files and their use. But, before we dive into the /etc directory I would like to point out that changes to some of these files can render your system unstable or in some circumstances unbootable. I cannot emphasize this enough that you should make a backup of the file(s) before making any changes.
This file contains the partition configuration to load NFS (Network File Systems). It tells how partitions are mounted and shared with other Linux/UNIX systems.
/etc/ftpusersThis file contains login names of users who are not allowed to login via FTP. It is recommended to add user root in this file for security.
/etc/fstabThis file automatically mounts filesystems which are spread accross multiple drives or seperate partitions. This file is checked when the system boots and filesystems mounted.
/etc/hosts.[allow, deny]You can control access to your network by using these files. You can add hosts to hosts.allow file to which you want to grant access to your network or add hosts to hosts.deny to which you dont.
/etc/inetd.conf or /etc/xinetd.confThe inetd file can be called the father of networking services. This file is responsible for starting services like FTP, TELNET etc. Some Linux distributions come with xinetd.conf which stands for Extended Internet Services Daemon, which provides all the functionnalities and capabilities of inetd but extends them further.
It is advisable to comment services which you do not use.
/etc/inittabThis file describes what takes place or which processes are started at bootup or at different runlevels. Runlevel is defined as a state in which the Linux box is currently in. Linux has 7 runlevels from 0-6.
/etc/motdThis file which stands for "message of the day" is executed and its contents displayed after a successful login.
/etc/passwdThis file contains user information. Whenever a new user is added, an entry is added to this file containing the loginname, password etc. This file is readable by everyone on the system. If the password field contains "x" than encrypted passwords are stored in /etc/shadow file which is only accessible by user root.
/etc/profileWhen a user logs in a number of configuration files are executed, including /etc/profile. This file contains settings and global startup information for bash shell.
/etc/servicesThis file works in conjunction with /etc/inetd.conf or /etc/xinetd.conf files (see above). This file determines which port a service mentioned in inetd.conf is to use, for eg. FTP/21, TELNET/23 etc.
/etc/securettyThis file lists ttys from which root is allowed to login. For security reasons it is recommended to keep just tty1 for root login.
/etc/shellsThis file contains names of all shells installed in the system with their full path names.
I hope you enjoyed this article and hope it helped in understanding the /etc directory. You might find other subdirectories beneath the /etc directory which are application specific for eg. /etc/httpd, /etc/sendmail are for apache and sendmail respectively.
If you have any comments or suggestions, please feel free to email me at aalalji@bcs.org.uk
AmirAli Lalji is a System Administrator/DBA and lives and works in UK
and Portugal.