可以执行此命令看事件:
tail -f /var/log/messages
如果看到有说不能访问 ~/.ssh/authorized_keys
这个文件的,可以尝试下修改.ssh
目录的权限为700
,authorized_keys
文件的权限为 600
如果是 selinux 限制了访问,例如
Feb 9 16:04:20 localhost python: SELinux is preventing /usr/sbin/sshd from read access on the file authorized_keys.#012#012***** Plugin catchall (100. confidence) suggests **************************#012#012If you believe that sshd should be allowed read access on the authorized_keys file by default.#012Then you should report this as a bug.#012You can generate a local policy module to allow this access.#012Do#012allow this access for now by executing:#012# ausearch -c 'sshd' --raw | audit2allow -M my-sshd#012# semodule -i my-sshd.pp#012
则可以按照日志中的提示执行
ausearch -c 'sshd' --raw | audit2allow -M my-sshd
semodule -i my-sshd.pp
/sbin/restorecon -v ~/.ssh/authorized_keys
了解 工作生活心情记忆 的更多信息
Subscribe to get the latest posts sent to your email.