Chinaunix首页 | 论坛 | 博客
  • 博客访问: 19058
  • 博文数量: 7
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 27
  • 用 户 组: 普通用户
  • 注册时间: 2014-03-01 16:42
文章分类

全部博文(7)

文章存档

2014年(7)

我的朋友

分类: LINUX

2014-03-07 08:29:51

今天碰到ssh失败有两种:
1,ssh: connect to host 192.168.1.100 port 22: Connection refused
2,ssh_exchange_identification: read: Connection reset by peer
用ssh相连的两台电脑:笔记本ubuntu13.10:haoyu@192.168.1.104,台式机ubuntu12.04LTS:sandy@192.168.1.100
第一种失败产生的原因及解决办法:
       ssh的对象没有安装openssh-server,例如我的本本要ssh台式机:
        在ssh sandy@192.168.1.100之前,需要在台式机上安装:sudo apt-get install openssh-server
第二种失败产生及解决办法:
        由于我之前改了/etc/hosts.deny文件,我把#ALL: PARANOID的注释去掉了,现在改回来就ok了。网上查得:/etc/hosts.allow控制可以访问本机的IP地址,/etc/hosts.deny控制禁止访问本机的IP。如果两个文件的配置有冲突,以/etc/hosts.deny为准。所以虽然/etc/hosts.allow我也改了也没关系,只把ALL: PARANOID注释掉就可以了。
paranoid的意思是:
  • adj. 类似妄想狂的;属于偏执狂的
  • n. 患妄想狂的人;偏执狂患者
  •         估计是说所有的其他电脑想进入我的电脑那是妄想吧~~呵呵~~
  • ps:
  • 第三种:
  •     今天又出现一个错误错,当我连接台式机的时候:ssh sandy@192.168.1.100,出现如下错误,
    1. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    2. @ WARNING: REMOTE HOST IDENTIFICATION HAS @
    3. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    4. IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING
    5. Someone could be eavesdropping on you right now (man-in-the-middle attack)!
    6. It is also possible that a host key has just been changed.
    7. The fingerprint for the ECDSA key sent by the remote host is
    8. 3a:ab:0e:62:7a:0e:db:40:ac:95:46:0e:05:63:93:ee.
    9. Please contact your system administrator.
    10. Add correct host key in /home/haoyu/.ssh/known_hosts to get rid of this message.
    11. Offending ECDSA key in /home/haoyu/.ssh/known_hosts:6
    12.   remove with: ssh-keygen -f "/home/haoyu/.ssh/known_hosts" -R 192.168.1.100
    13. ECDSA host key for 192.168.1.100 has changed and you have requested strict checking.
    14. Host key verification failed.
    猜测应该是我本本的动态ip地址改变了,导致与以前的钥匙匹配不上,根据提示更新钥匙链,在本本上输入:
    1. remove with: ssh-keygen -f "/home/haoyu/.ssh/known_hosts" -R 192.168.1.100
    显示:
    1. # Host 192.168.1.100 found: line 6 type ECDSA
    2. /home/haoyu/.ssh/known_hosts updated.
    3. Original contents retained as /home/haoyu/.ssh/known_hosts.old
    重新ssh连接:
    1. ssh sandy@192.168.1.100
    出现:
    1. The authenticity of host '192.168.1.100 (192.168.1.100)' can't be established.
      ECDSA key fingerprint is 3a:ab:0e:62:7a:0e:db:40:ac:95:46:0e:05:63:93:ee.
      Are you sure you want to continue connecting (yes/no)?
    输入:yes,再输入密码就可以重新连接了。

  • 总结:如果在ubuntu12.04和13.10系统下想被ssh用,只是需要安装openssh-server就可以了,配置不需要更改了。
阅读(8285) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~