window10使用vagrant+virtualBox搭建centos7

安装vagrant+virtualBox

在一个指定目录执行命令cmd

  vagrant init 初始化

  接着自动生成Vagrantfile配置文件,需要配置系统镜像,网络,硬件资源分配等

下载 centos7的virtualbox镜像

  vagrant box add centos/7 e: mpvirtualbox.box

查看virtualbox的系统

  vagrant box list

启动virtualbox中的虚拟机

  vagrant up

进入虚拟机系统

  vagrant ssh

当用xshll去连接这台linux时会发现不能使用密码登录

修改网络的配置文件,添加密码认证连接方式

  vi /etc/ssh/sshd_config

    修改PasswordAuthentication yes

passwd命令修改密码,比如abc123

使配置生效

  systemctl restart sshd

原文地址:https://www.cnblogs.com/erfsfj-dbc/p/11862571.html