Home > Operation and Maintenance > Linux Operation and Maintenance > How to reset administrator password in linux

How to reset administrator password in linux

王林
Release: 2020-03-13 15:51:26
Original
4181 people have browsed it

How to reset administrator password in linux

Environment:

RHEL 7 system

Reset method:

1. Confirm that you are installing RHEL 7 system

cat  /etc/redhat-release
# 接着会弹出这样的信息
Red Hat Enterprise Linux Server release 7.0 (Maipo)
Copy after login

2. Restart

reboot
Copy after login

Recommended tutorial: linux tutorial

3. Restart the Linux system and the boot interface appears. Press "E" on the keyboard " key to enter the kernel editing interface

How to reset administrator password in linux

In the interface that appears immediately, use the direction "↓" key to scroll down, find the line starting with "linux16", and use the direction key or press the "End" key to move the cursor to the end, append the "rd.break" parameter,

and then press the Ctrl X key combination to run the modified kernel program

How to reset administrator password in linux

After about 10 seconds, enter the emergency rescue mode of the system

How to reset administrator password in linux

Finally, enter the following commands in sequence, wait for the system restart operation to complete, and then You can use a new password (you can enter your password where "New password:" appears). Here I set it to "1201" (the actual production environment password must be complex enough to ensure security). After restarting, you can use the new password. Password to log in.

The input command is as follows:

mount -o remount,rw  /sysroot
chroot  /sysroot
passwd
touch  /.autorelabel
exit
reboot
Copy after login

Recommended related video tutorials: linux video tutorial

The above is the detailed content of How to reset administrator password in linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template