เพื่อไม่ให้ใคร telnet
CASE 1
ในแฟ้ม /etc/hosts.allow
ALL:localhost
in.telnetd:host1.isp.net
in.fingerd:ALL
ในแฟ้ม /etc/hosts.deny
All:All
หมายถึง ยอมให้ใน localhost ทำทุกอย่างได้
หมายถึง ยอมให้ telnet จากเครื่อง host1.isp.net ได้ และใช้ finger จากเครื่องใดก็ได้
หมายถึง ถ้าไม่อนุญาตตาม hosts.allow ก็ให้ปฏิเสธหมด
CASE ของ isinthai.com
ในแฟ้ม /etc/hosts.allow
in.ftpd in.ipop3d in.ipop2d in.imapd:All
ในแฟ้ม /etc/hosts.deny
in.telnetd in.rshd in.rlogind:ALL
# ตอนแรกผมปิด all:all ทำให้ไม่สามารถบริการ pop3 หรือ imap ได้
# จึงต้องเลือกปิด เฉพาะ daemon ที่น่ากลัว
CASE ของ Host ที่ต้องการปิด คือไม่บริการภายนอก
ในแฟ้ม /etc/hosts.allow
All: 202.29.78. EXCEPT 202.29.78.1
ในแฟ้ม /etc/hosts.deny
All:ALL
in.telnetd:All
คำอธิบายเพิ่มเติม
ในแฟ้ม /etc/hosts.deny
in.fingerd:ALL EXCEPT .domain.com หมายถึง ยอมให้ finger หมดยกเว้น จาก domain.com
in.telnetd in.rlogind:host1.x.com .domain.com หมายถึง ไม่ให้ telnet หรือ login จาก host1.x.com และ domain.com
หลังจากแก้ไขแฟ้ม hosts.allow หรือ hosts.deny จะมีผลต่อการอนุญาต หรือปฏิเสธในทันที .. ลองแล้วครับ