测试以下命令同样连接不上
ssh localhost
Ubuntu系统自带 openssh-client,但是没有自带 openssh-server,所以要自行安装openssh-server。
sudo apt install openssh-server
安装完成后,即可远程SSH连接