要提高Ubuntu SSH的安全性,可以采取以下措施:
/etc/ssh/sshd_config
,添加或修改以下行:Port 2222
然后重启SSH服务:sudo systemctl restart sshd
/etc/ssh/sshd_config
中设置:PermitRootLogin no
然后重启SSH服务。ssh-keygen -t rsa
~/.ssh/authorized_keys
文件中。sudo ufw allow from 192.168.1.0/24 to any port 22
sudo apt update
sudo apt upgrade
/etc/ssh/sshd_config
,设置以下参数:PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
Port 2222
然后重启SSH服务。通过上述措施,可以显著提高Ubuntu SSH的安全性,保护系统和数据不受未经授权的访问和攻击。