Linux恢复root密码的方法两则
Linux root密码忘记了,要怎么恢复?虽然这种情况不是很常见,但是你长时间没有登录系统就会把它忘记了。不要说是Linux root密码了,就普通的账号和密码你有一段时间没有登录都会忘了,这个是很正常的事情啊!Linux root用户是Linux系统的最高权限用户,一旦密码忘记将会带来很多的困扰,那要怎么样才能恢复Linux root密码? 那么下面就给大家说一下恢复Linux root密码的两种解决办法。
第一种恢复模式:单用户模式的密码恢复
1、重启Linux系统,看到如下界面时按下“e”键;

2、按下“e”键之后我们会看到下面这个界面,再次按下“e”键;

3、按完上一次“e”键后我们来到了下面这个界面,如果出现的和本图不一样,就找到有kerner字样的那一行,然后再次按下“e”键;

4、我们会进到如下这个页面,在quiet后面空一个格然后输入single;

5、完成之后敲回车(即Enter键)会回到如下所示的界面,在这个界面按下“b”;

6、随即我们会进到这么页面;

7、输入如下类容表示进行root密码的更改,我们可以看到提示了个update successfully表示修改成功,然后输入reboot重启,就会进入到用户登录界面,输入刚才修改的密码就可以登陆了;

第二种恢复模式:光盘恢复(主要是通过光盘进入救援模式进行恢复)
1、假设我们无法使用第一种方式进行密码修复,将Linux安装关盘放入光驱,然后启动电脑我们会看到如下所示的页面;

2、然后输入图片上的内容,紧接着回车,系统将进入救援模式;

3、进入救援模式之后,要求我们选择语言一般我们默认回车确定就好;

4、选择键盘模式;

5、提示是否设置网卡信息,一般不设置,我们用tab键切换到no即可;

6、然后会到达这个界面,我们直接回车,它会自动去检测系统;

7、完成之后我们会看到如下界面,他会显示系统的挂载信息,我们直接回车选择OK就好;

8、然后照着键入如下内容就完成了,然后重启电脑就行了,注意在重启之前我们要断开与光驱的连接,然后就会进入用户登录界面,输入之前更改的密码就可以登陆了;

注意事项:此版本为Linux red hat 5.0系统的密码恢复,但也适用与其他Linux系统的root密码恢复,大概步骤都差不多,没有太大差异。
上面就是给大家带来关于恢复Linux root密码的两种解决办法,有需要的朋友可以参考下,两种解决办法随便选择一种即可!
相关文章:
1. 更新FreeBSD Port Tree的几种方法小结2. win10系统怎么设置鼠标指针在打字时隐藏? win10隐藏鼠标指针的方法3. 统信UOS家庭版开始内测 无需分区全自动安装4. 深度操作系统15.5正式版怎么样?新增了哪些内容?(附下载地址)5. Centos7安装Chacha20加密算法详解6. 基于 Ubuntu 20.04 LTS,KDE neon 20221222 版本发布7. Linux Mint系统怎么卸载程序? Linux卸载不需要应用的技巧8. 电脑怎么安装双系统?Win11 和 Win7双系统安装图文教程9. ThinkPad X13如何用U盘重装系统?ThinkPad X13使用U盘重装系统方法10. 企业 Win10 设备出现开始菜单和任务栏快捷方式消失问题,微软展开调查
