User Tools

Site Tools


user:nbrimme1:portfolio:unixproject2

UNIX Project 2: OpenBSD Installation and Configuration:

Objectives

Prerequisites

Background

Scope

Attributes

  • Create a ppp directory: ppp stands for Patches, Ports, and Packages. Whenever a patch, port, or package is installed, I find it useful to pipe the output to tee and place it in this directory. If something went wrong when installing a package, I can check the text file for any warnings or errors. Also, If I am not sure if a particular patch is installed, I can just look in this directory.

Procedure

After installation, there are some things that need to be configured before it can be used. Items prefixed with a $ can be executed as the user and items prefixed with a # must be executed as root. Some configuration options must be done for both the normal user and the root user:

  • Update the firmware:
    • # fw_update | tee ~/ppp/fw_update.txt
  • A more informative shell prompt:
    • $ vi ~/.profile
    • export PS1='[$PWD]: $'
    • Save and exit.
  • Enable the mouse in the terminal:
    • $ vi /etc/rc.conf
    • $ wsmoused_flags=YES
    • # vi /etc/rc.conf
    • # wsmoused_flags=YES
    • # reboot
  • Configure Networking:
    • IP addresses and network mask:
      • # vi /etc/hostname.em##
    • Gateway IP address:
      • # vi /etc/mygate
    • DNS IP address:
      • # vi /etc/resolv.conf
    • Edit the hostname:
      • # vi /etc/myname
  • Install and configure wireless:
    • # CHANGE TO DOAS
    • # pkg_add -ivvv wpa_supplicant | tee /home/user/ppp/wpa_supplicant.txt
      • Scan for WiFi networks:
        • # ifconfig <device> up
        • # ifconfig <device> scan
      • Connect to a WPA WiFi Network:
        • # ifconfig <device> nwid <SSID> wpakey <PASS>
        • # dhclient <device>
      • Connect to a WPA WiFi Network with spaces in the BSSID:
        • # ifconfig <device> nwid '<SSID_with_spaces>' wpakey <PASS>
        • # dhclient <device>
      • Connect to a WPA WiFi Network with symbols in the BSSID:
        • # ifconfig <device> nwid “<SSID_with_$ymbol$>” wpakey <PASS>
        • # dhclient <device>
      • Monitor Mode: Note: Hardware must support Monitor Mode.
        • # dmesg | grep “<device>”
        • # ifconfig <device> media
        • # ifconfig <device> mediaopt monitor To enable.
        • # ifconfig <device> -mediaopt monitor To disable.
  • Correct the System Time:
    • This is optional. Sometimes this step is need to correct the system time:
      • # ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
  • Add Upgrade and Update paths:

Additional Steps

Install and set bash as the login shell:

  • # CHANGE TO DOAS
  • # pkg_add -ivvv bash | tee /home/user/ppp/bash.txt
  • # chsh -s /usr/local/bin/bash (for the root user.)
  • # chsh -s /usr/local/bin/bash user (for the user user.)
  • # exit

Patching:

  • # cd /tmp
  • # wget …/src.tar.gz
  • # wget …/sys.tar.gz
  • # cd /usr/src
  • # tar xvfz /tmp/src.tar.gz
  • # tar xvfz /tmp/sys.tar.gz
  • # cd /tmp
  • # rm src.tar.gz && sys.tar.gz
  • # wget …/*.patch.sig
  • # signify -Vep /etc/signify/openbsd-##-*.pub -x ###.patch.sig \<enter>
  • > -m - | (cd /usr/src && patch -p0)
  • To recompile the patched software:
    • # cd <dir>
    • # make obj
    • # make depend
    • # make
    • # make install
  • To recompile a patched kernel:
    • # cd /usr/src/sys/arch/`machine`/conf
    • # KK=`sysctl -n kern.osversion | cut -d# -f1`
    • # config $KK
    • # cd ../compile/$KK
    • # make
    • # make install

Installing Packages:

  • # CHANGE TO DOAS
  • # pkg_add -ivvv <package_name> | tee package_name.txt

List installed Packages:

  • # pkg_info
  • # pkg_info | grep “package_name”

Update installed Packages:

  • # pkg_add
  • # pkg_add -u
  • # pkg_add -u <package_name>

Useful Packages:

  • clamav
  • dnscrypt-proxy
  • gnupg
  • gnupg2
  • opendnssec
  • tree

Execution

Reflection

References

user/nbrimme1/portfolio/unixproject2.txt · Last modified: 2016/11/03 06:00 by nbrimme1