In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
Centos7 forgot the root password
On the LINUX kernel option, press e on the first item, find the linux16 line, and finally add rd.break;ctrl+x, and then
Mount-o remount,rw / sysroot
Chroot / sysroot
Passwd-d root
Touch /. Autorelabel
Exit
Exit
Then change the password.
Or other means.
2. Set the password by GRUB
1. Modify / etc/grub.d/00_header and add: at the end of the file:
# admin grub,append by jason.wang 20181105
Cat insmod xfs
Grub > set root= (hd0,msdos1) (- > this is the boot partition you found in the previous step)
Grub > linux16 / vmlinuz-xxxxx root=/dev/mapper/centos-root
Grub > initrd16 / initramfs-.xxxxx.img
Grub > boot
If there is no problem, the system will boot normally at this time.
Repair grub
The above has entered the system, you can view the / boot/grub2/grub.cfg file at this time, it should be empty. You can fix grub with the following command.
Sudo grub2-mkconfig-o / boot/grub2/grub.cfg
Sometimes the Windows system is recognized using the sudo grub2-mkconfig command, but the configuration file / boot/grub2/grub.cfg for grub2 is not updated. Then add one more parameter-o
After the operation is complete, you can restart the confirmation.
Assignment:
1. Two ways to operate GRUB plus password
2. The solution for Centos7.5 to forget the password.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.