当前位置:网站首页>虚拟机中用户和root忘记密码解决办法
虚拟机中用户和root忘记密码解决办法
2022-06-12 15:15:00 【Stars_min】
!!!版本不一样操作也许也不一样,不过大致流程就这样,建议先快照,在进行修改密码,防止系统出问题
1. Ubuntu中忘记密码
1.1 root修改密码
1.1.1 重启Ubuntu,长按shift进入grub菜单,选择recovery mode点击回车:

1.1.2 进入"Recovery Menu"页面,选择"root Drop to root shell prompt",点击回车

1.1.3 出现 “[email protected]:~#” 标识

1.1.4 输入passwd,对root进行修改密码

这个问题必须使用"mount -o rw,remount /" 命令来解决
1.2 普通用户修改密码
1.2.1 重启Ubuntu,长按shift进入grub菜单,选择recovery mode,按e进行编辑,切记不要回车

1.2.2 在出现的界面中,找到 ro recovery nomodeset 替换为 rw single init=/bin/bash


1.2.3 按ctrl+x进入
1.2.4 输入passwd + [用户名] 进行修改密码,有successfully提示证明修改密码成功

2. Centos 6 中忘记密码
2.1 在开机启动后,迅速点击 e ,会进入以下界面

2.2 再次点击 e ,选择第二项(以kernel开头),再次点击 e ,进入编辑页面


2.3 在编辑页面最后一行加 1 或者 single ,回车确认

2.4 操作完上一步,界面又回到第二步,这次按 b ,进入引导系统

2.5 在 # 后面输入 passwd root ,重新设置root密码,输入新密码后出现successfully,证明修改成功,重启系统,用新密码登录就OK了
边栏推荐
猜你喜欢

粒子滤波学习记录

Kinect2.0+ORBSLAM2_with_pointcloud_map

h3c GR5200路由器上如何设置公网ip可以访问

Use of boost:: bind() in ROS

Wild pointer understanding

Tcp/ip three handshakes and four waves (interview questions)

Kinect2.0+ORBSLAM2_ with_ pointcloud_ map

Writing method of JUnit multithreading

NETCORE combined with cap event bus to realize distributed transaction -- Introduction (1)

Structure example
随机推荐
Module yaml error: Unexpected key in data: static_ context [line 9 col 3]
Pointer related concepts
学习是一件逆人性的事情(成为高手的内功心法)
[untitled]
USART(RS232422485)、I2C、SPI、CAN、USB总线
ROS 中 boost::bind( ) 的使用
C constant, cannot be changed
ES6新特性
Alibaba, Tencent and pinduoduo set an example, and the new logic of industrial Internet is gradually emerging
Seaborn Brief
PTA:自测-2 素数对猜想 (20分)
Shardingsphere practice (6) - elastic scaling
Error 1105: message:\“raft entry is too large
Some useful websites
ROS初学者编写小乌龟以一定速度旋转一定角度的server
FIRSTVT和LASTVT白话版
Differences between microservice architecture and SOA Architecture
Microservice fault tolerance
How to add WWW to the domain name
2021-06-27