可以ping通,但无法通过ssh连接虚拟机的解决方案
2016-07-27 18:26
417 查看
今天在虚拟机上装了一个 Linux 玩玩, 但在启动 Linux 后,在 Windows 中通过 Xshell 以 SSH 方式连接到 Linux 时却连接不上,于是打开 CMD 窗口,输入了 ping 192.168.220.128,返回结果显示可以拼通:
[ruby] view
plain copy
Pinging 192.168.220.128 with 32 bytes of data:
Reply from 192.168.220.128: bytes=32 time<1ms TTL=64
Reply from 192.168.220.128: bytes=32 time<1ms TTL=64
Reply from 192.168.220.128: bytes=32 time<1ms TTL=64
Reply from 192.168.220.128: bytes=32 time<1ms TTL=64
Ping statistics for 192.168.220.128:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
没弄明白是怎么一回事,就 GOOGLE 了一翻, 通过 Google 找到了问题所在:需要在客户端通过 SSH 连接主机,如果连接过程中返回的错误信息是 “请求被拒绝“,那么应该是 LINUX 开启了防火墙,或是 SSHD 服务没有启动!
通过执行下面两个命令解决:
[ruby] view
plain copy
service iptables stop //关闭防火墙
service sshd start //启动 SSHD 服务
[ruby] view
plain copy
Pinging 192.168.220.128 with 32 bytes of data:
Reply from 192.168.220.128: bytes=32 time<1ms TTL=64
Reply from 192.168.220.128: bytes=32 time<1ms TTL=64
Reply from 192.168.220.128: bytes=32 time<1ms TTL=64
Reply from 192.168.220.128: bytes=32 time<1ms TTL=64
Ping statistics for 192.168.220.128:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
没弄明白是怎么一回事,就 GOOGLE 了一翻, 通过 Google 找到了问题所在:需要在客户端通过 SSH 连接主机,如果连接过程中返回的错误信息是 “请求被拒绝“,那么应该是 LINUX 开启了防火墙,或是 SSHD 服务没有启动!
通过执行下面两个命令解决:
[ruby] view
plain copy
service iptables stop //关闭防火墙
service sshd start //启动 SSHD 服务
相关文章推荐
- validates的条件验证(if)的Proc用法
- ubuntu14.04下安装QT4,QT5
- sudo 出现unable to resolve host 解决方法
- HTML 颜色速查表
- awstats 分析nginx 日志
- matlab灰度变彩色+白平衡算法实现
- 2016.07.15【初中部 NOIP提高组 】模拟赛C
- POJ 1011 STICKS 搜索 剪枝
- linux中echo命令
- 2016-07-27 工作记录
- 设计模式的7原则及23种设计模式概要
- FZU 1911 矩阵快速幂
- 图片排序
- 富文本编辑器CKEDITOR使用注意事项,Ajax回调
- MQL5 命令行编译
- 资本寒冬,看咕咚、Keep、Feel们如何逆势而上
- Win8.1以及win10以上系统 安装msi文件方法
- [置顶] 有一个字符数组的内容为:"student a am i",请你将数组的内容改为"i am a student".
- Qt::ConnectionType 解析
- 矩阵基础1010 UVA 11651 矩阵快速幂+DP 好题,推荐