(一)安装SSH
登录虚拟机root账号
1、检查是否安装SSH
#确认状态,显示active(running)即成功
systemctl status sshd
# 安装openssh-server
yum install openssh-server
2、修改sshd_config文件
输入命令: sudo vi /etc/ssh/sshd_config 回车
# 配置文件中的相关设置
Port 22
ListenAddress 0.0.0.0
ListenAddress ::
PermitRootLogin yes
PasswordAuthentication yes
3、启动SSH服务(可选)
默认是启动的
sudo systemctl start sshd #启动,执行后无输出
(二)仅主机模式(预设)
1、获取VMnet1网卡IP信息
主机:笔记本,windows10系统 联网方式:wifi
获取方式:在主机,Win+R,cmd,输入ipconfig /all
查看主机真实网络IP