Tuesday, May 25, 2010

關於hosts.allow和hosts.deny機制

給未來的裕翔

關於hosts.allow和hosts.deny是有個機制存在的

當有個client跟我要求一個TCPWRAPPER控管的服務

它會先比對hosts.allow

有寫進去的就allow, 廢話

如果client不符和裡面寫的!?

就繼續比對hosts.deny

沒被寫進去的話視同allow

寫進去的當然就是deny

如果多個服務想寫在同一行, 以逗號區隔

如果多個網段或IP想寫在同一行, 以空白區隔

還可以用spawn接shell script

ex: sshd: ALL: spawn echo "%c try to login %s" | mail -s warning root

那個echo不需要完整路徑

通常可以用TCPWRAPPER控管的有:

sendmail

vsftpd

xinetd

in.telnetd   這是/etc/xinetd.d/telnet裡面的server設定

portmap

No comments:

Post a Comment