Could not load host key

本来是打算搭建hadoop+hbase的,但是还没开始就被这个ssh阻碍了~

先说下我的系统版本 ubuntu11.1

安装和启动都成功的情况下,出现了

#ssh localhost

Read from socket failed: Connection reset by peer

 

------------------------不知所措的分割线------------------------

下面描述下我的解决过程

 

注意检查/var/log/auth.log中的记录
在我的机器上出现的问题是权限问题
错误日志
Feb 27 10:14:39 ubuntu sshd[3052]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Feb 27 10:14:39 ubuntu sshd[3052]: error: @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
Feb 27 10:14:39 ubuntu sshd[3052]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Feb 27 10:14:39 ubuntu sshd[3052]: error: Permissions 0711 for '/etc/ssh/ssh_host_rsa_key' are too open.
Feb 27 10:14:39 ubuntu sshd[3052]: error: It is recommended that your private key files are NOT accessible by others.
Feb 27 10:14:39 ubuntu sshd[3052]: error: This private key will be ignored.
Feb 27 10:14:39 ubuntu sshd[3052]: error: bad permissions: ignore key: /etc/ssh/ssh_host_rsa_key
Feb 27 10:14:39 ubuntu sshd[3052]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key
原因是私有key文件权限问题,解决方式(/etc/ssh是我的ssh目录)
#cd /etc/ssh
#chmod 0644 *
查看一下权限
#ll
drwxr-xr-x   2 root root   4096 2012-02-28 09:30 ./
drwxr-xr-x 133 root root  12288 2012-02-28 08:56 ../
-rw-r--r--   1 root root 125749 2011-07-30 00:02 moduli
-rw-r--r--   1 root root   1669 2011-07-30 00:02 ssh_config
-rw-r--r--   1 root root   2489 2012-02-27 10:07 sshd_config
-rw-r--r--   1 root root    668 2012-02-27 17:35 ssh_host_dsa_key
-rw-r--r--   1 root root    601 2012-02-27 17:35 ssh_host_dsa_key.pub
-rw-r--r--   1 root root    223 2012-02-28 09:23 ssh_host_ecdsa_key
-rw-r--r--   1 root root    173 2012-02-28 09:23 ssh_host_ecdsa_key.pub
-rw-r--r--   1 root root   1679 2012-02-27 17:35 ssh_host_rsa_key
-rw-r--r--   1 root root    393 2012-02-27 17:35 ssh_host_rsa_key.pub
-rw-r--r--   1 root root    302 2011-01-11 02:48 ssh_import_id
重新附权限
#chmod 0600 ssh_host_ecdsa_key  ssh_host_dsa_key  ssh_host_rsa_key
重新启动ssh

#/etc/init.d/ssh restart
OK 测试下
#ssh localhost

Welcome to Ubuntu 11.10 (GNU/Linux 3.0.0-12-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

357 packages can be updated.
82 updates are security updates.

Last login: Tue Feb 28 09:43:46 2012 from localhost

搞定了~

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值