使用Xshell连接ubuntu

连不上原因1:ping ubuntu的ip不通

windows上我把VM的虚拟网卡关了 

解决:进入适配器管理 右键打开网卡 能ping通

连不上原因2:

sudo apt-get install openssh-server

连不上原因3:

修改: 

vim /etc/ssh/sshd_config 

找到:  

# Authenticaton 

LoginGraceTime 120

PremitRootLogin without passwd 

StrictModes yes 

修改为: 

# Authenticaton 

LoginGraceTime 120

PremitRootLogin yes 

StrictModes yes

 连不上的原因4:

使用用户名登录 再su root进入管理员账号 之前一直使用root登录一直不成功,一直爽

原文地址:https://www.cnblogs.com/Schrodinger6/p/11366873.html