鍍金池/ 問(wèn)答/Java  Linux  Office/ Win10的linux子系統(tǒng)用xshell連接不上

Win10的linux子系統(tǒng)用xshell連接不上

裝的ubuntu 16.04
openssh-server也都裝了,只是端口改成了23,然后連接不上,報(bào)如下錯(cuò)誤,請(qǐng)問(wèn)有遇到這個(gè)情況的嘛

Connecting to 192.168.10.12:23...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
Connection closing...Socket close.

Connection closed by foreign host.

Disconnected from remote host(192.168.10.12) at 14:53:13.

Type `help' to learn how to use Xshell prompt.
回答
編輯回答
默念

什么情況下能連上?
端口改成23之前能連上嗎?
服務(wù)器端ssh端口改成23了嗎?
服務(wù)器端ssh服務(wù)啟動(dòng)了嗎? (service ssh status)
服務(wù)器端23端口開(kāi)啟了嗎? (ss -tlnp)
服務(wù)器端有沒(méi)有設(shè)置防火墻阻止23端口的訪問(wèn)?(iptables -nL)


通過(guò) To escape to local shell, press 'Ctrl+Alt+]'. 得知你服務(wù)端 23 端口對(duì)應(yīng)的服務(wù)是telnet,并不是ssh。
解決辦法:

  1. 可以把 Xshell 鏈接 192.168.10.12 的端口改回22
  2. 可以把服務(wù)端的 telnet 服務(wù)關(guān)閉(/etc/init.d/openbsd-inetd stop 現(xiàn)在很少用這個(gè)服務(wù)傳輸數(shù)據(jù)了,因?yàn)槭敲魑膫鬏?,不安全),把ssh服務(wù)端口修改為23 (修改配置文件在 /etc/ssh/sshd_config),然后重啟ssh服務(wù)(service ssh restart)
2018年6月17日 20:09
編輯回答
熊出沒(méi)

你要使用 windows 10 上的 subsystem 做什么呢?除了好奇,我想不到其他原因。

若要練習(xí) ubuntu ,不如使用虛擬機(jī)(VirtualBox 之類的)。

2018年3月14日 17:11