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

0

(0)

可以执行此命令看事件:

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

这篇文章有用吗?

提交评分

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

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

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

让我们改善这篇文章!

告诉我们我们如何改善这篇文章? 提交反馈

最新发布的其他内容:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值