SSH证书配置好后仍提示密码

记录一下,几个关键点:

  1. SSH证书的常规配置,如:PublickeyAuthentication yes等
  2. .ssh目录权限700,.ssh/authorized_keys文件权限为600,貌似有说法是说不允许写权限。
  3. 执行restorecon -r -vv ~/.ssh,可以在执行前后用ls -laZ比较文件的标签的变化,我这里主要是authorzied_keys文件之前没有打上ssh_home这样的标签,所以无效。执行这个命令后有此标签。
  4. 重启 systemctl restart sshd

You may also like

Leave a Reply

Your email address will not be published. Required fields are marked *