General

OpenBSD for Linux Customers

Quickstart Info#

Introduction#

This quickstart manual is supposed to rapid familiarize GNU/Linux users with the basics of OpenBSD and must quiet highlight about a of the technical differences between OpenBSD and the many GNU/Linux based distributions. It is miles not supposed to be an exhaustive record of differences, nor will it highlight the somewhat gorgeous philosophical differences between OpenBSD and GNU/Linux.

The manual assumes that OpenBSD is already build in and the user has entry to the CLI. An installation manual may simply additionally be chanced on here.

The shell#

Bash is not the default shell on OpenBSD and neither is zsh. As a change, the default shell is Korn shell (ksh) for both root and traditional users. The so-known as repeat language of ksh is a superset of the sh shell language. This means that each one sh code may simply additionally be bustle from ksh but not all ksh code may simply additionally be bustle from an sh shell.

Assorted shells, alongside with Bash and zsh, are accessible in for installation (pkg_add bash zsh as root, chsh -s bash as user). It is endorsed that the muse user’s shell stays unchanged because non-default shells are build in in the “/usr/local/bin/“ list, which by default is on a non-root partition. In case of a arena where greatest the muse partition may simply additionally be mounted, the muse user set not want a shell accessible for it to employ and fix the pickle. The ksh shell does not bag this arena since it is build in in “/bin” on the muse partition.

Sudo -> Donate#

The sudo repeat is not accessible by default on OpenBSD. As a change, OpenBSD makes employ of the doas repeat. There’s no default config in space for doas but there’s an instance file known as doas.conf in /and so on/examples/. To start out, copy the file to /and so on: cp /etc/examples/doas.conf /etc/.

By default, the doas repeat will question for a password every time the repeat is invoked. To swap this behaviour and win it more like most sudo implementations (where a a hit authentication is cached for some short timeframe), add the persist probability like in the snippet beneath.

# Allow wheel by defaultpermit persist keepenv :wheel

The sudo repeat/equipment is accessible for installation: pkg_add sudo. The two commands may simply additionally be outmoded interchangeably.

Machine#

Set up#

Further tool programs may simply additionally be build in using the “pkg_add” repeat. OpenBSD programs are pre-compiled tool programs and work in a technique an honest like rpm and deb programs outmoded by respectively Redhat, Debian, and their respective derivatives. As an illustration, to install the NginX webserver, employ the next repeat:

$ doas pkg_add nginx

Programs which bag beforehand been build in with the pkg_add repeat, may simply additionally be deleted using the “pkg_delete” repeat.

$ doas pkg_delete nginx

Updating#

The OpenBSD philosophy is that the programs in a definite release must be trusty. This means that there there will likely be no updates for a equipment except something is damaged. So as to fix damaged programs, patches are launched. These patches may simply additionally be utilized using the syspatch repeat. Employ the argument “-c” to greatest present the accessible patches for a system.

$ doas syspatch -c$ doas syspatch

Upgrading#

The purpose of OpenBSD is to type a brand current release about each 6 months. An OpenBSD system may simply additionally be upgraded using the sysupgrade repeat. The Upgrading OpenBSD part on this space supplies more records on the support course of.

$ doas sysupgrade

The sysupgrade repeat upgrades the hideous system. Any programs build in using pkg_add must be up to this point individually using the pkg_add repeat.

$ doas pkg_add -Uu

Networking#

Whereas in GNU/Linux distributions network interfaces bag a generic name like eth0, eth1, and so on, in OpenBSD network interfaces are named using the shorthand name of the motive force for that network interface. As an illustration, Realtek network interface cards will likely be known as re0, re1, and so on, while Broadcom network interface cards will likely be known as bge0, bge1, and so on.

IP configuration#

The IP configuration is determined using the hostname.if file where the “if” segment stands for the name of the network interface on the system. The predominant segment, “hostname”, is not a variable for the explicit hostname of the system. Utilizing the instance above, the file “/and so on/hostname.re0” would bag the configuration for the re0 Realtek network interface.

The tell material of the hostname.if file for an inside of interface may peep something like the next.

inet 10.0.0.100 255.255.255.0

For an interface that has both IPv4 and IPv6 enabled, the file appears to be like this.

inet xx.xx.xx.xx 255.255.255.0inet6 xxxx:6000:9344::154 64 -soii

So as to enable DHCP on an interface, the config appears to be like this.

dhcp

Manually surroundings the interface configuration is additionally most likely and can simply additionally be executed using the ifconfig repeat. Behold the beneath for an instance but take hang of into story that these modifications are greatest brief. So as to win them permanent, add the config to the respective configuration file.

$ doas ifconfig re0 10.0.0.100 255.255.255.0

So as to look at any modifications made in the configuration files to the network interface, the network must be restarted. In OpenBSD, this is executed using the an identical script that is invoked for the duration of in the startup course of: /and so on/netstart. Develop the script to reload all network configurations but it completely’s additionally most likely to type an interface name as argument and to restart that instruct interface.

$ doas sh /etc/netstart re1

Hostname#

The default hostname is determined in a file known as /and so on/myname. The file must quiet bag a single line specifying the fully licensed domain name (FQDN) of the system. The name must quiet be resolvable, either by matching a hostname specified in /and so on/hosts or through DNS.

host.example.com

Employ the sh /etc/netstart repeat to look at any modifications.

Gateway#

The default gateway is determined in the /and so on/mygate file. If the file does not exist or is empty, no default gateway is determined. The file may simply bag an IPv4 address, an IPv6 address, or both on separate strains. In case more than one address from the an identical address family is added, greatest the principle will likely be outmoded.

192.0.2.1xxxx:6000:9344::1

Employ the sh /etc/netstart repeat to look at any modifications.

DNS#

The name server configuration is printed in the /and so on/resolv.conf file.

nameserver 192.0.2.1lookup file bind

Employ the sh /etc/netstart repeat to look at any modifications.

Daemons#

Init#

Whereas most GNU/Linux distributions employ either SystemD or the SysV init system, OpenBSD makes employ of the ragged BSD-type init system. BSD-type skill that there don’t seem to be any bustle-phases and there’s no inittab. As a change, startup is controlled by init and rc scripts.

The system defaults may simply additionally be show in /and so on/rc.conf but that file must quiet not be edited straight. As a change, the /and so on/rc.conf.local file must be outmoded. Each and each so to overwrite values outlined in /and so on/rc.conf as successfully as every other user outlined values.

As an illustration, so to start out the OpenBSD ///httpd webserver for the duration of boot, either employ the rcctl repeat referenced beneath or add the next line to the /and so on/rc.conf.local file manually.

///httpd_flags=

rcctl#

The rcctl repeat is outmoded to manipulate daemons on OpenBSD. The repeat permits, amongst others, the starting up, stopping, reloading, and enabling and disabling of daemons.

$ doas rcctl start ///httpd$ doas rcctl stop ///httpd$ doas rcctl reload ///httpd

To start out the ///httpd webserver automatically for the duration of boot, create the next.

$ doas rcctl enable ///httpd

To discontinuance the webserver from starting up for the duration of boot, create the next.

$ doas rcctl disable ///httpd

Services and products#

Though an OpenBSD system is largely capable to

Miscellaneous Commands#

GNU/Linux repeat (Redhat/Debian) OpenBSD an identical Design
yum install / simply-win install equipment pkg_add equipment Install equipment from a ways-off repository
rpm -i /dpkg -i equipment pkg_add equipment Install local equipment
rpm -qa / dpkg -l pkg_info List build in programs
lspci pcidump List PCI devices
lsusb usbdevs List USB devices

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button