问题原文
原帖链接 · Niklas Rosencrantz · CC BY-SA 3.0
I have an old (Linux 2.4.20) Debian server where I forgot the root password. When I try to enter single user mode then some init script never exits. It used the LILO boot loader. I want to change the root password and therefore I tried booting to single user mode. But when I try and boot to single user mode the system won't boot all the way. It stops when trying to run a custom init shell script. It says executing....
Can you please advice me what I can do? I want to change to root password in single user mode but now I don't dare to reboot it because Crtl+Alt+Delete doesn't work for reboot during boot.
已采纳解答
原帖链接 · Marco · CC BY-SA 3.0
I'd boot via a live distro such as Debian Live or Knoppix, ensure you have access to local drives, gain root privilege using su - or sudo -s, depending on distro.
Mount the / partition and change root's password this way:
mkdir /mnt/youroot
mount /dev/youroot /mnt/youroot
chroot /mnt/youroot /bin/bash
passwd root
exit
umount /mnt/youroot
Reboot (remove live distro from cd/usb).
And that's it!
Edit #1: After your edit I'm assuming that you are using a remote KVM, and you can't just walk at the server and pull the cable, and so you have very few options. I'd just try Crtl+Alt+F2 (3,4,...12), Crtl+C, Crtl+Z, to check if I can get a prompt.
Check out the user manual for the KVM you are using because you should probably be able to issue a soft/hard reboot right from the remote console.
If you are still stuck at boot and can't reboot in any way you'll have to ask your hosting/provider to issue an hard reboot.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
