Загрузка данных


cd ~

sudo fail2ban-client status sshd 2>/dev/null || sudo fail2ban-client status ssh
sudo fail2ban-client set sshd unbanip --all 2>/dev/null
sudo fail2ban-client set ssh unbanip --all 2>/dev/null

sudo sed -i '/deny/d' /etc/hosts.deny 2>/dev/null
echo 'sshd: ALL' | sudo tee /etc/hosts.allow

sudo grep -nE 'AllowUsers|AllowGroups|DenyUsers|Match|ListenAddress|PasswordAuthentication|MaxStartups' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/* 2>/dev/null

# тест не localhost, а свой LAN-IP
IP=$(hostname -I | awk '{print $1}'); echo "IP=$IP"
timeout 5 bash -c "exec 3<>/dev/tcp/$IP/22; cat <&3" | head -1

sudo journalctl -u ssh -n 30 --no-pager