克雷波波 發表於 2024-2-16 00:00:00

Ubuntu 下忘记用户名和登录密码的解决方法

<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        今天去公司实习,公司给我配了一台旧电脑,电脑上装了双系统(XP和Ubuntu),可Ubuntu系统开机需要用户名和密码,这时怎么办呢?(我琢磨着原来使用这台电脑的员工肯定已经离开公司了,还是自己想办法解决吧)最终在网上找到了修改用户名和密码的方法。如下</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        <strong>(1)首先Restart系统(右上角下拉后有个选项)</strong></p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        <img style="max-width:100%!important;height:auto!important;"title="Ubuntu 下忘记用户名和登录密码的解决方法" alt="Ubuntu 下忘记用户名和登录密码的解决方法" src="https://zhuji.jb51.net/uploads/img/202305/0e067937e1be08616d14c527fd203c08.jpg"></p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        <strong>(2)长按Shift键,直到出现下面菜单。选择recovery mode,也就是恢复模式。</strong></p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        <img style="max-width:100%!important;height:auto!important;"title="Ubuntu 下忘记用户名和登录密码的解决方法" alt="Ubuntu 下忘记用户名和登录密码的解决方法" src="https://zhuji.jb51.net/uploads/img/202305/e1af5ccaa5bc7471ca22369a522d7b86.jpg"></p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        <strong>(3)接下来会进入如下界面,选择Drop to root shell prompt ,也就是获取root权限。</strong></p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        <img style="max-width:100%!important;height:auto!important;"title="Ubuntu 下忘记用户名和登录密码的解决方法" alt="Ubuntu 下忘记用户名和登录密码的解决方法" src="https://zhuji.jb51.net/uploads/img/202305/c4e3e49a0c1caeb338bddd6da63cf24f.jpg"></p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        <strong>(4)在下面的# 后面敲入 cat /etc/shadow 查看用户名(如果连用户名都忘记的话)</strong></p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        <img style="max-width:100%!important;height:auto!important;"title="Ubuntu 下忘记用户名和登录密码的解决方法" alt="Ubuntu 下忘记用户名和登录密码的解决方法" src="https://zhuji.jb51.net/uploads/img/202305/d21344310ea2c6d48f7495093e39c6bf.jpg"></p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        <strong>(5)敲入:passwd "yulongsheng" 之后再敲两次密码就可以了。</strong></p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        <img style="max-width:100%!important;height:auto!important;"title="Ubuntu 下忘记用户名和登录密码的解决方法" alt="Ubuntu 下忘记用户名和登录密码的解决方法" src="https://zhuji.jb51.net/uploads/img/202305/400b8d8870b395ecb730324b71fb3b97.jpg"></p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        <strong>(6)重启系统。</strong></p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        OK,搞定。<br><br><font color="#ff0000">其它网友补充:</font><br><br>
        1、重新启动,按ESC键进入Boot Menu,选择recovery mode(一般是第二个选项)。 <br>
        2、在#号提示符下用cat /etc/shadow,看看用户名。 <br>
        3、输入passwd “用户名”(引号要有的哦)。 <br>
        4、输入新的密码。 <br>
        5、重新启动,用新密码登录。</p>
頁: [1]
查看完整版本: Ubuntu 下忘记用户名和登录密码的解决方法