vps

修改ssh端口

sed -i "s/#Port 22/Port 38752/g" /etc/ssh/sshd_config
#或者使用脚本
wget https://www.moerats.com/usr/down/sshport.sh
bash sshport.sh
service ssh restart

添加Swap虚拟内存

wget https://www.moerats.com/usr/shell/swap.sh && bash swap.sh

防ssh爆破

apt install iptables fail2ban -y
vim /etc/fail2ban/jail.d/jail.local
service fail2ban restart
service fail2ban status

#jail.local
[sshd]
port = 38752
maxretry = 3
bantime = 6d