After Fresh Installation of FreeBSD 13.1

2022 07 02

Update FreeBSD, open a console in the system with root privileges and issue the following commands

# freebsd-update fetch
# freebsd-update install




To update the package manager and installed software run the below command

# pkg update
# pkg upgrade




Install Bash & Bash Completion

# pkg install bash bash-completion


Change user default shell.

# chsh -s /usr/local/bin/bash your_user



Install ClamAV

# pkg install clamav


Edit rc.conf

# vi /etc/rc.conf


Add the following.

clamav_freshclam_enable="YES"



Secure SSH
Open the SSH configuration file and update the line PermitRootLogin

# vi /etc/ssh/sshd_config


Look for the following line and if needed change to No

PermitRootLogin No


Save changes to sshd_config

# wq!


Restart SSH.

# service sshd restart



Configure FreeBSD Static IP
Edit /etc/rc.conf file to configure a static network IP address on FreeBSD

Run ifconfig -a to display a list of all NICs. Edit /etc/rc.conf file, comment the DHCP line and add your settings.

#ifconfig_em0="DHCP"
ifconfig_em0="inet 192.168.1.100 netmask 255.255.255.0"
#Default Gateway
defaultrouter="192.168.1.1"



Apply the new network settings

# service netif restart
# service routing restart




Editing /etc/rc.conf to set services that will start at boot time.
Here is an example rc.conf.

hostname=your_hostname

firewall_enable="YES"
firewall_quiet="YES"
firewall_type="workstation"
firewall_myservices="22/tcp"
firewall_allowservices="any"
firewall_logdeny="YES"

sshd_enable=”YES”

ntpd_enable="YES"
ntpd_sync_on_start="YES"

clamav_freshclam_enable="YES"

syslogd_flags="-ss"

clear_tmp_enable="YES"

apache24_enable="NO"
mysql_enable="NO"

sendmail_enable="NO"
sendmail_submint_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"