AFTERBOOT(8)            OpenBSD System Manager's Manual           AFTERBOOT(8)

NNAAMMEE
     aafftteerrbboooott - things to check after the first complete boot

DDEESSCCRRIIPPTTIIOONN
   SSttaarrttiinngg OOuutt
     This document attempts to list items for the system administrator to
     check and set up after the installation and first complete boot of the
     system.  The idea is to create a list of items that can be checked off so
     that you have a warm fuzzy feeling that something obvious has not been
     missed.  A basic knowledge of UNIX is assumed, otherwise type

           ## hheellpp

     Complete instructions for correcting and fixing items is not provided.
     There are manual pages and other methodologies available for doing that.
     For example, to view the man page for the ls(1) command, type:

           mmaann 11 llss

     Administrators will rapidly become more familiar with OpenBSD if they get
     used to using the high quality manual pages.

   EErrrraattaa
     By the time that you have installed your system, it is quite likely that
     bugs in the release have been found.  All significant and easily fixed
     problems will be reported at _h_t_t_p_:_/_/_w_w_w_._o_p_e_n_b_s_d_._o_r_g_/_e_r_r_a_t_a_._h_t_m_l. The web
     page will mention if a problem is security related.  It is recommended
     that you check this page regularly.

   LLooggiinn
     Login as ``rroooott''. You can do so on the console, or over the network us-
     ing ssh(1). If you wish to deny root logins over the network, edit the
     _/_e_t_c_/_s_s_h_d___c_o_n_f_i_g file and set PPeerrmmiittRRoooottLLooggiinn to ``no'' (see sshd(8)).

     Upon successful login on the console, you may see the message ``Don't
     login as root, use su''. For security reasons, it is bad practice to lo-
     gin as root during regular use and maintenance of the system.  Instead,
     administrators are encouraged to add a ``regular'' user, add said user to
     the ``wheel'' group, then use the ssuu and ssuuddoo commands when root privi-
     leges are required.  This process is described in more detail later.

   RRoooott ppaasssswwoorrdd
     Change the password for the root user.  (Note that throughout the docu-
     mentation, the term ``superuser'' is a synonym for the root user.)
     Choose a password that has numbers, digits, and special characters (not
     space) as well as from the upper and lower case alphabet.  Do not choose
     any word in any language.  It is common for an intruder to use dictionary
     attacks.  Type the command //uussrr//bbiinn//ppaasssswwdd to change it.

     It is a good idea to always specify the full path name for both the pass-
     wd(1) and su(1) commands as this inhibits the possibility of files placed
     in your execution PATH for most shells.  Furthermore, the superuser's
     PATH should never contain the current directory (``.'').

   SSyysstteemm ddaattee
     Check the system date with the date(1) command.  If needed, change the
     date, and/or change the symbolic link of _/_e_t_c_/_l_o_c_a_l_t_i_m_e to the correct
     time zone in the _/_u_s_r_/_s_h_a_r_e_/_z_o_n_e_i_n_f_o directory.

     Examples:

     ddaattee 119999990011227711550044

           Set the current date to January 27th, 1999 3:04pm.

     llnn --ffss //uussrr//sshhaarree//zzoonneeiinnffoo//CCaannaaddaa//AAttllaannttiicc //eettcc//llooccaallttiimmee
           Set the time zone to Atlantic Standard Time.

   CChheecckk hhoossttnnaammee
     Use the hhoossttnnaammee command to verify that the name of your machine is cor-
     rect.  See the man page for hostname(1) if it needs to be changed.  You
     will also need to edit the _/_e_t_c_/_m_y_n_a_m_e file to have it stick around for
     the next reboot.

   VVeerriiffyy nneettwwoorrkk iinntteerrffaaccee ccoonnffiigguurraattiioonn
     The first thing to do is an iiffccoonnffiigg --aa to see if the network interfaces
     are properly configured.  Correct by editing _/_e_t_c_/_h_o_s_t_n_a_m_e_._i_n_t_e_r_f_a_c_e
     (where _i_n_t_e_r_f_a_c_e is the interface name, e.g., ``le0'') and then using if-
     config(8) to manually configure it if you do not wish to reboot.  Read
     the hostname.if(5) man page for more information on the format of
     _/_e_t_c_/_h_o_s_t_n_a_m_e_._i_n_t_e_r_f_a_c_e files.  The loopback interface will look some-
     thing like:

           lo0: flags=8009<UP,LOOPBACK,MULTICAST> mtu 32972
                   inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
                   inet6 ::1 prefixlen 128
                   inet 127.0.0.1 netmask 0xff000000

     an Ethernet interface something like:

           le0: flags=9863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST>
                   inet 192.168.4.52 netmask 0xffffff00 broadcast 192.168.4.255
                   inet6 fe80::5ef0:f0f0%le0 prefixlen 64 scopeid 0x1

     and, a PPP interface something like:

           ppp0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST>
                   inet 203.3.131.108 --> 198.181.0.253 netmask 0xffff0000

     If you wish to turn on multicast routing, see the section titled
     ``Multicast routing.'' in _/_e_t_c_/_n_e_t_s_t_a_r_t.

     See dhcp(8) for instructions on configuring interfaces with DHCP.

   CChheecckk rroouuttiinngg ttaabblleess
     Issue a nneettssttaatt --rrnn command.  The output will look something like:

           Routing tables

           Internet:
           Destination    Gateway           Flags  Refs     Use  Mtu  Interface
           default        192.168.4.254     UGS      0 11098028    -  le0
           127            127.0.0.1         UGRS     0        0    -  lo0
           127.0.0.1      127.0.0.1         UH       3       24    -  lo0
           192.168.4      link#1            UC       0        0    -  le0
           192.168.4.52   8:0:20:73:b8:4a   UHL      1     6707    -  le0
           192.168.4.254  0:60:3e:99:67:ea  UHL      1        0    -  le0

           Internet6:
           Destination        Gateway       Flags  Refs  Use     Mtu  Interface
           ::/96              ::1           UGRS     0     0   32972  lo0 =>
           ::1                ::1           UH       4     0   32972  lo0
           ::ffff:0.0.0.0/96  ::1           UGRS     0     0   32972  lo0
           fc80::/10          ::1           UGRS     0     0   32972  lo0
           fe80::/10          ::1           UGRS     0     0   32972  lo0
           fe80::%le0/64      link#1        UC       0     0    1500  le0
           fe80::%lo0/64      fe80::1%lo0   U        0     0   32972  lo0
           ff01::/32          ::1           U        0     0   32972  lo0
           ff02::%le0/32      link#1        UC       0     0    1500  le0
           ff02::%lo0/32      fe80::1%lo0   UC       0     0   32972  lo0


     The default gateway address is stored in the _/_e_t_c_/_m_y_g_a_t_e file.  If you
     need to edit this file, a painless way to reconfigure the network after-
     wards is rroouuttee fflluusshh followed by a sshh --xx //eettcc//nneettssttaarrtt command.  Or, you
     may prefer to manually configure using a series of rroouuttee aadddd and rroouuttee
     ddeelleettee commands (see route(8)).

     If you wish to route packets between interfaces, add the directive

           net.inet.ip.forwarding=1

     or

           net.inet6.ip6.forwarding=1

     to _/_e_t_c_/_s_y_s_c_t_l_._c_o_n_f, or by compiling a new kernel with the GGAATTEEWWAAYY op-
     tion.  Packets are not forwarded by default, due to RFC requirements.

     You can add new ``virtual interfaces'' by adding the required entries to
     _/_e_t_c_/_h_o_s_t_n_a_m_e_._i_f.

   BBIINNDD NNaammee SSeerrvveerr ((DDNNSS))
     If you are using the BIND Name Server, check the _/_e_t_c_/_r_e_s_o_l_v_._c_o_n_f file.
     It may look something like:

           domain nts.umn.edu
           nameserver 128.101.101.101
           nameserver 134.84.84.84
           search nts.umn.edu. umn.edu.
           lookup file bind

     If using a caching name server add the line "nameserver 127.0.0.1" first.
     To get a local caching name server to run you will need to set
     "named_flags" in _/_e_t_c_/_r_c_._c_o_n_f and create the _n_a_m_e_d_._b_o_o_t file in the ap-
     propriate place for named(8). The same holds true if the machine is going
     to be a name server for your domain.  In both these cases, make sure that
     named(8) is running (otherwise there are long waits for resolver time-
     outs).

   YYPP SSeettuupp
     Check the YP domain name with the domainname(1) command.  If necessary,
     correct it by editing the _/_e_t_c_/_d_e_f_a_u_l_t_d_o_m_a_i_n file.  The _/_e_t_c_/_n_e_t_s_t_a_r_t
     script reads this file on bootup to determine and set the domain name.
     You may also set the running system's domain name with the domainname(1)
     command.  To start YP client services, simply run yyppbbiinndd, then perform
     the remaining YP activation as described in passwd(5) and group(5).

     In particular, to enable YP passwd support, you'll need to add the fol-
     lowing line to _/_e_t_c_/_m_a_s_t_e_r_._p_a_s_s_w_d:

     +:*::::::::

     You do this by using vipw(8), once this is done, you'll need to run
     ppwwdd__mmkkddbb //eettcc//mmaasstteerr..ppaasssswwdd to regenerate the password databases.

     There are many more YP man pages available to help you.  You can find
     more information by starting with yp(8).

   CChheecckk ddiisskk mmoouunnttss
     Check that the disks are mounted correctly by comparing the _/_e_t_c_/_f_s_t_a_b
     file against the output of the mount(8) and df(1) commands.  Example:

           # ccaatt //eettcc//ffssttaabb
           /dev/sd0a / ffs rw 1 1
           /dev/sd0b none swap sw 0 0
           /dev/sd0d /usr ffs rw 1 2
           /dev/sd0e /var ffs rw 1 3
           /dev/sd0g /tmp ffs rw 1 4
           /dev/sd0h /home ffs rw 1 5
           # mmoouunntt
           /dev/sd0a on / type ffs (local)
           /dev/sd0d on /usr type ffs (local)
           /dev/sd0e on /var type ffs (local)
           /dev/sd0g on /tmp type ffs (local)
           /dev/sd0h on /home type ffs (local)
           # ddff
           Filesystem  1024-blocks     Used    Avail Capacity  Mounted on
           /dev/sd0a         22311    14589     6606    69%    /
           /dev/sd0d        203399   150221    43008    78%    /usr
           /dev/sd0e         10447      682     9242     7%    /var
           /dev/sd0g         18823        2    17879     0%    /tmp
           /dev/sd0h          7519     5255     1888    74%    /home
           # ppssttaatt --ss
           Device      512-blocks     Used    Avail Capacity  Priority
           /dev/sd0b       131072    84656    46416    65%    0

     Edit _/_e_t_c_/_f_s_t_a_b and use the mount(8) and umount(8) commands as appropri-
     ate.  Refer to the above example and fstab(5) for information on the for-
     mat of this file.

     You may wish to do NFS partitions now too, or you can do them later.

   CCoonnccaatteennaatteedd ddiisskkss ((ccccdd))
     If you are using ccd(4) concatenated disks, edit _/_e_t_c_/_c_c_d_._c_o_n_f. Use the
     ccccddccoonnffiigg --UU command to unload and the ccccddccoonnffiigg --CC command to create ta-
     bles internal to the kernel for the concatenated disks.  You then
     mount(8), umount(8), and edit _/_e_t_c_/_f_s_t_a_b as needed.

   AAuuttoommoouunntteerr ddaaeemmoonn ((AAMMDD))
     If using the amd(8) package, go into the _/_e_t_c_/_a_m_d directory and set it up
     by renaming _m_a_s_t_e_r_._s_a_m_p_l_e to _m_a_s_t_e_r and editing it and creating other
     maps as needed.  Alternatively, you can get your maps with YP.

CCHHAANNGGIINNGG //EETTCC FFIILLEESS
     The system should be usable now, but you may wish to do more customizing,
     such as adding users, etc.  Many of the following sections may be skipped
     if you are not using that package (for example, skip the _K_e_r_b_e_r_o_s section
     if you won't be using Kerberos).  We suggest that you ccdd //eettcc and edit
     most of the files in that directory.

     Note that the _/_e_t_c_/_m_o_t_d file is modified by _/_e_t_c_/_r_c whenever the system
     is booted. To keep any custom message intact, ensure that you leave two
     blank lines at the top, or your message will be overwritten.

   AAdddd nneeww uusseerrss
     Add users.  There is an adduser(8) script.  You may use vipw(8) to add
     users to the _/_e_t_c_/_p_a_s_s_w_d file and edit _/_e_t_c_/_g_r_o_u_p by hand to add new
     groups.  The manual page for su(1), tells you to make sure to put people
     in the `wheel' group if they need root access (non-Kerberos).  For exam-
     ple:

           wheel:*:0:root,myself

     Follow instructions for kerberos(1) if using Kerberos for authentication.

   rrcc..ccoonnff,, rrcc..llooccaall,, rrcc..sseeccuurreelleevveell,, rrcc..sshhuuttddoowwnn
     Check for any local changes needed in the files _/_e_t_c_/_r_c_._c_o_n_f,
     _/_e_t_c_/_r_c_._l_o_c_a_l, _r_c_._s_e_c_u_r_e_l_e_v_e_l, and _r_c_._s_h_u_t_d_o_w_n_. Turning on something like
     the Network Time Protocol in _/_e_t_c_/_r_c_._c_o_n_f requires making sure the pack-
     age is installed.
     If you've installed X, you may want to turn on xdm(1), the X Display Man-
     ager.  To do this, change the value of xdm_flags in _/_e_t_c_/_r_c_._c_o_n_f.

   PPrriinntteerrss
     Edit _/_e_t_c_/_p_r_i_n_t_c_a_p and _/_e_t_c_/_h_o_s_t_s_._l_p_d to get any printers set up.  Con-
     sult lpd(8) and printcap(5) if needed.

   TTiigghhtteenn uupp sseeccuurriittyy
     You might wish to tighten up security more by editing _/_e_t_c_/_f_b_t_a_b as when
     installing X.  In _/_e_t_c_/_i_n_e_t_d_._c_o_n_f comment out any extra entries you do
     not need, and only add things that are really needed.  Note that by de-
     fault the telnetd(8) and ftpd(8) daemons are not enabled in favor of SSH
     (Secure Shell).

   KKeerrbbeerrooss
     If you are going to use kerberos(1) for authentication, and you already
     have a Kerberos master, change directory to _/_e_t_c_/_k_e_r_b_e_r_o_s_I_V and config-
     ure.  Remember to get a _s_r_v_t_a_b from the master so that the remote com-
     mands work.

   MMaaiill AAlliiaasseess
     Edit _/_e_t_c_/_m_a_i_l_/_a_l_i_a_s_e_s and set the three standard aliases to go to either
     a mailing list, or the system administrator.

           # Well-known aliases -- these should be filled in!
           root:           sysadm
           manager:        sysadm
           dumper:         sysadm

     Run newaliases(8) after changes.

   SSeennddmmaaiill
     OpenBSD ships with a default _/_e_t_c_/_m_a_i_l_/_s_e_n_d_m_a_i_l_._c_f file that will work
     for simple installations; it was generated from _o_p_e_n_b_s_d_-_p_r_o_t_o_._m_c in
     _/_u_s_r_/_s_h_a_r_e_/_s_e_n_d_m_a_i_l_/_c_f. Please see _/_u_s_r_/_s_h_a_r_e_/_s_e_n_d_m_a_i_l_/_R_E_A_D_M_E and
     _/_u_s_r_/_s_h_a_r_e_/_d_o_c_/_s_m_m_/_0_8_._s_e_n_d_m_a_i_l_o_p_/_o_p_._m_e for information on generating your
     own sendmail configuration files.  For the default installation, sendmail
     is configured to only process jobs that have been the queued and to not
     accept messages over the network.  This makes it possible to send mail
     locally, but not receive mail from remote servers, which is ideal if you
     have one central incoming mail machine and several clients.  To cause
     sendmail to accept network connections, modify the ``sendmail_flags''
     variable in _/_e_t_c_/_r_c_._c_o_n_f in accordance with the comments therein.  Note
     that sendmail now also listens on port 587 by default.  This is to imple-
     ment the RFC2476 message submission protocol.  You may disable this via
     the ``no_default_msa'' option in your sendmail .mc file.  See
     _/_u_s_r_/_s_h_a_r_e_/_s_e_n_d_m_a_i_l_/_R_E_A_D_M_E for more information.

   DDHHCCPP sseerrvveerr
     If this is a DHCP server, edit _/_e_t_c_/_d_h_c_p_d_._c_o_n_f and _/_e_t_c_/_d_h_c_p_d_._i_n_t_e_r_f_a_c_e_s
     as needed.  You will have to make sure _/_e_t_c_/_r_c_._c_o_n_f has:

           dhcpd_flags=-q

     or run dhcpd(8) manually.

   BBOOOOTTPP sseerrvveerr
     If this is a BOOTP server, edit _/_e_t_c_/_b_o_o_t_p_t_a_b as needed.  You will have
     to turn it on in _/_e_t_c_/_i_n_e_t_d_._c_o_n_f or run bootpd(8) in its standalone mode.

   NNFFSS sseerrvveerr
     If this is an NFS server make sure _/_e_t_c_/_r_c_._c_o_n_f has:

           nfs_server=YES

     Edit _/_e_t_c_/_e_x_p_o_r_t_s and get it correct.  It is probably easier to reboot
     than to get the daemons running manually, but you can get the order cor-
     rect by looking at _/_e_t_c_/_n_e_t_s_t_a_r_t.

   HHPP rreemmoottee bboooott sseerrvveerr
     Edit _/_e_t_c_/_r_b_o_o_t_d_._c_o_n_f if needed for remote booting.  If you do not have
     HP computers doing remote booting, do not enable this.

   DDaaiillyy,, wweeeekkllyy,, mmoonntthhllyy ssccrriippttss
     Look at and possibly edit the _/_e_t_c_/_d_a_i_l_y, _/_e_t_c_/_w_e_e_k_l_y, and _/_e_t_c_/_m_o_n_t_h_l_y
     scripts.  Your site specific things should go into _/_e_t_c_/_d_a_i_l_y_._l_o_c_a_l,
     _/_e_t_c_/_w_e_e_k_l_y_._l_o_c_a_l, and _/_e_t_c_/_m_o_n_t_h_l_y_._l_o_c_a_l.

     These scripts have been limited so as to keep the system running without
     filling up disk space from normal running processes and database updates.
     (You probably do not need to understand them.)

     The /altroot filesystem can optionally be used to provide a backup of the
     root filesystem on a daily basis.  To take advantage of this, you must
     have an entry in /etc/fstab with 'xx' for the mount option:

           /dev/wd0j /altroot ffs xx 0 0

     and you must add a line to root's crontab:

           ROOTBACKUP=1

     so that the /etc/daily script will make a daily backup of the root
     filesystem.

   OOtthheerr ffiilleess iinn //eettcc
     Look at the other files in _/_e_t_c and edit them as needed.  (Do not edit
     files ending in _._d_b -- like _p_w_d_._d_b, _s_p_w_d_._d_b, nor _l_o_c_a_l_t_i_m_e, nor _r_m_t, nor
     any directories.)

   CCrroonnttaabb ((bbaacckkggrroouunndd rruunnnniinngg pprroocceesssseess))
     Check what is running by typing ccrroonnttaabb --ll as root and see if anything
     unexpected is present.  Do you need anything else?  Do you wish to change
     things?  e.g., if you do not like root getting standard output of the
     daily scripts, and want only the security scripts that are mailed inter-
     nally, you can type ccrroonnttaabb --ee and change some of the lines to read:

           30  1  *  *  *   /bin/sh /etc/daily 2>&1 > /var/log/daily.out
           30  3  *  *  6   /bin/sh /etc/weekly 2>&1 > /var/log/weekly.out
           30  5  1  *  *   /bin/sh /etc/monthly 2>&1 > /var/log/monthly.out

     See crontab(5).

   NNeexxtt ddaayy cclleeaannuupp
     After the first night's security run, change ownerships and permissions
     on files, directories, and devices; root should have received mail with
     subject: "<hostname> daily insecurity output.".  This mail contains a set
     of security recommendations, presented as a list looking like this:

           var/mail:
                   permissions (0755, 0775)
           etc/daily:
                   user (0, 3)

     The best bet is to follow the advice in that list.  The recommended set-
     ting is the first item in parentheses, while the current setting is the
     second one.  This list is generated by mtree(8) using _/_e_t_c_/_m_t_r_e_e_/_s_p_e_c_i_a_l.
     Use chmod(1), chgrp(1), and chown(8) as needed.

   PPaacckkaaggeess
     Install your own packages.  The OpenBSD ports collection includes a large
     set of Third-Party software.  A lot of it is available as binary pack-
     ages, that you can download from _f_t_p_:_/_/_f_t_p_._o_p_e_n_b_s_d_._o_r_g_/ or a mirror, and
     install using pkg_add(1). See _h_t_t_p_:_/_/_w_w_w_._o_p_e_n_b_s_d_._o_r_g_/_p_o_r_t_s_._h_t_m_l and pack-
     ages(7) for more details.

     Copy vendor binaries and install them.  You will need to install any
     shared libraries, etc.  (Hint: mmaann --kk ccoommppaatt to find out how to install
     and use compatibility mode.)

     There is also other Third-Party Software that is available in source form
     only, either because it has not been ported to OpenBSD yet, or because
     licensing restrictions make binary redistribution impossible.  Sometimes
     checking the mailing lists for past problems that people have encountered
     will result in a fix posted.

CCOOMMPPIILLIINNGG AA KKEERRNNEELL
     First, review the system message buffer using the dmesg(8) command to
     find out information on your system's devices as probed by the kernel at
     boot.  In particular, note which devices were not configured.  This in-
     formation will prove useful when editing kernel configuration files.

     To compile a kernel inside a writable source tree, do the following:

           # ccdd //uussrr//ssrrcc//ssyyss//aarrcchh//_s_o_m_e_a_r_c_h//ccoonnff
           # vvii _S_O_M_E_F_I_L_E   (to make any changes)
           # ccoonnffiigg _S_O_M_E_F_I_L_E
           # ccdd ....//ccoommppiillee//_S_O_M_E_F_I_L_E
           # mmaakkee

     where _s_o_m_e_d_i_r is a writable directory, _s_o_m_e_a_r_c_h is the architecture (e.g.
     ii338866), and _S_O_M_E_F_I_L_E should be a name indicative of a particular configu-
     ration (often that of the hostname).  You can also do a mmaakkee ddeeppeenndd so
     that you will have dependencies there the next time you do a compile.

     If you are building your kernel again, before you do a mmaakkee you should do
     a mmaakkee ddeeppeenndd after making changes (including updates or patches) to your
     kernel source, or a mmaakkee cclleeaann after making changes to your kernel op-
     tions.

     After either of these two methods, you can place the new kernel (called
     _b_s_d) in _/ (i.e.  _/_b_s_d) and the system will boot it next time.  Most peo-
     ple save their backup kernels as _/_b_s_d_._1, _/_b_s_d_._2, etc.

     It is not always necessary to recompile the kernel if only configuration
     changes are required.  With config(8), you can change the device configu-
     ration in the kernel file directly:

     #  ccoonnffiigg --ee --oo _b_s_d_._n_e_w _/_b_s_d
     OpenBSD 2.7-beta (GENERIC.rz0) #0: Mon Oct  4 03:57:22 MEST 1999
         root@winona:/usr/src/sys/arch/pmax/compile/GENERIC.rz0
     Enter 'help' for information
     ukc>

     Additionally, you can permanently save the changes made with UKC during
     boot time in the kernel image.

SSEEEE AALLSSOO
     chgrp(1), chmod(1), crontab(1), date(1), df(1), domainname(1),
     hostname(1), kerberos(1), make(1), man(1), netstat(1), passwd(1), su(1),
     ccd(4), aliases(5), bootptab(5), crontab(5), exports(5), fbtab(5),
     fstab(5), group(5), krb.conf(5), krb.realms(5), passwd(5),
     resolv.conf(5), hostname(7), packages(7), adduser(8), amd(8), bootpd(8),
     ccdconfig(8), chown(8), config(8), dhcp(8), dhcpd(8), ext_srvtab(8),
     ifconfig(8), inetd(8), mtree(8), mount(8), named(8), newaliases(8),
     rbootd(8), rc(8), rmt(8), route(8), umount(8), vipw(8), ypbind(8)

HHIISSTTOORRYY
     This document first appeared in OpenBSD 2.2.

OpenBSD 2.9                    October 20, 1997                              7
