suse linux作業系統安全強化__linux

來源:互聯網
上載者:User
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 # 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.