Ubuntu --- Xshell 连接 VirtualBox下安装的Ubuntu

1.桥接模式

打开VirtualBox管理器---设置---网络---连接方式选择桥接网卡

2.安装ssh服务

安装:

sudo apt-get install openssh-server

启动:

sudo /etc/init.d/ssh start // 方式1
service ssh start // 方式2

查看:

ps -e|grep ssh

正常显示为:6212 ?        00:00:00 sshd

此时用xshell提示ssh服务器拒绝了密码,请再试一次,需要修改配置文件:

vim /etc/ssh/sshd_config

找到:

# Authentication:
LoginGraceTime 120
PermitRootLogin prohibit-password
StrictModes yes

修改为:

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes

重启:

/etc/init.d/ssh restart


3.关闭防火墙

sudo ufw disable 

如何开启关闭Ubuntu防火墙,见http://www.cnblogs.com/kluan/p/5993767.html

 

posted @ 2017-04-07 12:13  涛涛taotao  阅读(269)  评论(0编辑  收藏  举报