5.19. Single User Mode

In single-user mode there is direct access to the root account so that you can recover passwords, repair and do administrative work. Its not intended for everyday use.

5.19.1. Requiring a password for single user mode

If you should want the system does not ask for a password to enter for single-user mode then you need to tell the system to ask for a password. In /etc/ttys, change:

console none                            unknown off secure

to:

console none                            unknown off insecure

Next time you enter single user mode, you will be prompted for the root password.

Warning: Consider this action carefully before implementing. If you forget the root password or the password files get mangled in some way, you could lock yourself out of the system.

5.19.2. Repairing a file in single user mode

If you have somehow mangled a file which prevents the system from booting into multiuser mode, the system will boot into a "read-only" single user mode. To be able to edit files, when your systems has booted into single user mode, press ENTER when prompted for a shell. then enter the following commands:

# adjkerntz -i
# swapon -a
# fsck -p
# mount -u /
# mount -a -t ufs
# ee /etc/rc.conf (or # vi /etc/rc.conf)
# reboot