Tuesday, October 29, 2013

Csf tutorial

CSF Advanced Allow/Deny Filters
In /etc/csf.allow and /etc/csf.deny you can add more complex port and ip filters using the following format (you must specify a port AND an IP address):
tcp/udp|in/out|s/d=port|s/d=ip|u=uid
Broken down:
tcp/udp : EITHER tcp OR udp OR icmp protocol
in/out : EITHER incoming OR outgoing connections
s/d=port : EITHER source OR destination port number (or ICMP type)
(use a _ for a port range, e.g. 2000_3000)
s/d=ip : EITHER source OR destination IP address
u/g=UID : EITHER UID or GID of source packet, implies outgoing connections, s/d=IP value is ignored
Note: ICMP filtering uses the “port” for s/d=port to set the ICMP type. Whether you use s or d is not relevant as either simply uses the iptables –icmp-type option. Use “iptables -p icmp -h” for a list of valid ICMP types. Only one type per filter is supported
Examples:
# TCP connections inbound to port 3306 from IP 11.22.33.44
tcp|in|d=3306|s=11.22.33.44
# TCP connections outbound to port 22 on IP 11.22.33.44
tcp|out|d=22|d=11.22.33.44

Related Posts:

  • Các lệnh cơ bản linux 1. Lệnh liên quan đến hệ thống  exit: thoát khỏi cửa sổ dòng lệnh. logout: tương tự exit. reboot: khởi động lại hệ thống. halt: tắt máy. startx: khởi động chế độ xwindows từ cửa sổ terminal. mount: gắn hệ thống tập tin … Read More
  • Kinh nghiệm đánh giá VPS Đối với các webmaster thông thường ban đầu khi triển khai 1 website sẽ mua các gói shared hosting (gói chia sẻ) từ các nhà cung cấp dịch vụ, bởi vì triển khai đơn giản, giá cả rẻ. Tuy nhiên, đến 1 lúc nào đó, khi website có… Read More
  • Tạo Syslog để theo dõi một số tiến trình trong LinuxVới người quản trị hệ thống việc theo dõi log hệ thống luôn là một trong những việc quan trọng nhất. Sau đây tôi xin giới thiệu Syslog, một công cụ ghi log khá phổ biến trên Linux.Syslog là một công cụ nhận biết và ghi lại tấ… Read More
  • Đồng bộ hóa dữ liệu giữa hai Server Ubuntu 11.10 sử dụng UnisonGiới thiệu :Unison là một công cụ đồng bộ hóa tập tin tương tự như  Rsync, nhưng sự khác biệt lớn là nó đồng bộ hóa thay theo kiểu Master-Master, nghĩa là: các tập tin thay đổi trên server1 thì server2  sẽ thay… Read More
  • 20 công cụ theo dõi hệ thống linux#1: top - Process Activity CommandThe top program provides a dynamic real-time view of a running system i.e. actual process activity. By default, it displays the most CPU-intensive tasks running on the server and updates the … Read More