国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Linux > 正文

Linux網絡服務器配置入門(二)

2020-10-28 18:58:34
字體:
來源:轉載
供稿:網友

* /etc/inetd.conf 文件
眾所周知,作為服務器來說,服務端口開放越多,系統安全穩定性越難以保證。所以提供特定服務的服務器應該盡可能開放提供服務必不可少的端口,而將與服務器服務無關的服務關閉,比如:一臺作為www和ftp服務器的機器,應該只開放80 和25端口,而將其他無關的服務如:finger auth等服務關掉,以減少系統漏洞。

而inetd,也叫作“超級服務器”,就是監視一些網絡請求的守護進程,其根據網絡請求來調用相應的服務進程來處理連接請求。inetd.conf則是inetd的配置文件。inetd.conf文件告訴inetd監聽哪些網絡端口,為每個端口啟動哪個服務。在任何的網絡環境中使用Linux系統,第一件要做的事就是了解一下服務器到底要提供哪些服務。不需要的那些服務應該被禁止掉,最好卸載掉,這樣黑客就少了一些攻擊系統的機會。查看“/etc/inetd.conf”文件,了解一下inetd提供哪些服務。用加上注釋的方法(在一行的開頭加上#號),禁止任何不需要的服務,再給inetd進程發一個SIGHUP信號。

第一步:把文件的許可權限改成600。

[root@deep]# chmod 600 /etc/inetd.conf

第二步:確信文件的所有者是root。

[root@deep]# stat /etc/inetd.conf

第三步:編輯“inetd.conf”文件(vi /etc/inetd.conf),禁止所有不需要的服務,如:ftp、 telnet、 shell、 login、 exec、talk、ntalk、 imap、 pop-2、pop-3、finger、auth,等等。如果你覺得某些服務有用,可以不禁止這些服務。但是,把這些服務禁止掉,系統受攻擊的可能性就會小很多。改變后的“inetd.conf”文件的內容如下面所示:

# To re-read this file after changes, just do a 'killall -HUP inetd'

#

#echo stream tcp nowait root internal

#echo dgram udp wait root internal

#discard stream tcp nowait root internal

#discard dgram udp wait root internal

#daytime stream tcp nowait root internal

#daytime dgram udp wait root internal

#chargen stream tcp nowait root internal

#chargen dgram udp wait root internal

#time stream tcp nowait root internal

#time dgram udp wait root internal

#

# These are standard services.

#

#ftp stream tcp nowait root /usr/sbin/tcpd in.ftpd -l -a

#telnet stream tcp nowait root /usr/sbin/tcpd in.telnetd

#

# Shell, login, exec, comsat and talk are BSD protocols.

#

#shell stream tcp nowait root /usr/sbin/tcpd in.rshd

#login stream tcp nowait root /usr/sbin/tcpd in.rlogind

#exec stream tcp nowait root /usr/sbin/tcpd in.rexecd

#comsat dgram udp wait root /usr/sbin/tcpd in.comsat

#talk dgram udp wait root /usr/sbin/tcpd in.talkd

#ntalk dgram udp wait root /usr/sbin/tcpd in.ntalkd

#dtalk stream tcp wait nobody /usr/sbin/tcpd in.dtalkd

#

# Pop and imap mail services et al

#

#pop-2 stream tcp nowait root /usr/sbin/tcpd ipop2d

#pop-3 stream tcp nowait root /usr/sbin/tcpd ipop3d

#imap stream tcp nowait root /usr/sbin/tcpd imapd

#

# The Internet UUCP service.

#

#uucp stream tcp nowait uucp /usr/sbin/tcpd /usr/lib/uucp/uucico -l

#

# Tftp service is provided primarily for booting. Most sites

# run this only on machines acting as "boot servers." Do not uncomment

# this unless you *need* it.

#

#tftp dgram udp wait root /usr/sbin/tcpd in.tftpd

#bootps dgram udp wait root /usr/sbin/tcpd bootpd

#

# Finger, systat and netstat give out user information which may be

# valuable to potential "system crackers." Many sites choose to disable

# some or all of these services to improve security.

#

#finger stream tcp nowait root /usr/sbin/tcpd in.fingerd

#cfinger stream tcp nowait root /usr/sbin/tcpd in.cfingerd

#systat stream tcp nowait guest /usr/sbin/tcpd /bin/ps -auwwx

#netstat stream tcp nowait guest /usr/sbin/tcpd /bin/netstat -f inet

#

# Authentication

#

#auth stream tcp nowait nobody /usr/sbin/in.identd in.identd -l -e -o

#
# End of inetd.conf

注意:改變了“inetd.conf”文件之后,別忘了給inetd進程發一個SIGHUP信號(killall 主站蜘蛛池模板: 金川县| 丹东市| 钟山县| 汤阴县| 铜梁县| 同江市| 宕昌县| 珠海市| 三都| 马尔康县| 广丰县| 高唐县| 交口县| 台湾省| 余干县| 阳高县| 长垣县| 柞水县| 西平县| 内江市| 卓尼县| 余姚市| 高青县| 望江县| 陕西省| 辛集市| 太和县| 蓬溪县| 广安市| 甘孜| 东辽县| 谷城县| 无棣县| 衡阳市| 镇赉县| 宁明县| 武川县| 临漳县| 宜城市| 东乡县| 丰台区|