Just documenting some useful FreeBSD commands.

1. Adding a user

Option 1: adduser (interactive)

adduser

This will launch an interactive prompt asking for username, groups, shell, home dir, etc.

Option 2: Using pw (scriptable)

pw useradd <username> -m -s /bin/sh -G wheel

Then set the password:

passwd <username>

2. Enable SSH

1. Install OpenSSH (if not already installed)

Most FreeBSD installations come with OpenSSH by default. You can check with:

which sshd

If it’s not installed, you can install it via:

pkg install openssh

2. Enable SSH Service

To start SSH at boot, add this line to /etc/rc.conf:

sshd_enable="YES"

You can do this with:

sysrc sshd_enable=YES

3. Start SSH Service

Start the SSH daemon immediately:

service sshd start

4. Check Firewall (if applicable)

Ensure port 22 is open if you’re using pf or another firewall.

For pf, add to /etc/pf.conf:

pass in on egress proto tcp from any to any port 22

Then reload:

pfctl -f /etc/pf.conf

5. Verify SSH is Running

Check status:

service sshd status

Or check listening port:

sockstat -4 -l | grep ssh