ssh 禁用 root 和密码登陆 2024-10-22 vi /etc/ssh/sshd_config 1 2 3 4 5 6 7 Port 60022 #这里修改为你想要设置的端口,以 60022 为例 # 启用密钥验证 PubkeyAuthentication yes # 禁用密码验证 PasswordAuthentication no # 禁用 root 登陆 PermitRootLogin no service sshd restart #Linux #Ssh