CentOS
-
When system booting, press Space bar to interrupt the GRUB process;
-
Press "a" and
; -
When see "rhgb quiet", add " 1" after "quiet" and press
;
Now CentOS boot in single user mode, you login as root, use passwd
to reset password.
Mint
-
When system booting to the GRUB 2 menu, select the system entry you want to recover, press "e";
-
In the start script, find the line "linux ... ro quiet splash $vt_handoff";
-
Modify "ro" to the end of line to "rw init=/bin/bash";
-
Press Ctrl-x to continue system start;
-
Now you are in root shell, reset root password with
passwd
; -
Press Ctrl-Alt-Del to restart machine;
Verified on Linux Mint 17.
Ref: Reset forgotten/lost main user password in Linux Mint 12+