學(xué)習(xí)手札:加強(qiáng)Suse Linux操作系統(tǒng)安全
本文向大家介紹Suse Linux,可能好多人還不了解Suse Linux,沒有關(guān)系,看完本文你肯定有不少收獲。下面就來詳解一下所遇到的問題,在Suse Linux操作系統(tǒng)安裝完成以后,需要安全掃描,把沒有使用的端口關(guān)閉,加強(qiáng)操作系統(tǒng)的安全。以下就是其操作步驟:
一、系統(tǒng)默認(rèn)啟動服務(wù):
shelly:/etc/init.d # nmap -P0 127.0.0.1
Starting Nmap 4.00 ( [url]http://www.insecure.org/nmap/[/url] ) at 2007-06-25 15:34 CST
Interesting ports on localhost (127.0.0.1):
(The 1666 ports scanned but not shown below are in state: closed)
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
111/tcp open rpcbind
427/tcp open svrloc
631/tcp open ipp
Nmap finished: 1 IP address (1 host up) scanned in 0.244 seconds
shelly:/etc/init.d #
二、臨時關(guān)閉服務(wù)方法:
1、查看服務(wù)和端口關(guān)聯(lián)關(guān)系:
比如查看ipp服務(wù)的關(guān)聯(lián)進(jìn)程:#lsof |grep ipp
2、確認(rèn)服務(wù)和端口的關(guān)聯(lián)關(guān)系:
序列端口服務(wù)路徑/etc/init.d狀態(tài)
1)22ssh sshd保留
2)25smtppostfix關(guān)閉
3)111rpcportmap關(guān)閉
4)427svrlocslpd關(guān)閉
5)631ippcupsd關(guān)閉
3、手動關(guān)閉方法:
停止smtp:/etc/init.d/postfix stop
停止rpc:/etc/init.d/portmap stop
停止svrloc:/etc/init.d/slpd stop
停止ipp:/etc/init.d/cupsd stop
三、永久關(guān)閉方法:
手動關(guān)閉以后每次系統(tǒng)啟動,服務(wù)還會自己啟動,需要從啟動配置文件永久禁止:
使用chkconfig –l命令查看現(xiàn)在系統(tǒng)的自動加載服務(wù):(只截取相關(guān)的一部分服務(wù))
shelly:/etc/init.d # chkconfig -l |grep on
cron 0:off 1:off 2:on 3:on 4:off 5:on 6:off
cups 0:off 1:off 2:on 3:on 4:off 5:on 6:off
nfs 0:off 1:off 2:off 3:on 4:off 5:on 6:off
nfsboot 0:off 1:off 2:off 3:on 4:off 5:on 6:off
novell-zmd0:off 1:off 2:off 3:on 4:on 5:on 6:off
nscd 0:off 1:off 2:off 3:on 4:off 5:on 6:off
portmap 0:off 1:off 2:off 3:on 4:off 5:on 6:off
postfix 0:off 1:off 2:off 3:on 4:off 5:on 6:off
powersaved0:off 1:off 2:on 3:on 4:off 5:on 6:off
random 0:off 1:off 2:on 3:on 4:off 5:on 6:off
resmgr 0:off 1:off 2:on 3:on 4:off 5:on 6:off
slpd 0:off 1:off 2:off 3:on 4:off 5:on 6:off
shelly:/etc/init.d #
關(guān)閉方法:
shelly:/etc/init.d # chkconfig -s cups off
shelly:/etc/init.d # chkconfig -s nfs off
shelly:/etc/init.d # chkconfig -s nfsboot off
shelly:/etc/init.d # chkconfig -s portmap off
shelly:/etc/init.d # shelly:/etc/init.d # chkconfig -s postfix off
shelly:/etc/init.d # chkconfig -s slpd off
備注:永久關(guān)閉portmap和nfs有關(guān)聯(lián),必須先關(guān)閉nfs和nfsboot進(jìn)程,否則會有如下報(bào)錯。
shelly:/etc/init.d # chkconfig -s portmap off
insserv: Service portmap has to be enabled for service nfs
insserv: Service portmap has to be enabled for service nfsboot
insserv: exiting now!
/sbin/insserv failed, exit code 1
支持停止順序:
shelly:/etc/init.d # chkconfig -s nfs off
shelly:/etc/init.d # chkconfig -s nfsboot off
shelly:/etc/init.d # chkconfig -s portmap off
shelly:/etc/init.d #
四、掃描系統(tǒng):
重新啟動系統(tǒng),掃描系統(tǒng)端口
shelly:/etc/init.d # nmap -P0 127.0.0.1
Starting Nmap 4.00 ( [url]http://www.insecure.org/nmap/[/url] ) at 2007-06-25 16:16 CST
Interesting ports on localhost (127.0.0.1):
(The 1670 ports scanned but not shown below are in state: closed)
PORT STATE SERVICE
22/tcp open ssh
Nmap finished: 1 IP address (1 host up) scanned in 0.213 seconds
shelly:/etc/init.d #
看完本你是否了解了Suse Linux操作系統(tǒng)怎樣加強(qiáng)操作系統(tǒng)的安全,希望本文會對你有所幫助。
【編輯推薦】