当前位置:网站首页>虚拟机中用户和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了
边栏推荐
- C 数据类型
- [game server design cases] insights
- Pta: self test -2 prime pair conjecture (20 points)
- TCP/IP 三次握手四次挥手(面试题)
- Change according to the situation, the road to promotion in the second half of 2022
- 學習是一件逆人性的事情(成為高手的內功心法)
- 函数递归示例
- [LDA] basic knowledge notes - mainly AE and VAE
- Self induction of exception handling
- 粒子滤波学习记录
猜你喜欢

C escape character

ROS beginners write the server that the little turtle rotates a certain angle at a certain speed

odom坐标系的理解

Swap numbers, XOR, operator correlation

应势而变,2022年下半场的升级之路

Seaborn Brief

Pointer related concepts

C operator

左对齐,右对齐,随机数,goto,比较输出bool

Deepin20.6 RTX3080 安装显卡驱动510.60.02、CUDA11.6、PyTorch1.11
随机推荐
ROS中tf学习笔记
Learning is an inhumane thing (becoming an expert's internal mind skill)
2021-06-27
[LDA] LDA theme model notes - mainly Dirichlet
Rust小技巧 - 通过FFI编程运行tensorrt模型
Open Chinese path file in C language
C operator
野指针理解
Loadbalancer load balancer
Scala下载及IDEA安装Scala插件(保姆级教程超详细)
idea 拉取分支代码
JUnit exception, a method that asserts that the exception information is not empty
Alibaba, Tencent et pingduo sont à la recherche d'une nouvelle logique pour l'Internet industriel
[spark][core] what is an external shuffle service?
Some useful websites
C scanf函数
分布式并发重复提交问题
Jenkins' RPC test project
Qiming Zhixian shares the application scheme of 2.8-inch handheld central control screen
ES6新特性