title | date | tags | author | showToc | TocOpen | draft | hidemeta | comments | description | disableHLJS | disableShare | hideSummary | searchHidden | ShowReadingTime | ShowBreadCrumbs | ShowPostNavLinks | ShowWordCount | ShowRssButtonInSectionTermList | UseHugoToc | cover | editPost | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Linux Təməlli Serverlərin Təhlükəsizliyinin Yüksəldilməsi |
2022-12-18 11:30:03 +0000 |
|
Nijat |
false |
false |
false |
false |
false |
false |
false |
false |
false |
true |
true |
true |
true |
true |
true |
|
|
useradd <user>
usermod -aG sudo <user>
passwd <user>
RSA
ssh-keygen
ED25519 (Tövsiyyə olunan):
ssh-keygen -t ed25519
ssh-copy-id -i <key> user@host
5.Serverin ssh portunu dəyişmək və şifrə ilə girişi bağlamaq üçün sshd_config faylında dəyişikliklər etmək
Orijinal faylı saxlamaq:
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.orig
sshd_config faylını nano text editor ilə açmaq:
sudo nano /etc/ssh/sshd_config
sudo apt install unattended-upgrades
dpkg-reconfigure --priority=low unattended-upgrades
sudo apt install ufw
ufw allow <port>
sudo systemctl enable ufw && ufw enable
sudo nano /etc/ufw/before.rules
-A --ufw-before-input -p --icmp-type echo-request -j DROP
sudo apt install fail2ban
sudo nano /etc/fail2ban/jail.d/sshd.conf
[sshd]
enabled = true
port = ssh
filter = sshd
logpath = /var/log/auth.log
maxretry = 3
bantime = 120
ignoreip = whitelist-IP
sudo reboot