feat: UFW раздел добавлен

This commit is contained in:
2026-03-31 17:58:11 +00:00
parent 8d64ee08ff
commit 53eab68341

View File

@@ -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
```
<details>
<summary>Список файлов и катологов в каталоге `/etc/ufw/applications.d/`</summary>
```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
```
</details>
**Шаг 3** Изменить файл конфигурации для OpenSSH-Server
```bash
nano openssh-server
```
<details>
<summary>Содержимое файла `/etc/ufw/applications.d/openssh-server`</summary>
```ini
[OpenSSH]
title=Secure shell server, an rshd replacement
description=OpenSSH is a free implementation of the Secure Shell protocol.
ports=22/tcp
```
</details>
**Шаг 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