`
阅读更多

本来是打算搭建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

搞定了~

 

 

分享到:
评论

相关推荐

    winscp,putty(ssh) 等连接ubuntu 需安装ssh服务.docx

    在初次启动时,你可能会遇到“Could not load host key”错误,这是因为缺少RSA和DSA密钥对。SSH连接需要这些密钥进行身份验证。要生成密钥对,可以运行`ssh-keygen`命令: ```bash ssh-keygen -t rsa -b 2048 -f /...

    BURNINTEST--硬件检测工具

    - Added a hot Key, F4, to set the auto run flag and run the tests (i.e. set "-r" and then run the tests). - Other minor changes. Release 5.3 build 1018 WIN32 release 16 April 2008 - Added an ...

    BIND-LINUX64位包

    irs_resconf_load(), has been modified to return ISC_R_FILENOTFOUND when the file does not exist and initializes the resconf structure as if the file had existed and configured with nameservers at ...

    Bochs - The cross platform IA-32 (x86) emulator

    [2930633] legacy mouse capture key : not specific enough [2930679] Let user change mouse capture control key [2803538] Show flags for pages when using "info tab" ----------------------------------...

    8-07-14_MegaCLI for linux_windows

    SCGCQ00289585 Defect Command line generated along with press any key in help file operation SCGCQ00315805 Defect Change the UI fro "adpBBucmd getbbumodes a0" command SCGCQ00317547 Defect MegaCLI ...

    Sublime Text 3 (Build 3143)

    Improved responsiveness when the system is under high CPU load High DPI textures are used on Windows and Linux when the DPI scale is greater than 1.0 Improved font selection on all platforms, allowing...

    php.ini-development

    PHP attempts to find and load this configuration from a number of locations. ; The following is a summary of its search order: ; 1. SAPI module specific location. ; 2. The PHPRC environment variable....

    mini2440 beer(pwm) 驱动

    could not establish link Using dm9000 device File transfer via NFS from server 192.168.1.30; our IP address is 192.168.1.20 Filename '/home/liyong-zou/nfs/kernel/uImage'. Load address: 0x30008000 ...

    VB编程资源大全(英文源码 控制)

    once placed onto a form, makes the form act like the Taskbar (minus the Start Menu)." -- David Newcum<END><br>2 , RemBuilderplus.zip "Rem Builder will auto load on startup to use Rem Builder;...

Global site tag (gtag.js) - Google Analytics