User Tools

Site Tools


user:nbrimme1:portfolio:openbsd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
user:nbrimme1:portfolio:openbsd [2018/06/09 17:57]
nbrimme1 created
user:nbrimme1:portfolio:openbsd [2018/06/21 15:02] (current)
nbrimme1 [Upgrading/Updating:]
Line 38: Line 38:
 =====Procedure===== =====Procedure=====
 The actual steps taken to accomplish the project. Include images, code snippets, command-line excerpts; whatever is useful for intuitively communicating important information for accomplishing the project. The actual steps taken to accomplish the project. Include images, code snippets, command-line excerpts; whatever is useful for intuitively communicating important information for accomplishing the project.
 +
 +=====Installation:​=====
 +  * [[https://​www.openbsd.org/​faq/​faq4.html|OpenBSD Installation Guide]]
 +  * **File Sets:** The complete OpenBSD installation is broken up into a number of file sets:
 +    * **bsd:** The kernel (required) ​
 +    * **bsd.mp:** The multi-processor kernel (only on some platforms) ​
 +    * **bsd.rd:** The [[https://​www.openbsd.org/​faq/​faq4.html#​bsd.rd|ramdisk kernel]]; a live OpenBSD environment that runs entirely in memory. This can be used to perform a complete installation,​ an upgrade to a newer version, or for disaster recovery.
 +    * **baseXX.tgz:​** The base system (required) ​
 +    * **compXX.tgz:​** The compiler collection, headers and libraries ​
 +    * **manXX.tgz:​** Manual pages 
 +    * **gameXX.tgz:​** Text-based games 
 +    * **xbaseXX.tgz:​** Base libraries and utilities for X11 (requires xshareXX.tgz)
 +    * **xfontXX.tgz:​** Fonts used by X11
 +    * **xservXX.tgz:​** X11's X servers. This set is rarely needed if you don't intend to run X.
 +    * **xshareXX.tgz:​** X11's man pages, locale settings and includes
 +=====Configuration:​=====
 +
 +**Base System:**
 +  * **Default shell:** ksh\\ **ksh** first reads <wrap hi>/​home/​user/​.kshrc</​wrap>​ then <wrap hi>/​home/​user/​.profile</​wrap>​. The <wrap hi>​.profile</​wrap>​ file is <wrap hi>read only once by the login ksh instance</​wrap>,​ while the <wrap hi>​.kshrc</​wrap>​ file is <wrap hi>read by each new ksh instance</​wrap>​.
 +  * **Initialization files:**
 +    * **user:** <wrap hi>​~/​.profile</​wrap>​
 +    * **host/all users:** <wrap hi>/​etc/​profile</​wrap>​
 +    * **hardware/​software:​** <wrap hi>/​etc/​environment</​wrap>​
 +    * **shell:** <wrap hi>​~/​.kshrc</​wrap>​
 +      * **Example .kshrc:​**<​code:​bash>​EDITOR=vim
 +EMAIL=user@example.com
 +HISTFILE=~/​.ksh_history
 +HISTSIZE=10000
 +LC_ALL=en_US.UTF-8
 +LANG=en_US.UTF-8
 +\#​LC_CTYPE=en_US.UTF-8
 +PKG_PATH=ftp://​openbsd.mirror.net/​pub/​OpenBSD/​$(uname -r)/​packages/​$(uname -m)/
 +ALT_PKG_PATH=http://​openbsd.mirror.net/​pub/​OpenBSD/​$(uname -r)/​packages/​$(uname -m)
 +\# color prompt: [$TIME]{$USER@$HOST}($PWD)$>​
 +RST="​\e[00m";​ RED="​\e[1;​91m";​ GRN="​\e[1;​92m";​ BLU="​\e[1;​94m";​ MAG="​\e[1;​95m";​ CYN="​\e[1;​96m"​
 +if [[ $EUID == 0 ]]; then
 +    PS1="​[$BLU\A$RST]$RED{$RST$CYN\u@\h$RST$RED}($RST$MAG\w$RST$RED)\\$>​$RST "
 +else
 +    PS1="​[$BLU\A$RST]$GRN{$RST$CYN\u@\h$RST$GRN}($RST$MAG\w$RST$GRN)\\$>​$RST "
 +fi
 +unset RST RED GRN BLU MAG CYN
 +export EDITOR EMAIL HISTFILE HISTSIZE LC_ALL LANG PKG_PATH ALT_PKG_PATH PS1
 +unset MAIL
 +unset MAILCHECK
 +\# reload .kshrc
 +alias reload='​. ~/​.kshrc'​
 +alias cp='cp -i'
 +alias ls='ls -A --color=auto'​
 +alias ll='ls -aFhl --color=auto'​
 +alias mv='mv -i'
 +alias rm='rm -i'</​code>​
 +      * **Enable execution of .kshrc:​**<​code:​bash>​$ echo "​export ENV=${HOME}/​.kshrc;​ export ENV" >> .profile</​code>​
 +
 +**Kernel:**
 +
 +**[[https://​www.openbsd.org/​faq/​faq5.html|Building the System from Source]]:**
 +
 +
 +=====Networking:​=====
 +  * [[https://​www.openbsd.org/​faq/​faq6.html|OpenBSD Networking FAQ]]
 +**Initial Steps:​**<​code:​bash>##​ Edit system hostname
 +$ doas vi /etc/myname
 +## Configure gateway IP address
 +$ doas vi /etc/mygate
 +## Configure the DNS IP address
 +$ doas vi /​etc/​resolv.conf</​code>​
 +
 +**Wired:​**<​code:​bash>##​ Configure static IP address and network mask: (em0 used as example)
 +$ doas vi /​etc/​hostname.em0
 +</​code>​
 +
 +**Wireless:​**<​code:​bash>##​ Configure static IP address and network mask: (urtw0 used as example)
 +$ doas vi /​etc/​hostname.urtw0
 +## wpa_supplicant instructions
 +## Installation
 +$ doas pkg_add -ivvv wpa_supplicant
 +## Usage: (urtw0 used as example)
 +# Scan for WiFi APs:
 +$ doas ifconfig urtw0 up
 +$ doas ifconfig urtw0 scan
 +
 +# Connect to a WPA Network:
 +$ ifconfig urtw0 nwid AP-SSID wpakey $uPPP3R_$3CURE_p@$$WoRD
 +$ dhclient urtw0
 +
 +# Connect to a WPA Network with spaces in the BSSID: (Single quotes)
 +$ ifconfig urtw0 nwid '​AP-SSID with Spaces'​ wpakey $uPPP3R_$3CURE_p@$$WoRD
 +$ dhclient urtw0
 +
 +# Connect to a WPA Network with symbols in the BSSID: (Double quotes)
 +$ ifconfig urtw0 nwid "​AP-SSID_w!th_$ymb01$"​ wpakey $uPPP3R_$3CURE_p@$$WoRD
 +$ dhclient urtw0
 +
 +## Monitor Mode:
 +# Show wireless card information:​
 +$ doas dmesg | grep '​urtw0'​
 +# Show Media Options:
 +$ ifconfig urtw0 media
 +# ENABLE Monitor Mode:
 +$ doas ifconfig urtw0 mediaopt monitor
 +# DISABLE Monitor Mode:
 +$ doas ifconfig urtw0 -mediaopt monitor</​code>​
 +=====Packages/​Ports/​Source:​=====
 +**Packages:​**
 +  * [[https://​www.openbsd.org/​faq/​faq15.html|OpenBSD Package Management FAQ]]
 +  * **List installed packages:​**<​code:​bash>​$ pkg_info
 +$ pkg_info | grep <​package_name></​code>​
 +
 +  * **Install a package:​**<​code:​bash>​$ doas pkg_add -imVvvvvv package_name | tee package_name.txt</​code>​
 +
 +  * **Remove a package:​**<​code:​bash>​$ doas pkg_delete -aimVvvvvv <​package_name></​code>​
 +
 +  * **Update a single package:​**<​code:​bash>​$ doas pkg_add -umVvvvvv <​package_name></​code>​
 +
 +  * **Update installed packages:​**<​code:​bash>​$ doas pkg_add -umVvvvvv</​code>​
 +
 +  * **Useful Packages:**
 +    * **Package Management:​**
 +      * **pkg_mgr:​** A high-level, user-friendly package browser for OpenBSD. It allows the user to install, uninstall, search & browse available packages using a simple curses interface. It relies on //​sqlports//​ for its internal database, //​pkg_add(1)//,​ //​pkg_info(1)//​ and //​pkg_delete(1)//​ for package operations.
 +    * **Terminal Multiplexers:​** //byobu//, //screen//, //tmux//
 +
 +**Ports:**
 +  * [[https://​www.openbsd.org/​faq/​ports/​|OpenBSD Ports FAQ]]
 +  * [[http://​openports.se/​|openports.se]]
 +=====Upgrading/​Updating:​=====
 +  * [[https://​www.openbsd.org/​faq/​faq10.html|OpenBSD System Management FAQ]]
 +
 +**Initial Steps:**
 +  * **Add path:​**<​code:​bash>​$ vi .profile
 +export PKG_PATH=ftp://​openbsd.mirror.frontiernet.net/​pub/​OpenBSD/​$(uname -r)/​packages/​$(uname -m)/
 +export ALT_PKG_PATH=http://​openbsd.mirror.frontiernet.net/​pub/​OpenBSD/​$(uname -r)/​packages/​$(uname -m)/
 +$ doas vi /​root/​.profile
 +export PKG_PATH=ftp://​openbsd.mirror.frontiernet.net/​pub/​OpenBSD/​$(uname -r)/​packages/​$(uname -m)/
 +export ALT_PKG_PATH=http://​openbsd.mirror.frontiernet.net/​pub/​OpenBSD/​$(uname -r)/​packages/​$(uname -m)/</​code>​
 +
 +**Upgrading:​**
 +  * **-release**:​ The version shipped every six months.
 +  * **-current**:​ The development branch.
 +    * **[[https://​www.openbsd.org/​faq/​current.html|Following -current]]**
 +  * **-stable**:​ The -release branch, plus patches found on the errata page.
 +    * Using cvs:
 +      * Fetching the -stable trees:<​code:​bash>​$ cd /usr
 +$ cvs -qd anoncvs@anoncvs.example.org:/​cvs checkout -rOPENBSD_6_3 -P src</​code>​
 +      * Updating the -stable trees:<​code:​bash>​$ cd /usr/src
 +$ cvs -q up -Pd</​code>​
 +        * Specify the branch with the -r command
 +        * All the trees (src, ports, xenocara, www) should be checked out and updated at the same time.
 +      * Fetching the -current trees:<​code:​bash>​$ cd /usr
 +$ cvs -qd anoncvs@anoncvs.example.org:/​cvs checkout -P src</​code>​
 +      * Updating the -current trees:<​code:​bash>​$ cd /usr/src
 +$ cvs -q up -Pd</​code>​
 +
 +**Updating:​**
 +  * **Firmware:​** using //​fw_update(1)//:​\\ <​code:​bash>​$ doas fw_update -v</​code>​
 +  * **System:**
 +    * [[http://​www.openbsd.org/​errata.html|OpenBSD Errata and Patches]]
 +    * [[https://​www.openbsd.org/​anoncvs.html|OpenBSD Anonymous CVS FAQ]]
 +    * [[http://​cvsweb.openbsd.org/​cgi-bin/​cvsweb/#​dirlist|Official CVS Repository]]
 +  * **Four active source repositories:​**
 +    * [[https://​github.com/​openbsd/​src|src]] - source code for the base system ​
 +    * [[https://​github.com/​openbsd/​ports|ports]] - the ports tree
 +    * [[https://​github.com/​openbsd/​www|www]] - web pages
 +    * [[https://​github.com/​openbsd/​xenocara|xenocara]] - xenocara
 +  * **Preloading the source code tree:​**<​code:​bash>​$ cd /tmp
 +$ wget http://​mirrors.mit.edu/​pub/​OpenBSD/​6.3/​src.tar.gz
 +$ wget http://​mirrors.mit.edu/​pub/​OpenBSD/​6.3/​sys.tar.gz
 +$ wget http://​mirrors.mit.edu/​pub/​OpenBSD/​6.3/​ports.tar.gz
 +$ wget http://​mirrors.mit.edu/​pub/​OpenBSD/​6.3/​xenocara.tar.gz
 +$ cd /usr/src
 +$ tar xvfz /​tmp/​sys.tar.gz
 +$ tar xvfz /​tmp/​src.tar.gz
 +$ cd /usr
 +$ tar xvfz /​tmp/​ports.tar.gz
 +$ tar xvfz /​tmp/​xenocara.tar.gz
 +$ rm /​tmp/​*.tar.gz</​code>​
 +
 +=====Administration:​=====
 +
 +**Services:​**
 +
 +**Users:**
 +
 +=====Security:​=====
 +
 +**PGP/​GPG:​**
 +
 +**SSH:**
 +
 +**SSL:**
 +
 +=====Miscellaneous:​=====
 +**Mount a USB drive:** (**sd0** is used as an example)
 +  * Create a directory to mount the USB drive:<​code:​bash>​$ doas mkdir /mnt/usb
 +$ doas sysctl hw.disknames
 +$ doas dmesg | grep sd0
 +$ doas disklabel sd0</​code>​
 +  * Mount the USB drive in the created directory:<​code:​bash>​$ doas mount /dev/sd0i /mnt/usb
 +$ cd /mnt/usb
 +$ ls -aFhl</​code>​
 +  * Unmounting the USB drive:<​code:​bash>​$ doas umount /​mnt/​usb</​code>​
  
 =====Code===== =====Code=====
user/nbrimme1/portfolio/openbsd.1528581433.txt.gz · Last modified: 2018/06/09 17:57 by nbrimme1