For the complete documentation index, see llms.txt. This page is also available as Markdown.

17.2 bsdconfig

bsdconfig System Configuration Tool Overview

bsdconfig is a text-based configuration tool for FreeBSD, used for new system installation and configuration of existing systems. Unlike bsdinstall (used during installation), bsdconfig can be used at any time for configuration management.

The source code for bsdconfig is hosted at https://github.com/freebsd/freebsd-src/tree/main/usr.sbin/bsdconfig

Tip

bsdconfig also supports pure character command-line mode.

bsdconfig Main Menu Functions and Operations

The bsdconfig main menu provides various functional modules for system configuration. If FreeBSD is already installed, you can use this menu to customize the system configuration. You can use the pkg tool to install additional third-party software that is not included in the base system.

Execute the command:

# bsdconfig

The output will be as follows:

┌--------------------┤Main Menu├-------------------┐
 If you've already installed FreeBSD, you may use │
│ this menu to customize it somewhat to suit your  │
│ particular configuration.  Most importantly, you │
│ can use the Packages utility to load extra '3rd  
 party' software not provided in the base         │
│ distributions.                                   │
│ ┌----------------------------------------------┐ │
│ │         X Exit                               │ │
│ │         1 Usage                              │ │
│ │         2 Documentation installation         │ │
│ │         3 Packages                           │ │
│ │         4 Root Password                      │ │
│ │         5 Disk Management                    │ │
│ │         6 Login/Group Management             │ │
│ │         7 Console                            │ │
│ │         8 Timezone                           │ │
│ │         9 Mouse                              │ │
│ │         A Networking Management              │ │
│ │         B Security                           │ │
│ │         C Startup                            │ │
│ │         D Ttys                               │ │
│ └----------------------------------------------┘ │
├--------------------------------------------------┤
│[      OK      ] [Exit bsdconfig] [     Help     ]│
└--------------------------------------------------┘

Shortcut key explanation: The number or letter before the option name indicates that pressing the corresponding key selects that item. For example, pressing 1 selects 1 Usage, and pressing uppercase A selects A Networking Management.

Option
Description

X Exit

Exit

1 Usage

bsdconfig usage instructions

2 Documentation installation

Install documentation

3 Packages

Packages

4 Root Password

Root password

5 Disk Management

Disk management

6 Login/Group Management

Login management/group management

7 Console

Console

8 Timezone

Timezone

9 Mouse

Mouse

A Networking Management

Network management

B Security

Security

C Startup

Startup items

D Ttys

TTY

OK

Confirm

Exit bsdconfig

Exit

Help

Help

1 Usage Instructions

Selecting this item will pop up a window displaying detailed usage instructions, with the following content:

How to Use This System

======================

[After reading the contents of this screen, press PageDown to proceed to the next screen]

During this installation process, most dialog boxes support the following key operations:

Key
Action

Spacebar

Select or toggle the current item.

Enter

Complete the operation for a menu or item.

Up arrow

Move to the previous item (or scroll up in a text display box).

Down arrow

Move to the next item (or scroll down in a text display box).

Tab

Move to the next item or group.

Right arrow

Move to the next item or group (same as Tab).

SHIFT + Tab

Move to the previous item or group.

Left arrow

Move to the previous item or group (same as SHIFT + Tab).

PAGE UP

Scroll up one page in a text display box.

PAGE DOWN

Scroll down one page in a text display box.

F1

Display related help text.

If you see small ^(-) or v(+) symbols at the edge of a menu, it indicates that there are more items above/below the current view due to insufficient screen space. In a text display box, the amount of text above the current position is displayed as a percentage in the lower right corner. Use the Up/Down arrow keys to scroll line by line, and PageUp/PageDown keys to scroll by page.

Selecting OK in a menu confirms the operation it controls. Selecting Cancel cancels the operation, typically returning to the previous menu. Use Tab to move the cursor and select buttons.

Most interfaces have a Help button. It is recommended to make full use of this feature, as it usually provides useful contextual hints; if you are unsure about an operation in a configuration menu, select Help.

Special Features

======================

If the first letter of a menu item name is unique, typing that letter will select the menu item. Typically, it is the item's number.

The console driver includes a scrollback buffer for viewing content that has scrolled off the screen. To use the scrollback feature, press the Scroll Lock key on the keyboard, then use the arrow keys or Page Up/Page Down keys to scroll through the saved text. To exit scrollback mode, press the Scroll Lock key again. This feature is useful for viewing boot messages and is also applicable when working with sub-shells or other "expert modes" that do not use menus and whose output often scrolls to the top of the screen.

FreeBSD also supports multiple "virtual consoles," which can be used for multiple simultaneous sessions. Use ALT + F to switch screens, where F<number> is the function key corresponding to the screen you wish to view. By default, the system enables 8 virtual consoles (ttyv0 through ttyv7); you can enable more virtual consoles by editing the /etc/ttys file, changing the "off" field of the relevant vty entries to "on" (enabling the 9th and above also requires manually adding new entries). The default kernel supports up to 12 virtual terminals (which can be increased to a maximum of 16 by rebuilding the kernel with the VT_MAXWINDOWS kernel option).

2 Documentation Installation

FreeBSD documentation can be installed via bsdconfig.

Select and install the documentation for the desired languages.

Note

It is not recommended to install Chinese documentation (whether Simplified or Traditional), as its content updates lag far behind the English documentation.

3 Packages

The 3 Packages menu is used to configure the installation method for FreeBSD packages.

Option
Description

CD/DVD

Install from FreeBSD CD/DVD

HTTP Proxy

Install from an FTP server through an HTTP proxy

HTTP Direct

Install directly from an HTTP server

Directory

Install from an existing filesystem

NFS

Install over NFS

DOS

Install from a DOS partition

UFS

Install from a UFS partition

USB

Install from a USB device

Options

View/set various media options

3 HTTP Direct

Select the most suitable site, or select "other" to specify a different site. "Main Site" directs users to the nearest official mirror via GeoDNS (carrying the full range of distributions and supporting both IPv4 and IPv6). Other sites are known as "Community Mirrors"; not every site carries more than the base distribution kits. Select a site.

If you select "pkg Main Site (GeoDNS) pkg.freebsd.org", you will be directed to the FreeBSD official mirror site;

If you select "URL Specify some other http site by URL":

Specifying a domestic mirror site may not work.

Options

Option
Description

NFS Secure

NFS secure

NFS Slow

NFS Slow

NFS TCP

NFS TCP

NFS version 3

NFS version 3

Debugging

Debugging

Yes to All

Yes to all

DHCP

DHCP

IPv6

IPv6

Editor

Editor

Release Name

RELEASE version

Media Type

Media type

Media Timeout

Media timeout

Package Temp

Package cache

Re-scan Devices

Re-scan devices

Use Defaults

Restore default configuration

4 Root Password

This menu is used to change the root user password. The entered password is displayed as *** on the screen.

5 Disk Management

This interface is the same as the partition management interface in bsdinstall, and the operation method is also identical.

6 Login/Group Management

Operation
Description

X Exit

Exit

Add Login

Add login

Edit/View Login

Edit/view login user

Delete Login

Delete login user

- -

Separator

Add Group

Add group

Edit/View Group

Edit/view group

Delete Group

Delete group

"Edit/View Login" Edit Login User

Using the created user account ykla as an example:

The following information for ykla can be modified:

Item
Description

X Save/Exit

Save and exit

Login: ykla

Login name: ykla

Full Name: User &

Full name: User &

Password: -----

Password: -----, can be modified

UID: 1001

User ID: 1001

Group ID: 1001 (ykla)

Group ID: 1001 (ykla)

Member of Groups: wheel

Member of groups: wheel

Login Class:

Login class:

Password Expires on:

Password expiration date:

Account Expires on:

Account expiration date:

Home Directory: /home/ykla

Home directory: /home/ykla

Shell: /bin/sh

Shell: /bin/sh

Create Home Directory: N/A

Create home directory: N/A

Create Dotfiles: No

Create dotfiles: No

"Edit/View Group" Edit/View Group

Using the ykla group of the created user account ykla as an example:

Item
Content

X Save/Exit

Save and exit

Group: ykla

Group: ykla

Password: -----

Password: -----

Group ID: 1001

Group ID: 1001

Group Members:

Group members:

7 Console

Menu
Description

X Exit

Exit this menu

2 Font

Choose an alternate screen font

3 Keymap

Choose an alternate keyboard layout

4 Repeat

Set key repeat rate

5 Saver

Configure screen saver

6 Screenmap

Choose an alternate screen map

7 Ttys

Choose console terminal type

  • "2 Font" is primarily for Western European character set configuration.

  • "5 Saver" screen saver configuration is covered in other chapters.

  • "6 Screenmap" is primarily for Western European character set configuration.

  • "7 Ttys" is primarily for Western European or Russian regional configuration.

8 Timezone

The configuration is the same as bsdinstall and will not be repeated here.

9 Mouse

You can run the mouse daemon to cut and paste in the text console. You need to specify the port and mouse protocol type before enabling the daemon. If you do not want this feature, select 6 to disable the daemon.

After enabling the mouse daemon, you can set /dev/sysmouse as the mouse device and select SysMouse or MouseSystems as the mouse protocol when running the X configuration tool (see the Configuration menu).

Menu
Description

X Exit

Exit this menu

2 Enable

Test and run the mouse daemon

3 Type

Select mouse protocol type

4 Port

Select mouse port

5 Flags

Set additional flags

6 Disable

Disable the mouse daemon

2 Enable Test and Run the Mouse Daemon

3 Type Select Mouse Protocol Type

If the mouse is connected to the PS/2 mouse port or the bus mouse port, you should always choose "Auto", regardless of the model and brand of the mouse. All other protocol types are for serial mice and should not be used with PS/2 port mice or bus mice. If you have a serial mouse and are not sure about its protocol, you should also try "Auto". It may not work for the serial mouse if the mouse does not support the PnP standard, but it won't cause any harm. Many 2-button (left and right) serial mice are compatible with "Microsoft" or "MouseMan". 3-button serial mice (left, right, and middle buttons) may be compatible with "MouseSystems" or "MouseMan". If the serial mouse has a scroll wheel, it may be compatible with "IntelliMouse".

Menu
Description

1 Auto

Bus mouse, PS/2 style mouse, PnP serial mouse

2 GlidePoint

ALPS GlidePoint touchpad (serial)

3 Hitachi

Hitachi tablet (serial)

4 IntelliMouse

Microsoft IntelliMouse (serial)

5 Logitech

Logitech protocol (old models) (serial)

6 Microsoft

Microsoft protocol (serial)

7 MM Series

MM Series protocol (serial)

8 MouseMan

Logitech MouseMan/TrackMan (serial)

9 MouseSystems

MouseSystems protocol (serial)

A ThinkingMouse

Kensington ThinkingMouse (serial)

A Networking Management

Note

Due to the inability to input passwords, this interface cannot connect to Wi-Fi. This issue has been reported as a bug, see Cannot select any wifi or input password in bsdconfig.

Menu
Description

X Exit

Exit

1 Hostname/Domain

Hostname/domain

2 Network Interfaces

Network interfaces

3 Wireless Networks

Wireless networks

4 Default Router/Gateway

Default router/gateway

5 DNS nameservers

DNS name servers

B Security

This menu is used to configure the operating system security policy. Before modifying settings, you should carefully read the system documentation to avoid service disruption caused by improper operations. Most settings will only take effect after a system reboot.

Menu
Description

X Exit

Exit this menu

2 [ ] Securelevel

Configure system securelevels

3 [X] NFS port

Require NFS clients to use reserved ports

2 [ ] Securelevel Configure System Securelevels

This menu allows you to select the securelevel at which the system runs.

When operating at a securelevel, certain root privileges are disabled, which may increase resistance to exploits and protect system integrity.

Secure mode descriptions:

  • In Secure mode, the root user cannot override system flags (parameters or configurations), access to kernel memory is restricted, and kernel modules cannot be changed.

  • In Highly Secure mode, mounted filesystems cannot be modified directly on disk, and the system clock cannot be changed.

  • In Network Secure mode, modifications to firewall configurations are not allowed.

C Startup

Menu
Description

X Exit

X Exit

1 Toggle Startup Services

1 Toggle startup services

2 View/Edit Startup Configuration

2 View/edit startup configuration

3 Miscellaneous Startup Services

3 Miscellaneous startup services

1 Toggle Startup Services

You can enable or disable all currently available system startup items.

2 View/Edit Startup Configuration

Menu
Description

X Exit Return to previous menu

Exit Return to previous menu

> Add New Add new directive

Add New directive

> Delete Delete directive(s)

Delete Delete directive(s)

View the configuration of currently active startup items.

Details

Menu
Description

R Reset Reset to default view settings

R Reset Restore default view settings

D [X] Description Toggle display of system description

D [X] Description Toggle display of system description

1 (*) Show Value Show configured startup value (fast)

1 (*) Show Value Display configured startup value (fast loading)

2 ( ) Show Default/Value Show default/configured values (slow)

2 ( ) Show Default/Value Display default/configured values (slow loading)

3 ( ) Show Configured Calculate rc.conf(5) locations (slowest)

3 ( ) Show Configured Calculate rc.conf(5) locations (slowest loading)

3 Miscellaneous Startup Services

This menu is used to configure various aspects of the system startup configuration.

Use [Spacebar] or [Enter] to select items, and [Tab] to move to buttons. Select Exit to leave this menu.

Menu
Description

X Exit Exit this menu

X Exit Exit this menu

--

--

1 [X] Startup dirs Set the list of dirs to look for startup scripts

1 [X] Startup dirs Set the list of directories to search for startup scripts

2 [ ] named Run a local name server on this host

2 [ ] named Run a local name server on this host

3 [ ] named flags Set default flags to named (if enabled)

3 [ ] named flags Set default flags for named (if enabled)

4 [ ] NIS client This host will be an NIS client

4 [ ] NIS client This host will be an NIS client

5 [ ] NIS domainname Set NIS domainname (if enabled)

5 [ ] NIS domainname Set NIS domainname (if enabled)

6 [ ] NIS Server This host will be an NIS server

6 [ ] NIS Server This host will be an NIS server

--

Separator

7 [ ] Accounting This host will run process accounting

7 [ ] Accounting This host will run process accounting

8 [ ] lpd This host has a printer and will run lpd

8 [ ] lpd This host has a printer and will run lpd

D Ttys TTY

If you select [Yes], the /etc/ttys file will be opened in a text editor.

References

Exercises

  1. Add a custom sysctl configuration through bsdconfig's "View/Edit Startup Configuration", and trace how the configuration is written to rc.conf and ultimately takes effect through startup scripts.

  2. Use bsdconfig's command-line mode to configure a network interface, and compare the operational path differences between the graphical interface and command-line approaches.

  3. Compare the differences between bsdconfig and traditional manual rc.conf editing in terms of configuration efficiency and ease of use.

Last updated