Ubuntu(22.04)云主机SSH安全加固
https://blog.****.net/qq_44846097/article/details/141098092
ubuntu22.04防火墙策略
https://blog.****.net/sunyuhua_keyboard/article/details/139493464
Ubuntu 22.04 防火墙设置和开放端口命令
https://blog.****.net/Roger_Spencer/article/details/134001638
三、服务器防火墙管理
1.查看服务器上开放的端口
sudo netstat -tuln
https://www.cnblogs.com/100tool/articles/17614028.html
如果您没有权限运行 netstat 命令,您可以尝试使用以下命令查看端口信息:
sudo lsof -i -P -n | grep LISTEN
1 使用的命令
sudo ufw enable
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow from 192.168.99.0/24 to any port 22
sudo ufw allow from 192.168.99.0/24 to any port 3306
sudo ufw status verbose
sudo ufw status numbered > ~/ufw_rules_backup.txt
sudo ufw reload
sudo service ufw status
sudo ufw logging on
tail -f /var/log/ufw.log
sudo ufw logging low
tail -f /var/log/ufw.log
sudo ufw status
sudo service ufw status
sudo ufw allow from 192.168.99.55 to any port 22
sudo ufw reload
sudo ufw status verbose