Chinaunix首页 | 论坛 | 博客
  • 博客访问: 94331
  • 博文数量: 21
  • 博客积分: 568
  • 博客等级: 中士
  • 技术积分: 175
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-31 10:29
文章分类
文章存档

2014年(1)

2012年(6)

2011年(14)

我的朋友

分类: LINUX

2012-04-18 17:58:02

故障现象:
执行生成密匙命令时提示:
#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
能正常生成密匙,至此故障解决。



阅读(4359) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~