Home > Article > Operation and Maintenance > How to reset Linux password if you forget it
# Recommended: "How to reset the Linux password if you forget it: first hit "e" on the kernel; then change the content on the linux16 line to "rw rd.break"; then enter the system's emergency rescue mode. And enter passwd and other commands in sequence; finally restart the service.
linux tutorial 》
People who are new to Linux may be at a loss if they forget the root password. I want to retrieve my root password, but I don’t know how. In fact, you only need a few simple steps to reset your root password (I don’t know how to retrieve it)1. After booting, type on the kernel, and then edit Option
According to the prompts, use the key combination
CTRL X to enter the password modification
# chroot /sysroot //进入系统的根目录 # passwd //重置密码 # touch /.autorelabel //创建文件,让系统重新启动时能够识别修改 # exit 退出chroot模式 # reboot //重启系统
##5. Restarting is a bit slow, you need to wait patiently for a while, and you can use it after restarting Log in with the password you just reset
# passwd //之后会提示输入新密码 输入之后修改成功!
Change the password of a general user as root:
# passwd username(要更改密码的用户名)
The above is the detailed content of How to reset Linux password if you forget it. For more information, please follow other related articles on the PHP Chinese website!