Forked from NetBSD. Theo de Raadt is the founder and leader of the OpenBSD project. The first OpenBSD release 1.1/CVS appeared on October 18, 1995.
Software and ideas developed or maintained by the OpenBSD project: https://www.openbsd.org/innovations.html
Choose your repository at: https://www.openbsd.org/anoncvs.html
Browse the source tree in your browser and read each file's revision history: https://cvsweb.openbsd.org
# How to read a man page, for example foo(5) ?
man 5 foo
Or view it on your browser at: https://man.openbsd.org
Really simple, ready in 5 minutes (KISS). The response file is emailed to the root user on next boot.
Get more information: https://www.openbsd.org/faq/faq4.html
For a full unattended install/upgrade process, you can easily use autoinstall(8).
OpenBSD use by default FFS2 (Enhanced Fast File System).
Read: newfs(8)
| /etc/myname | Default hostname |
| /etc/mygate | Default gateway |
| /etc/hosts | Known hosts on the network |
| /etc/resolv.conf | Resolver (DNS) |
| /etc/hostname.if | Configuration for each network interface, for example: /etc/hostname.bge0 |
Read: myname(5), mygate(5), hostname.if(5), resolv.conf(5), hosts(5)
# Display the current configuration of network interfaces
ifconfig
# Set DHCP for 're0' interface, on the fly
ifconfig re0 autoconf
# Perform network (re)initialisation
sh /etc/netstart
Your interface name depends on your hardware. Checkifconfigoutput and read the relevant man page (e.g.man iwx,man bge).
## File: /etc/hostname.re0
inet 192.168.0.58 255.255.255.0
Don't forget to run sh /etc/netstart re0 to apply changes to running system.
## File: /etc/hostname.bge0
inet autoconf
Don't forget to run sh /etc/netstart bge0 to apply changes to running system.
# First, see a list of available wireless networks:
ifconfig iwx0 scan
## File: /etc/hostname.iwx0
nwid ACCESS_POINT_NAME wpakey THE_SECRET_KEY
inet autoconf
# Or, for multiple access points
join AT_HOME wpakey THE_SECRET_KEY
join AT_WORK wpakey THE_SECRET_KEY
inet autoconf
Don't forget to run sh /etc/netstart iwx0 to apply changes to running system.
# Show the routing table (ipv4)
route -n show -inet
# Show the routing table (ipv6)
route -n show -inet6
# Delete all gateway entries from the routing table
route -n flush
# Disable PF
pfctl -d
# Check the rules
pfctl -nf /etc/pf.conf
# Enable PF and load the rules
pfctl -ef /etc/pf.conf
# Just load the rules (apply changes)
pfctl -f /etc/pf.conf
# View the loaded rules
pfctl -s rules
Read: pfctl(8)
## File: /etc/pf.conf
# Protect a laptop (allow only ping/ssh from anywhere)
# SSH protected by source limiter
set skip on lo
source limiter "ssh-protect" id 1 \
entries 10000 limit 3 rate 5/60
block log all
pass in on egress inet proto icmp all icmp-type echoreq
pass in on egress inet proto tcp from any to any port ssh \
source limiter "ssh-protect"
pass out
Read: pf.conf(5)
# Watch PF logs
tcpdump -nettti pflog0
# Watch traffic on egress (no DNS resolution)
tcpdump -n -i egress
# Filter by host / by port
tcpdump -n host 192.168.1.100
tcpdump -n port 22
# Watch DNS queries
tcpdump -n udp port 53
# Save capture to file / read it back
tcpdump -w capture.pcap -i egress
tcpdump -r capture.pcap
Read: tcpdump(8)
Network Management with the OpenBSD Packet Filter Toolset
(EuroBSDCon 2026)
# Manually
user [add|del|info|mod] foobar
# Add users interactively
adduser
# Remove users interactively
rmuser
Read: adduser(8), rmuser(8), user(8)
group [add|del|info|mod] foobar
Members in wheel group can use su(1) to become root.
Read: group(8), group(5), rmgroup(8)
## File: /etc/doas.conf
# Permit the user 'marc' to reboot the box
permit nopass marc as root cmd /sbin/reboot
# Marc can now reboot the box
$ doas reboot
Read: doas(1), doas.conf(5)
# By default, the /etc/installurl file already contains an OpenBSD mirror server URL
https://cdn.openbsd.org/pub/OpenBSD
# Search for packages
pkg_info -Q foobar
# For example, to install Squid
pkg_add squid
# Update packages
pkg_add -u
Look in /usr/local/share/doc/pkg-readmes for extra documentation.
Read: pkg_info(1), pkg_add(1), installurl(5)
# List packages installed
pkg_info
# List files installed by a package
pkg_info -L foobar
# View install-message for a specific package
pkg_info -M foobar
Read: pkg_info(1), packages(7)
# Delete a Package
pkg_delete foobar
# Show unused dependencies
pkg_delete -an
# Delete unused dependencies
pkg_delete -a
# Delete all except 'nginx'
pkg_delete -X nginx
Read: pkg_delete(1)
fw_update
Firmware is downloaded from release-specific directories at: https://firmware.openbsd.org/firmware
Read: fw_update(8)
rcctl [enable|disable|start|stop|reload|restart] foobar
# For example, to start the apmd(8) daemon for CPU scaling, you might do
rcctl enable apmd
rcctl set apmd flags -A
rcctl start apmd
Read: rcctl(8), rc.conf(8), rc.conf.local(8)
rcctl ls on
Read: rcctl(8)
Read: rc(8), rc.firsttime(8), rc.local(8), rc.securelevel(8)
Any security or reliability fixes can be found at:
https://www.openbsd.org/errata.html
Errata patches are generated for the 2 last releases (7.8, 7.9).
Use syspatch(8) to update your kernel and userland. Binary patches are generated for the 2 last releases only.
And pkg_add -u to update packages.
To upgrade 7.7 to 7.9, you need to follow instructions from: https://www.openbsd.org/faq/upgrade78.html
and then
https://www.openbsd.org/faq/upgrade79.html
sysupgrade(8), is a utility to upgrade OpenBSD to the next release or a new snapshot.
pkg_add sysclean
sysclean only lists. It removes nothing. Review the output, then delete what you no longer need.
| The most important to know! | |
|---|---|
| / | Root directory |
| /home | User home directories |
| /root | Default home directory for the superuser |
| /mnt | A temporary mount point |
| /etc | System configuration files and scripts |
| /etc/examples | Example configuration files for base system daemons |
| /etc/skel | (dot) files for new accounts |
| /etc/signify | Key files used for signify(1) |
| /tmp | Cleaned after a reboot |
| /var/tmp | Symbolic link to the system /tmp |
| /var/log | Log files |
| /var/run | pid, socket files, utmp, dmesg.boot |
| /var/db | Database files |
| /var/www | chroot directory for httpd(8) |
| /var/www/htdocs | Web repository for httpd(8) |
| /usr/local | Third-party software goes here |
| /usr/src | BSD and/or local source files |
Read: hier(7)
/bsd
The kernel itself, loaded into memory at boot. After each boot, KARL (Kernel Address Randomized Link) relinks it in random order, so every boot runs a unique kernel.
On a multiprocessor machine, the installer renames /bsd to /bsd.sp, then /bsd.mp to /bsd.
/obsd
Previous kernel, kept as a fallback when a new one is installed. If the new kernel fails to boot, start the previous one from the boot(8) prompt with boot /obsd.
/bsd.sp
Kernel executable for single processor machines.
/bsd.mp
Kernel executable for multiprocessor machines.
/bsd.rd
Installation kernel. The tools in its RAM disk work without a filesystem. Useful for system maintenance too.
config(8) can enable, disable or change devices in a kernel binary, with no recompile. The same editor is available at boot: type boot -c at the prompt, see boot_config(8).
These edits are lost on upgrade and block kernel relinking. Keep them in bsd.re-config(5) instead.
sysctl.conf(5) sysctl variables to set at system startup
sysctl(8) get or set kernel state
&
config(8) modify a kernel
| machdep.lidaction=0 | do nothing |
| machdep.lidaction=1 | suspend |
| machdep.lidaction=2 | hibernate |
| machdep.hibernatedelay=N | hibernate after N seconds of suspend (default: 0 = disabled) |
doas pkg_check -F |
Checks that there are no other random objects under /usr/local |
doas dmesg -s |
Review rc(8) system startup messages |
ldd foobar |
List dynamic object dependencies |
df -h |
See disk usage |
top -s .1 |
Check load (cpu/mem) |
Read: pkg_check(8), dmesg(8), ldd(1), ld.so(1), df(1), top(1)
reset |
reset your terminal when it gets messed up by control sequences |
rcctl ls on |
what is enabled on your system |
doas rcctl ls started |
what is running on your system |
Read: reset(1), rcctl(8)
ktrace -f ping.out \ |
proceed process tracing |
kdump -f ping.out |
interprets the data from ktrace into a human readable format |
Read: ktrace(1), kdump(1)
| screenfetch | Display system information in the terminal |
| w3m | Text-based web browser |
| noice | minimalistic file browser |
| pstree | List processes as a tree |
| tmate | Share your terminal on the web without open any ports |
| testdisk | Scan and repair disk partitions |
FAQ: https://www.openbsd.org/faq/
Manual page: afterboot(8)
Web IRC Channel: #openbsd on Libera.Chat
Mailing list: misc@
You can manage your OpenBSD mailing list membership at lists.openbsd.org.
It's time to create your own OpenBSD VM !
Join us on Telegram!
(Nice people, I promise.)