User Tools

Site Tools


сервис_portsentry

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
сервис_portsentry [2017/07/05 08:07]
val [Настройка на блокировку с использованием route]
сервис_portsentry [2020/07/23 05:28]
val
Line 1: Line 1:
 ====== Сервис Portsentry ====== ====== Сервис Portsentry ======
  
-!!! Отключить самописный веб сервер !!! +  * [[https://www.opennet.ru/docs/RUS/portsentry/portsentry3.html|Настройка ​portsentry]]
- +
-[[http://www.lissyara.su/articles/freebsd/security/portsentry/]]+
  
 ===== Установка ===== ===== Установка =====
Line 9: Line 7:
 ==== Debian/​Ubuntu ==== ==== Debian/​Ubuntu ====
 <​code>​ <​code>​
-server# apt install portsentry +# apt install portsentry
- +
-server# cd /​etc/​portsentry/ ​+
 </​code>​ </​code>​
  
-==== FreeBSD ​==== +===== Использование в режиме без блокировки =====
-<​code>​ +
-server# pkg install portsentry +
- +
-server# cd /​usr/​local/​etc/​ +
- +
-server# cp portsentry.conf.default portsentry.conf +
- +
-server# cp portsentry.ignore.default portsentry.ignore  +
-</​code>​+
  
-===== Использование в режиме без блокировки =====+Настраивается по умолчанию
  
 <​code>​ <​code>​
-server# cat portsentry.conf+# cat /​etc/​portsentry/​portsentry.conf
 </​code><​code>​ </​code><​code>​
 ... ...
Line 35: Line 22:
 ... ...
 </​code><​code>​ </​code><​code>​
-server# tail -f /​var/​log/​syslog +# tail -f /​var/​log/​syslog
-или +
-server# tail -f /​var/​log/​messages+
 </​code>​ </​code>​
  
-===== Настройка на блокировку с использованием libwrap ​===== +===== Включение блокировки =====
- +
-[[Сервис Tcpwrap#​Конфигурация в режиме "​все разрешено,​ кроме"​]]+
  
 <​code>​ <​code>​
-server:> /etc/hosts.deny +cat /etc/portsentry/portsentry.conf
- +
-server# cat portsentry.conf+
 </​code><​code>​ </​code><​code>​
 ... ...
 BLOCK_UDP="​1"​ BLOCK_UDP="​1"​
 BLOCK_TCP="​1"​ BLOCK_TCP="​1"​
-... 
-KILL_HOSTS_DENY="​ALL:​ $TARGET$"​ 
 ... ...
 </​code>​ </​code>​
  
-===== Настройка на блокировку с использованием route =====+===== Блокировка с использованием route =====
  
-[[Сервисы Gateway и routing#​Управление таблицей маршрутизации]]+  * Включена по умолчанию 
 +  * [[Сервисы Gateway и routing#​Управление таблицей маршрутизации]]
  
 <​code>​ <​code>​
-server# cat portsentry.conf+# cat /​etc/​portsentry/​portsentry.conf
 </​code><​code>​ </​code><​code>​
 ... ...
 +# Newer versions of Linux support the reject flag now. This
 +# is cleaner than the above option.
 KILL_ROUTE=... KILL_ROUTE=...
 ... ...
Line 70: Line 52:
 /sbin/route del -host 192.168.N.M reject /sbin/route del -host 192.168.N.M reject
 </​code>​ </​code>​
 +
 +===== Блокировка с использованием libwrap =====
 +
 +  * Включена по умолчанию
 +  * [[Сервис Tcpwrap#​Конфигурация в режиме "​все разрешено,​ кроме"​]]
 +
 +<​code>​
 +# :> /​etc/​hosts.deny
 +
 +# cat /​etc/​portsentry/​portsentry.conf
 +</​code><​code>​
 +...
 +KILL_HOSTS_DENY="​ALL:​ $TARGET$"​
 +...
 +</​code>​
 +
 ===== Просмотр заблокированных хостов ===== ===== Просмотр заблокированных хостов =====
 <​code>​ <​code>​
-server# cat /​var/​lib/​portsentry/​portsentry.blocked.* +# cat /​var/​lib/​portsentry/​portsentry.blocked.*
-или +
-server# cat /​usr/​local/​etc/​portsentry.blocked.*+
 </​code>​ </​code>​
  
сервис_portsentry.txt · Last modified: 2024/05/04 13:08 by val