To boot into single user mode at startup:

- hit any key APART FROM ENTER when the system counts down from 10.
This will take you to the boot prompt.
- type ‘boot -s’ to boot into single user mode

After booting into single user mode, to be able to write any changes
/etc to disk you need to change the status of the / partition from read
only to read/write mode.  To do this execute:

/sbin/mount -u /

Note you should use the full path because /sbin may not be in your PATH
for one reason or another.

Now you can move on to fix any problems with /etc/rc.conf.  If you
really want to use ee(1) then you’ll need to first mount the partition
containing /usr/sbin since ee(1) resides there and if the partition
containing /usr/sbin isn’t mounted you won’t be able to use ee(1).

If /usr has it’s own dedicated partition you’d do:

mount /usr

generally.

Finally you should be able to do:

/usr/sbin/ee /etc/rc.conf

again using the full path to ee(1).

This is one of the reasons I forced myself to learn ed(1)/vi(1) – it’s the one
editor that’s generally available no matter what when you boot a system
in single user mode.

Next you will see a message as follows:

Enter pathname of shell or RETURN for sh:

Just hit [Enter] key to load sh shell.
Next mount / and /usr file system in read-write mode:
# mount -uw /
# mount /usr
Finally set or change the password for root user, enter:
# passwd
Press CTRL+D to boot into multiuser mode or just reboot server:
# reboot