【一句话经验】亚马逊云EC2 ubuntu24.04.1开启ROOT登录Permission denied (publickey)按照常规的方法SSH登录会一直报错: Permission denied (publickey)因为亚马逊云的默认配置不是在/etc/ssh/sshd_config,而是在引入的文件里了,所以在instance控制台输入这行命令来解除登录限制: sudo sed -i 's/^PasswordAuthentication no$/PasswordAuthentication yes/' /etc/ssh/sshd_config.d/60-cloudimg-settings.conf 然后重启sshd: s