可以ping通,但無法通過ssh串連虛擬機器的解決方案

來源:互聯網
上載者:User

    今天在虛擬機器上裝了一個 Linux 玩玩, 但在啟動 Linux 後,在 Windows 中通過 Xshell 以 SSH 方式串連到 Linux 時卻串連不上,於是開啟 CMD 視窗,輸入了 ping 192.168.220.128,返回結果顯示可以拼通:

Pinging 192.168.220.128 with 32 bytes of data:<br />Reply from 192.168.220.128: bytes=32 time<1ms TTL=64<br />Reply from 192.168.220.128: bytes=32 time<1ms TTL=64<br />Reply from 192.168.220.128: bytes=32 time<1ms TTL=64<br />Reply from 192.168.220.128: bytes=32 time<1ms TTL=64<br />Ping statistics for 192.168.220.128:<br /> Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),<br />Approximate round trip times in milli-seconds:<br /> Minimum = 0ms, Maximum = 0ms, Average = 0ms<br /> 

沒弄明白是怎麼一回事,就 GOOGLE 了一翻, 通過 Google 找到了問題所在:需要在用戶端通過 SSH 串連主機,如果串連過程中返回的錯誤資訊是 “請求被拒絕“,那麼應該是 LINUX 開啟了防火牆,或是 SSHD 服務沒有啟動!

    通過執行下面兩個命令解決:

service iptables stop //關閉防火牆<br />service sshd start //啟動 SSHD 服務 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.