windows下構建linux子系統 xshell無法連接的問題

具體的是參考:
https://www.cnblogs.com/lonelyxmas/p/9914483.html

應該不是端口占用的問題,直接改動配置文件就可以.

解決方案如下:
安裝ssh
sudo apt intsall openssh-server openssh-client
備份sshd配置文件
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
修改內容:
#PermitRootLogin prohibit-password #註釋
PermitRootLogin yes #添加這行
#StrictModes yes # 註釋
PasswordAuthentication yes # 允許密碼登錄
啓動ssh
sudo service ssh start
或者
sudo service ssh restart
如果提示sshd error: could not load host key,則用下面的命令重新生成
sudo rm /etc/ssh/ssh*key
dpkg-reconfigure openssh-server

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章