Ubuntu中
apt-get install net-tools
apt-get install ssh
#查看是否安装成功
sudo ps -e |grep ssh
#重启ssh和启动sshd
service ssh restart
service sshd start
ifconfig
vim /etc/ssh/sshd_config
LoginGraceTime 2m
#PermitRootLogin prohibit-password
PermitRootLogin yes
StrictModes yes
#Xshell6连接不上ubuntu的原因还有
> 在/etc/ssh/sshd_config文件中默认端口是22
> 如果在xshell中改变端口
> 相应的ubuntu虚拟机中/etc/ssh/sshd_config文件中也要改变端口
> #Port 22 与xshell配置保持一致
Xshell6设置
之后弹出界面输入ubuntu登录密码即可