LPI Linux 認證/TCP 封裝
外觀
權重:1
描述
考生應該能夠配置 tcp 封裝,以僅允許來自特定主機或子網的連線到指定的伺服器。
- 關鍵知識領域
- tcp 封裝配置檔案、工具和實用程式
- (x)inetd 配置檔案、工具和實用程式
- 以下是被使用的檔案、術語和實用程式的部分列表
- /etc/xinetd.conf
- /etc/xinetd.d/*
- /etc/inetd.conf
- tcpd
- /etc/hosts.allow
- /etc/hosts.deny
描述:考生應該能夠配置 tcp 封裝,以僅允許來自特定主機或子網的連線到指定的伺服器。
關鍵檔案、術語和實用程式包括
inetd.conf, tcpd hosts.allow, hosts.deny xinetd
TCP 封裝是一個用於控制對網路服務的訪問的系統。對於每個受 TCP 封裝保護的服務,tcpd 程式都會被使用,並且會參考兩個定義訪問許可權的檔案,按搜尋順序:
/etc/hosts.deny: if a rule here is met, access is denied /etc/hosts.allow: if a rule here is met, access is allowed
規則被構造以匹配所有服務或特定服務。如果在兩個檔案中都沒有匹配項,則授予訪問許可權。
通常在 /etc/hosts.allow 中設定特定規則,並在 /etc/hosts.deny 中提供一個空白拒絕(即拒絕所有內容,除非明確允許)。規則格式為:
[list of services] : [list of hosts]
例如:拒絕所有傳入請求,除了來自本地域的 FTP 請求
/etc/hosts.allow : ftp : LOCAL
/etc/hosts.deny : ALL : ALL