etc文件夹下面有什么

原作者:AmirAli Lalji, 2005年10月7日


修改 /etc 目录下的文件可能会使系统无法启动,所以提前一定要做好备份。


/etc/exports: 这个文件包含分区配置信息,用于NFS(网络文件系统)的加载。它规定了分区如何挂载,如何与其他Linux/Unix共享分区。

/etc/ftpusers: 这个文件列出的用户不允许通过FTP登录系统。出于安全考虑,建议把 root user 添加进来。

/etc/fstab: 这个文件自动挂载位于不同磁盘或分区的文件系统。操作系统启动和挂载新文件系统时会检查这个文件。

/etc/hosts.[allow, deny]: you can control access to your network by using these files. Adds hosts that you want to grant access to your network to thehosts.allow file; add hosts that you want to deny access to hosts.deny.

/etc/inetd.conf or /etc/xinetd.conf: the inetd file can be called the father of networking services. This file is responsible for starting services such as FTP, telnet and the like. Some Linux distributions come with xinetd.conf, which stands for extended Internet services daemon (守护进程). This file provides all the functionalities and capabilities of inetd but extends them further.

It is advisable to comment out services you do not use.

/etc/inittab: this file describes what takes place or which processes are started at bootup or at differentrunlevels. A runlevel is defined as the state in which the Linux box currently is in. Linux has seven runlevels, from 0-6.

/etc/motd: motd stands for message of the day. This file is executed and its contents displayed after a successful login.

/etc/passwd: this file contains user information. Whenever a new user is added, an entry is added to this file containing the user's login name, password and so on. This file is readable by everyone on the system. If the password field contains "x", then encrypted passwords are stored in /etc/shadow, a file that is accessible only by the root user.

/etc/profile: when a user logs in, a number of configuration files are executed, including /etc/profile. This file contains settings and global startup information for the bash shell.

/etc/services: this 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 example, FTP/21, TELNET/23 and so on.

/etc/securetty: this file lists TTYs from which root is allowed to log in. For security reasons it is recommended to keep only tty1 for root login.

/etc/shells: this file contains the names of all the shells installed on the system, along with their full path names.


I hope you enjoyed this article and hope it helped in your understanding the /etc directory. You might find other subdirectories beneath the /etc directory that are application specific. /etc/httpd and /etc/sendmail, for example, are for Apache and sendmail, respectively.


Copyright © 2003, AmirAli Lalji. Originally published in Linux Gazette issue 94. Copyright © 2003, Specialized Systems Consultants, Inc.

AmirAli Lalji is a system administrator/DBA who lives and works in the UK and Portugal(葡萄牙).


随着Linux的发展,上述目录结构可能会有变动。比如,Ubuntu 6.10及后续版本使用upstart取代 /sbin/init 守护进程,所以就移除了 /etc/inittab 文件。


References

  1. Under /etc: A Simple Guide | Linux Journal
  2. upstart: event-based init daemon
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值