centos:
1. grub 启动 界面 按 'e' 进入编辑模式
2. 修改 kernel /vmlinuz-2.6.18-194.el5 ro root=LABEL=/ 为
kernel /vmlinuz-2.6.18-194.el5 ro root=LABEL=/ single
3. boot 启动
debian:
1、在grub的引导装载程序菜单上,选择你要进入的条目,键入 “e” 来进入编辑模式
2. 找到此行 linux /vmlinuz-2.6.32-5-686 root=UUID=****** ro quiet 在末尾加入 init=/bin/bash
3. 组合键 ctrl + x 启动
4. 进入 shell ,执行命令
mount -no remount,rw /
再执行命令
passwd root
之后提示输入新的unix密码
5. reboot 重启