Telegram Group & Telegram Channel
🔐 5 шагов для защиты SSH: от порта до fail2ban

Если ты всё ещё держишь SSH по умолчанию и без ограничений — пора это исправлять. Вот 5 базовых, но мощных шагов, которые сильно усложнят жизнь злоумышленнику:



1️⃣ Сменить порт SSH
По умолчанию — порт 22. Все боты мира сканируют именно его.
Как изменить:

sudo nano /etc/ssh/sshd_config
# Найди строку:
Port 22
# Измени, например, на:
Port 2222

Не забудь открыть новый порт в фаерволе и перезапустить SSH:

sudo systemctl restart sshd




2️⃣ Отключить вход по паролю
Пароли — дырка в безопасности. Только ключи.
В sshd_config:

PasswordAuthentication no
PermitRootLogin no


Используй SSH-ключи:

ssh-keygen
ssh-copy-id user@host




3️⃣ Ограничить доступ по IP
Открывать SSH всему миру — плохая идея.
Пример для UFW:

sudo ufw allow from <твой_IP> to any port 2222 proto tcp
sudo ufw enable


Аналогично — через iptables или firewalld.



4️⃣ Включить двухфакторную аутентификацию (2FA)
Устанавливаем Google Authenticator:

sudo apt install libpam-google-authenticator
google-authenticator

Добавить в /etc/pam.d/sshd:

auth required pam_google_authenticator.so

В sshd_config:

ChallengeResponseAuthentication yes




5️⃣ Настроить fail2ban
Автоматическая блокировка IP после X неудачных попыток входа.
Установка:

sudo apt install fail2ban

Пример конфига /etc/fail2ban/jail.local:

[sshd]
enabled = true
port = 2222
filter = sshd
logpath = /var/log/auth.log
maxretry = 3
bantime = 1h

Стартуем:

sudo systemctl enable fail2ban
sudo systemctl start fail2ban



Проверяй, как тебя видит мир:

ss -tuln | grep ssh



tg-me.com/linux_srv/478
Create:
Last Update:

🔐 5 шагов для защиты SSH: от порта до fail2ban

Если ты всё ещё держишь SSH по умолчанию и без ограничений — пора это исправлять. Вот 5 базовых, но мощных шагов, которые сильно усложнят жизнь злоумышленнику:



1️⃣ Сменить порт SSH
По умолчанию — порт 22. Все боты мира сканируют именно его.
Как изменить:


sudo nano /etc/ssh/sshd_config
# Найди строку:
Port 22
# Измени, например, на:
Port 2222

Не забудь открыть новый порт в фаерволе и перезапустить SSH:

sudo systemctl restart sshd




2️⃣ Отключить вход по паролю
Пароли — дырка в безопасности. Только ключи.
В sshd_config:

PasswordAuthentication no
PermitRootLogin no


Используй SSH-ключи:

ssh-keygen
ssh-copy-id user@host




3️⃣ Ограничить доступ по IP
Открывать SSH всему миру — плохая идея.
Пример для UFW:

sudo ufw allow from <твой_IP> to any port 2222 proto tcp
sudo ufw enable


Аналогично — через iptables или firewalld.



4️⃣ Включить двухфакторную аутентификацию (2FA)
Устанавливаем Google Authenticator:

sudo apt install libpam-google-authenticator
google-authenticator

Добавить в /etc/pam.d/sshd:

auth required pam_google_authenticator.so

В sshd_config:

ChallengeResponseAuthentication yes




5️⃣ Настроить fail2ban
Автоматическая блокировка IP после X неудачных попыток входа.
Установка:

sudo apt install fail2ban

Пример конфига /etc/fail2ban/jail.local:

[sshd]
enabled = true
port = 2222
filter = sshd
logpath = /var/log/auth.log
maxretry = 3
bantime = 1h

Стартуем:

sudo systemctl enable fail2ban
sudo systemctl start fail2ban



Проверяй, как тебя видит мир:

ss -tuln | grep ssh

BY Типичный Сисадмин


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/linux_srv/478

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

Telegram and Signal Havens for Right-Wing Extremists

Since the violent storming of Capitol Hill and subsequent ban of former U.S. President Donald Trump from Facebook and Twitter, the removal of Parler from Amazon’s servers, and the de-platforming of incendiary right-wing content, messaging services Telegram and Signal have seen a deluge of new users. In January alone, Telegram reported 90 million new accounts. Its founder, Pavel Durov, described this as “the largest digital migration in human history.” Signal reportedly doubled its user base to 40 million people and became the most downloaded app in 70 countries. The two services rely on encryption to protect the privacy of user communication, which has made them popular with protesters seeking to conceal their identities against repressive governments in places like Belarus, Hong Kong, and Iran. But the same encryption technology has also made them a favored communication tool for criminals and terrorist groups, including al Qaeda and the Islamic State.

Mr. Durov launched Telegram in late 2013 with his brother, Nikolai, just months before he was pushed out of VK, the Russian social-media platform he founded. Mr. Durov pitched his new app—funded with the proceeds from the VK sale—less as a business than as a way for people to send messages while avoiding government surveillance and censorship.

telegram from tw


Telegram Типичный Сисадмин
FROM USA