一、安裝Ubuntu
安裝Ubuntu,安裝過程就不詳細說了,我是從微軟商店下載的Ubuntu安裝,沒有用VMware,想用Xshell連接Ubuntu,中間一直出問題,現在解決,總結一下。
二、配置ssh server
自帶ssh server不好用,先卸載再安裝即可
// 卸載
sudo apt-get remove openssh-server
// 安裝
sudo apt-get install openssh-server
三、編輯配置文件
vim /etc/ssh/sshd_config
修改端口:
Port 36000 # 默認的是22,但是windows有自己的ssh服務用的也是22端口,修改一下
#還有一項PasswordAuthentication
# 改為yes可以使用密碼登錄,ssh密鑰登錄使用默認no
PasswordAuthentication yes


四、重啟服務
sudo service ssh --full-restart
五、查看ip
ifconfig
六、Xshell連接

然后輸入用戶名密碼就🆗啦!!!
問題記錄:
錯誤:
Could not read response to hello message from hook [ ! -f /usr/bin/snap ] || /usr/bin/snap advise-snap --from-apt 2>/dev/null || true: Success
運行:
sudo rm -rf /etc/apt/apt.conf.d/20snapd.conf
