suse linux主机安全加固,suse linux操作系统安全加固
suse linux操作系統安全加固(服務關閉)Suse Linux 操作系統安裝完成以后,需要安全掃描,把沒有使用的端口關閉,加強操作系統的安全
一、系統默認啟動服務:
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 #
二、臨時關閉服務方法:
1、? ? ? ? 查看服務和端口關聯關系:
比如查看ipp服務的關聯進程:#lsof |grep ipp
2、? ? ? ? 確認服務和端口的關聯關系:
序列? ? ? ? 端口? ? ? ? 服務? ? ? ? 路徑/etc/init.d? ? ? ? 狀態
1)? ? ? ? 22? ? ? ? ssh ? ? ? ? sshd? ? ? ? 保留
2)? ? ? ? 25? ? ? ? smtp? ? ? ? postfix? ? ? ? 關閉
3)? ? ? ? 111? ? ? ? rpc? ? ? ? portmap? ? ? ? 關閉
4)? ? ? ? 427? ? ? ? svrloc? ? ? ? slpd? ? ? ? 關閉
5)? ? ? ? 631? ? ? ? ipp? ? ? ? cupsd? ? ? ? 關閉
3、? ? ? ? 手動關閉方法:
停止smtp:/etc/init.d/postfix stop
停止rpc:/etc/init.d/portmap stop
停止svrloc:/etc/init.d/slpd stop
停止ipp:/etc/init.d/cupsd stop
三、? ? ? ? 永久關閉方法:
手動關閉以后每次系統啟動,服務還會自己啟動,需要從啟動配置文件永久禁止:
使用chkconfig –l命令查看現在系統的自動加載服務:(只截取相關的一部分服務)
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-zmd? ?? ?? ?? ?? ? 0: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
powersaved? ?? ?? ?? ?? ? 0: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 #
關閉方法:
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
備注:永久關閉portmap和nfs有關聯,必須先關閉nfs和nfsboot進程,否則會有如下報錯。
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 #
四、? ? ? ? 掃描系統:
重新啟動系統,掃描系統端口
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主机安全加固,suse linux操作系统安全加固的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Linux安全加固之账号密码安全策略
- 下一篇: linux系统安全加固