0 Голосов

Изменения документа Proxy

Редактировал(а) Anton Krivchenkov 31.03.2026 00:03

От версии 2.3
отредактировано Anton Krivchenkov
на 28.02.2026 22:02
Изменить комментарий: К данной версии нет комментариев
К версии 5.1
отредактировано Anton Krivchenkov
на 02.03.2026 11:03
Изменить комментарий: К данной версии нет комментариев

Сводка

Подробности

Свойства страницы
Содержимое
... ... @@ -1,5 +1,9 @@
1 +# Отключение ICMP
2 +
1 1  nano disable_ping.sh
2 2  
5 +-- НЕ ввезде прокатывает )) Зависит от Хостера
6 +
3 3   #!/usr/bin/env bash
4 4   set -e
5 5  
... ... @@ -20,7 +20,7 @@
20 20  
21 21   chmod +x disable_ping.sh && ./disable_ping.sh
22 22  
23 -Утилиты
27 +# Утилиты
24 24  
25 25   sudo apt update && sudo apt upgrade -y && \
26 26   sudo apt install -y \
... ... @@ -50,7 +50,7 @@
50 50  
51 51  --
52 52  
53 - базовая настройка:
57 +базовая настройка:
54 54  
55 55   # UFW
56 56   sudo ufw default deny incoming
... ... @@ -57,12 +57,87 @@
57 57   sudo ufw default allow outgoing
58 58   sudo ufw allow OpenSSH
59 59   sudo ufw enable
60 -
61 - # fail2ban (ssh-джейл по умолчанию)
62 - sudo systemctl enable --now fail2ban
63 63  
64 -Докер
65 +
66 +`sudo apt install fail2ban -y
67 +sudo bash -c 'cat > /etc/fail2ban/jail.local << "JAIL"
68 +[DEFAULT]
69 +bantime = 24h
70 +findtime = 10m
71 +maxretry = 3
65 65  
73 +bantime.increment = true
74 +bantime.factor = 2
75 +bantime.maxtime = 4w
76 +
77 +banaction = iptables-multiport
78 +banaction_allports = iptables-allports
79 +
80 +ignoreip = 127.0.0.1/8 ::1
81 +
82 +[sshd]
83 +enabled = true
84 +logpath = %(sshd_log)s
85 +backend = %(sshd_backend)s
86 +maxretry = 3
87 +bantime = 48h
88 +findtime = 15m
89 +mode = aggressive
90 +
91 +[sshd-ddos]
92 +enabled = true
93 +logpath = %(sshd_log)s
94 +backend = %(sshd_backend)s
95 +maxretry = 5
96 +bantime = 24h
97 +findtime = 30s
98 +
99 +[recidive]
100 +enabled = true
101 +logpath = /var/log/fail2ban.log
102 +maxretry = 3
103 +bantime = 4w
104 +findtime = 7d
105 +banaction = iptables-allports
106 +JAIL
107 +apt-get update
108 +apt-get install -y fail2ban
109 +systemctl enable --now fail2ban
110 +systemctl restart fail2ban
111 +echo "fail2ban настроен и запущен"
112 +'
113 +systemctl enable fail2ban
114 +systemctl restart fail2ban`
115 +
116 +# ZSH
117 +
118 + sudo apt update && sudo apt install -y zsh git fonts-powerline curl && \
119 + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended && \
120 + sed -i 's/^ZSH_THEME=.*/ZSH_THEME="agnoster"/' ~/.zshrc && \
121 + grep -q "^ZSH_DISABLE_COMPFIX=" ~/.zshrc && sed -i 's/^ZSH_DISABLE_COMPFIX=.*/ZSH_DISABLE_COMPFIX="true"/' ~/.zshrc || echo 'ZSH_DISABLE_COMPFIX="true"' >> ~/.zshrc && \
122 + sed -i 's/^plugins=(.*/plugins=(git sudo zsh-autosuggestions zsh-syntax-highlighting)/' ~/.zshrc && \
123 + git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions && \
124 + git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting && \
125 + printf "\nalias ll='ls -la'\nalias gs='git status'\nalias d='docker ps --format \"table {{.Names}}\t{{.Status}}\t{{.Ports}}\"'\nalias dcu='docker compose up -d'\nalias dcd='docker compose down'\nalias dl='docker logs'\nalias n='nano'\nalias lzd='lazydocker'\nalias dr='dry'\nalias dcuf='docker compose up -d --force-recreate'\nalias dv='docker ps -a --format \"table {{.Names}}\t{{.Mounts}}\"'\nalias dvc='docker ps -a --format \"{{.Mounts}}\" | tr \",\" \"\n\" | grep -v \"^$\" | sort | uniq'\nalias dvo='comm -23 <(docker volume ls -q | sort) <(docker ps -a --format \"{{.Mounts}}\" | tr \",\" \"\n\" | grep -v \"^$\" | sort | uniq)'\nalias dsp='docker system prune -a --volumes'\nalias ds='docker stats --no-stream'\nalias dcdub='docker compose down && docker compose up --build'\nalias cr_gitlab_repo='/prod/create_repo_and_push.sh'\n" >> ~/.zshrc && \
126 + chsh -s "$(which zsh)"
127 +
128 +дальше
129 +
130 + exec zsh
131 +
132 +что делает:
133 +
134 +* ставит zsh, git и powerline‑шрифты
135 +* ставит Oh My Zsh
136 +* включает нужную тему и плагины
137 +* добавляет твои алиасы
138 +* включает ZSH_DISABLE_COMPFIX="true"
139 +* делает zsh оболочкой по умолчанию
140 +
141 +--
142 +
143 +# Докер
144 +
66 66   sudo curl -fsSL https://get.docker.com | sh &&
67 67   LATEST=$(curl -sL https://api.github.com/repos/docker/compose/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
68 68   DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
... ... @@ -71,16 +71,14 @@
71 71   chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
72 72   docker compose version
73 73  
74 -Управление докером
153 +## Управление докером
75 75  
76 -ctop
155 +### ctop
77 77  
78 78   sudo wget https://github.com/bcicen/ctop/releases/download/v0.7.7/ctop-0.7.7-linux-amd64 -O /usr/local/bin/ctop
79 79   sudo chmod +x /usr/local/bin/ctop
80 80  
81 -lzd
160 +### lzd
82 82  
83 83   DIR=/usr/local/bin \
84 84   bash -c 'curl -fsSL https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash && echo "alias lzd='\''lazydocker'\''" >> "$HOME/.zshrc"'
85 -
86 -