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

相关推荐
IT成长日记2 小时前
【Docker基础】Docker数据持久化与卷(Volume)介绍
运维·docker·容器·数据持久化·volume·
物联网老王4 小时前
Ubuntu Linux Cursor 安装与使用一
linux·运维·ubuntu
艾伦_耶格宇5 小时前
【ACP】阿里云云计算高级运维工程师--ACP
运维·阿里云·云计算
一位摩羯座DBA6 小时前
Redhat&Centos挂载镜像
linux·运维·centos
cui_win7 小时前
【网络】Linux 内核优化实战 - net.core.flow_limit_table_len
linux·运维·网络
风清再凯7 小时前
自动化工具ansible,以及playbook剧本
运维·自动化·ansible
深圳安锐科技有限公司7 小时前
深圳安锐科技发布国内首款4G 索力仪!让斜拉桥索力自动化监测更精准高效
运维·安全·自动化·自动化监测·人工监测·桥梁监测·索力监测
猫头虎7 小时前
猫头虎 AI工具分享:一个网页抓取、结构化数据提取、网页爬取、浏览器自动化操作工具:Hyperbrowser MCP
运维·人工智能·gpt·开源·自动化·文心一言·ai编程
cocologin9 小时前
RIP 技术深度解析
运维·网络·网络协议
庸子9 小时前
基于Jenkins和Kubernetes构建DevOps自动化运维管理平台
运维·kubernetes·jenkins