ssh登录配置公钥后仍然需要密码登录的问题处理

0
(0)

可以执行此命令看事件:

tail -f /var/log/messages

如果看到有说不能访问 ~/.ssh/authorized_keys 这个文件的,可以尝试下修改.ssh目录的权限为700authorized_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

这篇文章有用吗?

平均评分 0 / 5. 投票数: 0

到目前为止还没有投票!成为第一位评论此文章。

很抱歉,这篇文章对您没有用!

让我们改善这篇文章!

告诉我们我们如何改善这篇文章?

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据