FreeBSD 7 Allow IP range to SSH to server – IPF

Edit IPF config

vi /etc/ipf.rules

Hit “i” to enter insert mode and add the following to allow SSH from the ip range. Change range if needed.

pass    in     quick on bge0 proto tcp from to any port = 22 flags S keep state

Save and exit the file by hitting “Esc” then typing “:wq” followed by enter.

And start IPF with new rules

ipf -Fa -f /etc/ipf.rules

Reset Root Password for FreeBSD

Boot up FreeBSD, when you get to the FreeBSD boot menu select “Boot FreeBSD in single user mode”

When you get to the following prompt hit enter.

When prompted Enter full pathname of shell or RETURN for /bin/sh:

You will now be booted in single user mode.

Run the following commands to mount the root drive as read and write.

mount -u /
mount -a

Now reset the root password with passwd

passwd root

Your now finished. You can type in “exit” to continue booting, or you can just reboot.