首先确认网络接口名称,使用ip addr show或ifconfig -a;接着根据发行版配置IP,ubuntu/debian通过Netplan设置静态IP并应用,centos/RHEL编辑ifcfg文件并重启网络服务;然后设置主机名hostnamectl,配置/etc/hosts和dns解析;最后用ping测试连通性、检查网关与DNS,确保配置正…
修改ssh配置可提升安全性与连接体验。1. Port 2222减少攻击;2. ListenAddress指定监听IP;3. Protocol 2禁用不安全的SSH-1;4. PermitRootLogin no禁止root直连;5. PasswordAuthentication no关闭密码登录;6. PubkeyAuthentication ye…