亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 2980 | 回復(fù): 3
打印 上一主題 下一主題

[SCO UNIX] TCP TCP Wrappers 在OSR5和UW7下的使用 [復(fù)制鏈接]

論壇徽章:
1
榮譽版主
日期:2011-11-23 16:44:17
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2007-05-25 13:21 |只看該作者 |倒序瀏覽
文檔是前幾天就寫好了的,是寫給用戶的
周五銷售才給用戶,所以前幾天沒發(fā)上了
這個配置對很多兄弟們還時有用的

Configuring TCP Wrappers on UnixWare 7 and OpenServer 5



1.        Tcp Wapper基礎(chǔ)知識介紹
Tcp_Wapper是在 Solaris, HP_UX,SCO UNIX以及 Linux中廣泛流行的免費軟件。它被設(shè)計為一個介于外來服務(wù)請求和系統(tǒng)服務(wù)回應(yīng)的中間處理軟件。最常見的用法是與inetd一起使用。當(dāng)Inetd接收到一個外來服務(wù)請求的時候,并不是直接調(diào)用,而是調(diào)用TCP Wrapper(可執(zhí)行文件tcpd),TCP Wrapper根據(jù)這個所請求的服務(wù)和針對這個服務(wù)所定制的存取控制規(guī)則來判斷對方是否有使用這個服務(wù)的權(quán)限,如果有,TCP Wrapper將該請求按照配置文件定義的規(guī)則轉(zhuǎn)交給相應(yīng)的守護進程去處理同時記錄這個請求動作,然后自己就等待下一個請求的處理。
  TCP Wrapper機制的主要目的在于,來自客戶端的請求只被允許同一個獨立的守護進程(xinetd)直接通信,而它請求的目標(biāo)服務(wù)被TCP Wrapper包裹起來,這樣就提高了系統(tǒng)的安全性和系統(tǒng)管理的方便性。Tcp wrapper隨著應(yīng)用逐漸成為一種標(biāo)準(zhǔn)的Unix安全工具,成為unix守護程序inetd的一個插件。通過Tcp wrapper,管理員可以設(shè)置對inetd提供的各種服務(wù)進行監(jiān)控和過濾,以保證系統(tǒng)的安全性。



2.        Installing TCP Wrappers
UnixWare7.1.1后的版本TCP Wrappers已經(jīng)集成到系統(tǒng)中,不需要單獨安裝,配置即可.
TCP Wrappers on OpenServer 5 systems
a.  獲取 TCP Wrapper package for OpenServer 5 systems from:

        http://ftp.porcupine.org/pub/security/tcp_wrappers_7.6.tar.gz        

b.       因為OSR5下的TCP Wrappers是原程序代碼.故OSR5 系統(tǒng)必須安裝開發(fā)環(huán)境才能完成編譯,安裝步驟不做具體描述了.

c.        拷貝原文件到本地路經(jīng).解壓縮
#gunzip tcp_wrappers_7.6.tar.gz
#tar xvf tcp_wrappers_7.6.tar
編譯源程序
make REAL_DAEMON_DIR=/etc sco-os5

d.        拷貝生成命令到系統(tǒng)/etc目錄
#cp tcpd /etc/tcpd   tcpd是所有internet服務(wù)的主要訪問控制守護進程
#cp tcpdchk /etc/tcpdchk   一個檢查 tcpd wrapper 設(shè)置和提供錯誤信息
#cp tcpdmatch /etc/tcpdmatch   用來預(yù)知 tcp wrapper 如何控制一個服務(wù)的特殊請求
注意:還有其它命令可用,這里不一一列舉.具體可上網(wǎng)查詢.



3.       Configuring TCP Wrappers
(1) On the OpenServer 5 system
   a. 配置inetd網(wǎng)絡(luò)守護進程
     inetd.conf是inetd守護進程的配置文件。inetd.conf文件告訴inetd守護進程監(jiān)聽哪些網(wǎng)絡(luò)端口,為每個端口啟動哪個服務(wù)。如果我們要想將telnet、ftp 交由tcpd管控,需要修改/etc/inetd.conf。
     would be changed to:
     #ftp    stream  tcp     nowait  root    /etc/ftpd       ftpd –a     (修改前)
      ftp    stream  tcp     nowait  root    /etc/tcpd       ftpd –a      (修改后)
      #telnet  stream  tcp     nowait  NOLUID  /etc/telnetd    telnetd     (修改前)
      telnet  stream  tcp     nowait  NOLUID  /etc/tcpd       telnetd     (修改后)
   修改后重新啟動網(wǎng)絡(luò)守護進程。
       kill -HUP $(cat /etc/inetd.pid)
  b.  配置訪問控制
    /etc/hosts.allow    定義計算機允許的訪問
     /etc/hosts.deny     定義指定應(yīng)該拒絕的連接
注意:如果某個系統(tǒng)同時出現(xiàn)在兩個文件里,hosts.allow是優(yōu)先的。另外,如果運行最嚴(yán)格的TCP Wrappers安全,用戶可以在/etc/hosts.deny文件力包含一行“ALL:ALL”,它會禁止所有由TCP Wrappers處理的輸入訪問。然后用戶就可以在/etc/hosts.allow里為特定客戶程序打開服務(wù)程序的端口。
/etc/hosts.allow和/etc/hosts.deny的格式是完全一樣的,當(dāng)然同樣的項目在兩個文件中具有相反的作用。這些項目的基本格式是:
Service-names :client-list [:shell-command]
我們這里只測試管理telnetd和ftpd兩個服務(wù)進程,請看如下兩個文件:
  # vi /etc/hosts.allow
  telnetd:202.96.1.140 202.96.5.129:allow
  ftpd:202.96.5. EXCEPT 202.96.5.140 202.96.5.129:allow
注:telnetd行告訴TCP wrappers接受來自于202.96.5.140和202.96.5.129機器的telnet連接.
     ftpd行告訴TCP wrappers接受來自于202.96.5網(wǎng)段中除202.96.5.140和202.96.5.129之外的所有計算機的FTP連接.
  #vi /etc/hosts.deny
  telnetd:all:deny
  ftpd:all:deny
注:禁止所有telnet、ftp未經(jīng)TCP Wrappers處理的訪問
(2)  On the UnixWare7 system
   a. UW7系統(tǒng)已經(jīng)配置好了TCP Wrappers,我們不需要在配置/etc/inet/inetd.conf.
    b. 配置訪問控制
       /etc/inet/hosts.allow    定義計算機允許的訪問
       /etc/inet/hosts.deny     定義指定應(yīng)該拒絕的連接
     文件格式與OSR5相同
     Service-names :client-list [:shell-command]
     我們這里只測試管理telnetd和ftpd兩個服務(wù)進程,請看如下兩個文件:
       #vi /etc/inet/hosts.allow
        in.telnetd:202.96.5.140 202.96.5.129.allow
        in.ftpd: 202.96.5. EXCEPT 202.96.5.140 202.96.5.129:allow
       #vi /etc/inet/hosts.deny
        in.telnetd:all:deny
        in.ftpd:all:deny
      注:寫法內(nèi)容同OpenServer 5.


4.        Testing TCP Wrapper configurations
  a. On the OpenServer 5 system
   # /etc/tcpdchk -v

Using network configuration file: /etc/inetd.conf

>>> Rule /etc/hosts.allow line 1:

daemons:  telnetd

clients:  202.96.5.140 202.96.5.129

command: allow

access:   granted



>>> Rule /etc/hosts.allow line 2:

daemons:  ftpd

clients:  202.96.5. EXCEPT 202.96.5.140 202.96.5.129

command: allow

access:   granted



>>> Rule /etc/hosts.deny line 1:

daemons:  telnetd

clients:  all

command: deny

access:   denied



>>> Rule /etc/hosts.deny line 2:

daemons:  ftpd

clients:  all

command: deny

access:   denied

# /etc/tcpdmatch telnetd 202.96.5.140

client:   address  202.96.5.140

server:   process  telnetd

matched:  /etc/hosts.allow line 1

command: allow

access:   granted

# /etc/tcpdmatch ftpd 202.96.5.129

client:   address  202.96.5.129

server:   process  ftpd

matched:  /etc/hosts.deny line 2

command: deny

access:   denied   
  
     b. On the UnixWare 7 system
       # /usr/sbin/tcpdchk -v

Using network configuration file: /etc/inet/inetd.conf



>>> Rule /etc/inet/hosts.allow line 46:

daemons:  in.telnetd

clients:  202.96.5.140 202.96.5.129

option:   allow

access:   granted



>>> Rule /etc/inet/hosts.allow line 47:

daemons:  in.ftpd

clients:  202.96.5. EXCEPT 202.96.5.140 202.96.5.129

option:   allow

access:   granted



>>> Rule /etc/inet/hosts.deny line 46:

daemons:  in.telnetd

clients:  all

option:   deny

access:   denied



>>> Rule /etc/inet/hosts.deny line 47:

daemons:  in.ftpd

clients:  all

option:   deny

access:   denied

# /usr/sbin/tcpdmatch in.telnetd 202.96.5.140

client:   address  202.96.5.140

server:   process  in.telnetd

matched:  /etc/inet/hosts.allow line 46

option:   allow

access:   granted



# /usr/sbin/tcpdmatch in.ftpd 202.96.5.129

client:   address  202.96.5.129

server:   process  in.ftpd

matched:  /etc/inet/hosts.deny line 47

option:   deny

access:   denied
         

5.     上面介紹只是TCP Wrapper一些簡單功能,它還提供有許多其它特性。
如果想有更強大的功能可參考TCP Wrappers官方網(wǎng)站。
http://www.cert.org/advisories/CA-1999-01.html


6.    已測試通過的系統(tǒng)

      Openserver 5.0.6   5.0.7

      UnixWare 7.1.1    7.1.4

論壇徽章:
1
榮譽版主
日期:2011-11-23 16:44:17
2 [報告]
發(fā)表于 2007-05-25 13:32 |只看該作者
在OpenServer 6.0 下我也測試了
TCPWrappers也已經(jīng)集成到系統(tǒng)中,直接配置就OK
不過需要先去修改/etc/inetd.conf
讓/etc/tcpd來監(jiān)控各網(wǎng)絡(luò)服務(wù)
#ftp     stream   tcp    nowait     root    /etc/ftpd          ftpd -a   (屏蔽這行)
ftp      stream    tcp    nowait     root   /etc/tcpd       ftpd -a     (用這行)
其它服務(wù)一樣。照著做就OK
/etc/hosts.allow
/etc/hosts.deny
兩個文件位置也沒變,具體寫法參考上邊的文檔吧

論壇徽章:
0
3 [報告]
發(fā)表于 2007-11-13 11:47 |只看該作者

102531

請各位unix愛好者加群號102531,強烈歡迎ChinaUnix各位樓主、精華區(qū)牛人的加入!

論壇徽章:
0
4 [報告]
發(fā)表于 2007-11-13 11:47 |只看該作者

102531

支持樓主,請各位unix愛好者加群號102531,強烈歡迎ChinaUnix各位樓主、精華區(qū)牛人的加入!
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP