From 53eab68341154e1d7fc78eaa28cf9bddd65e0bfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=A1=D1=83?= =?UTF-8?q?=D0=B3=D0=BE=D0=BD=D1=8F=D0=BA=D0=BE?= Date: Tue, 31 Mar 2026 17:58:11 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20UFW=20=D1=80=D0=B0=D0=B7=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/README.md b/README.md index 25342d9..186da34 100644 --- a/README.md +++ b/README.md @@ -506,9 +506,93 @@ systemctl restart ssh # Настройки UFW +UFW - Ubuntu Firewall + ## Редактирование файла приложения OpenSSH-Server + +**Шаг 1:** Перейти в каталог `/etc/ufw/applications.d/` - тут хранятся файлы политик UFW для приложений +```bash +cd /etc/ufw/applications.d/ +``` +**Шаг 2:** Получить список файлов и катологов в каталоге `/etc/ufw/applications.d/` +```bash +ls -la +``` +
+ Список файлов и катологов в каталоге `/etc/ufw/applications.d/` + +```bash +total 20 +drwxr-xr-x 2 root root 4096 Oct 7 10:05 . +drwxr-xr-x 3 root root 4096 Oct 7 09:51 .. +-rw-r--r-- 1 root root 147 Oct 7 09:57 openssh-server +``` + +
+ +**Шаг 3** Изменить файл конфигурации для OpenSSH-Server +```bash +nano openssh-server +``` +
+ Содержимое файла `/etc/ufw/applications.d/openssh-server` + +```ini +[OpenSSH] +title=Secure shell server, an rshd replacement +description=OpenSSH is a free implementation of the Secure Shell protocol. +ports=22/tcp +``` + +
+ +**Шаг 4** Изменить порт на порт указанный в [Окончательное редактирование конфигурации OpenSSH](#окончательное-редактирование-конфигурации-openssh) - в инструкции - это порт 2222 +```ini +[OpenSSH] +title=Secure shell server, an rshd replacement +description=OpenSSH is a free implementation of the Secure Shell protocol. +ports=2222/tcp +``` +> Сохранить изменения `Ctrl+X` -> `Y` -> `Enter` + ## Создание файла приложения HTTP + +**Шаг 1** Созда файл конфигурации для HTTP +```bash +nano http-server +``` +> Дописать к http слово server через дефис обязательно + +**Шаг 2** Создать инструкцию в файле +```ini +[HTTP] +title=Hyper Text Transport Protocol +description=Hyper Text Transport Protocol +ports=80 +``` + +> Сохранить изменения `Ctrl+X` -> `Y` -> `Enter` + + ## Создание файла приложения HTTPS + +**Шаг 1** Созда файл конфигурации для HTTPS +```bash +nano https-server +``` +> Дописать к https слово server через дефис обязательно + +**Шаг 2** Создать инструкцию в файле +```ini +[HTTPS] +title=Hyper Text Transport Protocol Secure +description=Hyper Text Transport Protocol Secure +ports=443 +``` + +> Сохранить изменения `Ctrl+X` -> `Y` -> `Enter` + + ## Настройка и запуск UFW ## UFW и Docker - особенности ## Настройки fail2ban