环境:宿主机为win2008R2,虚拟机vbox下装centos6.8
1.先查看了ssh服务是否开启
ps -e |grep ssh------>若存在sshd那说明ssh-server已经启动了。
------>若不存在则启动:sudo /etc/init.d/ssh start
------>ssh-server配置文件在/ etc/ssh/sshd_config,默认端口是22,可自定义
经过查看服务已开启
2.关闭防火墙
# 查看防火墙状态
service iptables status# 停止防火墙
service iptables stop# 启动防火墙
service iptables start# 重启防火墙 service iptables restart
# 永久关闭防火墙 chkconfig iptables off
# 永久关闭后再次启用防火墙 chkconfig iptables off
关闭防火墙发现还是无法连接ssh
3.关闭selinux
vim /etc/selinux/config打开selinux配置文件
SELINUX=参数,参数可选(enforcing、permissive、disabled)
之后经过重启,客户端可以ssh连接vbox虚拟机系统。