經典文檔:Linux網絡服務器配置詳解(3)
發表于:2007-05-26來源:作者:點擊數:
標簽:
第三步:編輯inetd.conf文件(vi /etc/inetd.conf),禁止所有不需要的服務,如:ftp、 telnet、 shell、 login、 exec、talk、ntalk、 imap、 pop-2、pop-3、finger、auth,等等。 如果你覺得某些服務有用,可以不禁止這些服務。但是,把這些服務禁止掉,系
第三步:編輯“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 –HUP inetd)。
[root@deep /root]# killall -HUP inetd
|
第四步:
為了保證“inetd.conf”文件的安全,可以用chattr命令把它設成不可改變。把文件設成不可改變的只要用下面的命令:
[root@deep]# chattr +i /etc/inetd.conf
|
這樣可以避免“inetd.conf”文件的任何改變(意外或是別的原因)。一個有“i”屬性的文件是不能被改動的:不能刪除或重命名,不能創建這個文件的鏈接,不能往這個文件里寫數據。只有系統管理員才能設置和清除這個屬性。如果要改變inetd.conf文件,你必須先清除這個不允許改變的標志:
[root@deep]# chattr -i /etc/inetd.conf
|
但是對于諸如sendmail,named,www等服務,由于它們不象finger,telnet等服務,在請求到來時由inet守護進程啟動相應的進程提供服務,而是在系統啟動時,作為守護進程運行的。
而對于redhat linux,提供了一個linuxconfig命令,可以通過它在圖形界面下交互式地設置是否在啟動時運行相關服務。也可以通過命令來設置是否啟動時啟動某個服務,如:[root@deep]# chkconfig –level 35 named off。
原文轉自:http://www.kjueaiud.com
老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月
|