虚拟机中查看ip命令
输入ifconfig,而不是ipconfig
虚拟机密码忘记
1、若能登录,输入password root命令
# password root
New password:此处输入密码
BAD password:it is too short and too simple
Retype new password:
passwd:updated sucessfully
# reboot 重启,进入系统使用密码登录
2、login密码忘记,启动后提示输入密码
(1)启动时弹出CentOS Linux7(Core)时,按↑或↓箭头选择此项,按下键盘e键,进入编辑模式
(2)找到LANG=en_US.UTF-8后面,加空格,加init=/bin/sh,要保持同一行,按ctrl+x进入引导启动页面
(3)输入mount -o remount, rw / 挂载根目录
(4)输入passwd root后会显示输入两次密码,密码成功后
(5)输入touch /.autorelabel开启SElinux
(6)输入exec /sbin/init 重启系统