现在账号密码太多了,一不小心就忘了某些密码,本文教你如何重置Centos系统的root密码,顺利登陆系统。
1. 首先,打开centos7,在选择进入系统的界面按“e”键进入编辑页面
2. 然后按向下键,找到以“Linux16”开头的行,在该行的最后面追加 “init=/bin/sh”
接下来按“ctrl+X”组合键进入单用户模式。
3. 依次输入命令
mount -o remount,rw /
passwd
touch /.autorelabel
exec /sbin/init
最后按回车,稍微等几分钟,系统会自动重启。
接下来验证密码是否已经修改成功:
第25次,即改了密码后,终于登录成功了!
最后初学Linux推荐《Linux就该这么学》这本书
特别声明:以上内容(如有图片或视频亦包括在内)为自媒体平台“网易号”用户上传并发布,本平台仅提供信息存储服务。
Notice: The content above (including the pictures and videos if any) is uploaded and posted by a user of NetEase Hao, which is a social media platform and only provides information storage services.