Exactly what happens when you replace quiet splash
or splash quiet
(the order doesn't matter) by single
depends on the distribution. Most distributions will ask for a root password.
If you don't remember the root password, or you just want to boot in the most minimal way, you can replace quiet splash
(and $vt_handoff
, for that matter) by init=/bin/bash
. The line should look like
linux /vmlinuz-… root=… ro init=/bin/bash
The amount of whitespace between the parts doesn't matter, just leave at least one space wherever there was one before. The parts that I replaced by …
above do matter, you must leave what was there before. Remove everything except for the leading word linux
, the word after that, root=…
and ro
, and add init=/bin/bash
.
When you boot, you'll get a bash command line, running as root. When you have physical access, the only security that could prevent you from getting in is encryption. (If your system has full-disk encryption, you will need to enter the encryption password.)
At this command line, run the following commands:
mount -o remount,rw /
mount /proc
Then you can view and modify the user database. The main user database file is /etc/passwd
. It contains user names (for both physical users and system accounts), but passwords are in a different file /etc/shadow
. Both files are human-readable up to a point. You cannot recover passwords though; if you've forgotten a password, all you can do is change it.
The following command lists accounts that have a password:
grep -v ':[*!]:' /etc/shadow
(Type it carefully, it's pretty sensitive to the exact punctuation.) The first part of each line, before the first :
sign, is the username.
If you want to change the password for an account, run
passwd rob
where rob
is the username.
Once you've noted the username and changed the password if desired, run
mount -o remount,ro /
reboot
/etc/passwd
? – Angew is no longer proud of SO Nov 20 '17 at 9:11