Skip to content

Instantly share code, notes, and snippets.

@mischief
Last active May 21, 2024 18:27
Show Gist options
  • Save mischief/11108056 to your computer and use it in GitHub Desktop.
Save mischief/11108056 to your computer and use it in GitHub Desktop.
openbsd cheatsheet

openbsd cheatsheet

manuals

manuals: man(1), apropos(1)

  • man man - read the manual for the pkg_info command.
  • man 5 ethers - read a manual in a specific section, such as ethers(5)
  • apropos <manname> - search for manuals by name

packages

manuals: pkg_info(1), pkg_mgr(1), pkg_add(1), pkg_delete(1)

  • pkg_info -Q <pkgname> - query for a package name
  • pkg_mgr - curses package manager
  • pkg_add -vi <pkgname> - install a package by name, prompting when an ambiguous package name is given
  • pkg_delete <pkgname> - remove a package

firewall

manuals: pf.conf(5), pfctl(8)

  • pfctl -vvsr | grep @ - view the expanded firewall rules with their rule number
  • $EDITOR /etc/pf.conf - edit the firewall rules
  • pfctl -Fr -f /etc/pf.conf - flush the current rules and load new ones from /etc/pf.conf

daemons

manuals: rc.d(8)

  • /etc/rc.d/<daemon> restart - restart a daemon

network management

manuals: ethers(5), hosts(5), dnsmasq(8)

  • $EDITOR /etc/ethers && $EDITOR /etc/hosts - add a static ip entry
  • $EDITOR /etc/dnsmasq.conf && /etc/rc.d/dnsmasq restart - edit dnsmasq's config for dns and dhcp configuration and then restart it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment