欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > linux >内容正文

linux

SELINUX导致的SSH密匙无法创建和访问的问题

发布时间:2024/8/26 linux 49 豆豆
生活随笔 收集整理的这篇文章主要介绍了 SELINUX导致的SSH密匙无法创建和访问的问题 小编觉得挺不错的,现在分享给大家,帮大家做个参考.
故障现象: 执行生成密匙命令时提示: #ssh-keygen -t dsa ...... open /root/.ssh/id_dsa failed: Permission denied. Saving the key failed: /root/.ssh/id_dsa.
同时: 放置好其他机器的authorized_keys,也无法通过密匙访问,任然需要密码。 Connection to 192.168.X.X closed. [root@hadoop-0 .ssh]# ssh 192.168.X.X root@192.168.110.109's password:
原来的/etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: #     enforcing - SELinux security policy is enforced. #     permissive - SELinux prints warnings instead of enforcing. #     disabled - No SELinux policy is loaded. SELINUX=enforcing # SELINUXTYPE= can take one of these two values: #     targeted - Targeted processes are protected, #     mls - Multi Level Security protection. SELINUXTYPE=targeted


故障解决方法: 修改 # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: #     enforcing - SELinux security policy is enforced. #     permissive - SELinux prints warnings instead of enforcing. #     disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of these two values: #     targeted - Targeted processes are protected, #     mls - Multi Level Security protection. SELINUXTYPE=targeted
重启服务器 能通过密匙访问了 [root@XX-0 .ssh]# ssh 192.168.x.x Last login: Thu Apr 19 01:52:15 2012 from 192.168.x.x ------------------------------------------------------ 生成密匙 # ssh-keygen -t dsa Your public key has been saved in /root/.ssh/id_dsa.pub. The key fingerprint is: 96:22:e3:a9:ac:a0:45:24:19:c2:c2:1a:75:d9:61:f9 root@XX-test The key's randomart image is: --[ DSA 1024]---- |=.. .ooo         | | = ...o          | Y 能正常生成密匙,至此故障解决。

总结

以上是生活随笔为你收集整理的SELINUX导致的SSH密匙无法创建和访问的问题的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。