======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 up * # ifconfig scan * **Connect to a //WPA// WiFi Network**: * # ifconfig nwid wpakey * # dhclient * **Connect to a //WPA// WiFi Network with __spaces__ in the //BSSID//**: * # ifconfig nwid '' wpakey * # dhclient * **Connect to a //WPA// WiFi Network with __symbols__ in the //BSSID//**: * # ifconfig nwid "" wpakey * # dhclient * **Monitor Mode**: **Note:** Hardware must support //Monitor Mode//. * # dmesg | grep "" * # ifconfig media * # ifconfig mediaopt monitor To enable. * # ifconfig -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**: * $ vi ~/.profile * $ export PKG_PATH=ftp://ftp5.usa.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(uname -m) * $ export ALT_PKG_PATH=http://ftp5.usa.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(uname -m) * Save and exit. * # vi ~/.profile * # export PKG_PATH=ftp://ftp5.usa.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(uname -m) * # export ALT_PKG_PATH=http://ftp5.usa.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(uname -m) * Save and exit. * # reboot ===== 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 \ * > -m - | (cd /usr/src && patch -p0) * **To recompile the patched software:** * # cd * # 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 | 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 ==== Useful Packages: ==== * **clamav** * **dnscrypt-proxy** * **gnupg** * **gnupg2** * **opendnssec** * **tree** =====Execution===== =====Reflection===== =====References=====