Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the ways to retrieve the root password of linux system

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "what methods can be used to retrieve the root password of linux system". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Linux root password recovery method 1

Step 1: when the system enters the single-user state, use passwd root to change it directly.

Step 2: boot the system with the installation CD, perform linux rescue status, and attach the original / partition as follows:

Cd / mnt mkdir hd mount-t auto / dev/hdaX (the partition number of the original / partition) hd cd hd chroot. / passwd root

Step 3: remove the local hard drive and hang it on other linux systems in the same way as the second one.

Linux root password recovery method 2

Step 1: when booting the system with lilo: type linux single at the lilo: prompt

The screen shows lilo: linux single

Step 2: enter the linux command line directly.

Step 3: use the following command "vi / etc/shadow" to delete the first line, after root: and before the next:, that is, the line that begins with root. The first line will be similar to root::.. Save

Vi / etc/shadow

Step 4: restart reboot with empty root password.

Method 3 of linux root password recovery

Step 1: when booting the system with grub: when the grub screen appears, use the up and down keys to select the item where you usually start linux (do not select dos), and then press the e key

Step 2: use the up and down keys again to select the item where you normally start linux (similar to kernel / boot/vmlinuz-2.4.18-14 ro root=LABEL=/), and then press the e key

Step 3: modify the command line you see now and add single. The result is as follows:

Kernel / boot/vmlinuz-2.4.18-14 single ro root=LABEL=/ single

Step 4: enter and return, then press the b key to start, you can directly enter the linux command line.

Step 5: use the following command "vi / etc/shadow" to delete the contents of the first line, after root: and before the next:, that is, the line beginning with root. The first line will be similar to root::.. Save

Vi / etc/shadow

Step 6: restart reboot with empty root password.

This is the end of the content of "what are the ways to find the root password of the linux system". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report