vagrant + virtual box + rhel7 + ssh 登录

1、程序下载

vc++

https://download.visualstudio.microsoft.com/download/pr/1754ea58-11a6-44ab-a262-696e194ce543/3642E3F95D50CC193E4B5A0B0FFBF7FE2C08801517758B4C8AEB7105A091208A/VC_redist.x64.exe

virtualbox

https://download.virtualbox.org/virtualbox/7.0.18/VirtualBox-7.0.18-162988-Win.exe

vagrant

https://releases.hashicorp.com/vagrant/2.4.1/vagrant_2.4.1_windows_amd64.msi

Vagrant box generic/rhel7 - Vagrant Cloud (vagrantup.com)

2、新建文件夹并启动rhel7

powershell管理员身份运行

可以在D盘新建文件夹

mkdir d:/vm/rhel7/

cd D:/vm/rhel7/

复制代码
vagrant init generic/rhel7
vagrant up

3、修改私有地址为192.168.56.10

修改配置文件D:/vm/rhel/Vagrantfile

Create a private network, which allows host-only access to the machine

using a specific IP.

config.vm.network "private_network", ip: "192.168.56.10"

改完配置reload

vagrant reload#(需要在D:/vm/rhel7/目录下运行)

4、修改ssh配置远程登陆

sudo su切换至root

vi /etc/ssh/sshd_config

PasswordAuthentication yes#(允许密码登录)

PermitRootLogin yes#(允许root登录)

保存后service sshd restart

xshell远程用192.168.56.10登录

用户名:vagrant 密码: vagrant

相关推荐
CRUD酱1 分钟前
CentOS的yum仓库失效问题解决(换镜像源)
linux·运维·服务器·centos
zly350023 分钟前
VMware vCenter Converter Standalone 转换Linux系统,出现两个磁盘的处理
linux·运维·服务器
珠海西格32 分钟前
1MW光伏项目“四可”装置改造:逆变器兼容性评估方法详解
大数据·运维·服务器·云计算·能源
General_G1 小时前
Linux中的信号
linux·运维·服务器
诸神缄默不语1 小时前
当无法直接用apt instll时,Linux如何离线安装软件包(以make为例)
linux·运维·服务器
learning-striving1 小时前
kali默认桌面Xfce切换为GNOME桌面
linux·运维·服务器·kali
黄昏晓x1 小时前
Linux----进程控制
android·linux·运维
郝亚军2 小时前
ubutnu 64位系统,需要安装的工具包
linux·运维·ubuntu
宇钶宇夕2 小时前
CoDeSys入门实战一起学习(二十八):(ST)三台电机顺起逆停程序详解
运维·学习·自动化·软件工程
萧曵 丶2 小时前
Nginx 高频面试题(含答案)
运维·nginx