1*ba290545Skre.\" $NetBSD: afterboot.8,v 1.83 2023/03/19 17:26:12 kre Exp $ 24e39658fShubertf.\" $OpenBSD: afterboot.8,v 1.72 2002/02/22 02:02:33 miod Exp $ 34b413dd0Sjdolecek.\" 44e39658fShubertf.\" Originally created by Marshall M. Midden -- 1997-10-20, m4@umn.edu 50e18937eSjmmv.\" Adapted to NetBSD by Julio Merino -- 2002-05-10, jmmv@NetBSD.org 64e39658fShubertf.\" 74e39658fShubertf.\" 8147b99baStsutsui.\" Copyright (c) 2002-2008 The NetBSD Foundation, Inc. 94b413dd0Sjdolecek.\" All rights reserved. 104b413dd0Sjdolecek.\" 114b413dd0Sjdolecek.\" Redistribution and use in source and binary forms, with or without 124b413dd0Sjdolecek.\" modification, are permitted provided that the following conditions 134b413dd0Sjdolecek.\" are met: 144b413dd0Sjdolecek.\" 1. Redistributions of source code must retain the above copyright 154b413dd0Sjdolecek.\" notice, this list of conditions and the following disclaimer. 164b413dd0Sjdolecek.\" 2. Redistributions in binary form must reproduce the above copyright 174b413dd0Sjdolecek.\" notice, this list of conditions and the following disclaimer in the 184b413dd0Sjdolecek.\" documentation and/or other materials provided with the distribution. 194b413dd0Sjdolecek.\" 204b413dd0Sjdolecek.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 214b413dd0Sjdolecek.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 224b413dd0Sjdolecek.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 234b413dd0Sjdolecek.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 244b413dd0Sjdolecek.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 254b413dd0Sjdolecek.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 264b413dd0Sjdolecek.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 274b413dd0Sjdolecek.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 284b413dd0Sjdolecek.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 294b413dd0Sjdolecek.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 304b413dd0Sjdolecek.\" POSSIBILITY OF SUCH DAMAGE. 314b413dd0Sjdolecek.\" 324b413dd0Sjdolecek.\" 334e39658fShubertf.\" Copyright (c) 1997 Marshall M. Midden 344e39658fShubertf.\" All rights reserved. 354b413dd0Sjdolecek.\" 364e39658fShubertf.\" Redistribution and use in source and binary forms, with or without 374e39658fShubertf.\" modification, are permitted provided that the following conditions 384e39658fShubertf.\" are met: 394e39658fShubertf.\" 404e39658fShubertf.\" 1. Redistributions of source code must retain the above copyright 414e39658fShubertf.\" notice, this list of conditions and the following disclaimer. 424e39658fShubertf.\" 2. Redistributions in binary form must reproduce the above copyright 434e39658fShubertf.\" notice, this list of conditions and the following disclaimer in the 444e39658fShubertf.\" documentation and/or other materials provided with the distribution. 454e39658fShubertf.\" 3. All advertising materials mentioning features or use of this software 464e39658fShubertf.\" must display the following acknowledgement: 474e39658fShubertf.\" This product includes software developed by Marshall M. Midden. 484e39658fShubertf.\" 4. The name of the author may not be used to endorse or promote products 494e39658fShubertf.\" derived from this software without specific prior written permission. 504e39658fShubertf.\" 514e39658fShubertf.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 524e39658fShubertf.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 534e39658fShubertf.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 544e39658fShubertf.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 554e39658fShubertf.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 564e39658fShubertf.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 574e39658fShubertf.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 584e39658fShubertf.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 594e39658fShubertf.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 604e39658fShubertf.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 614e39658fShubertf.\" 6240ec0685Snia.Dd June 4, 2021 634b413dd0Sjdolecek.Dt AFTERBOOT 8 644b413dd0Sjdolecek.Os 654b413dd0Sjdolecek.Sh NAME 664b413dd0Sjdolecek.Nm afterboot 674b413dd0Sjdolecek.Nd things to check after the first complete boot 684b413dd0Sjdolecek.Sh DESCRIPTION 694b413dd0Sjdolecek.Ss Starting Out 704b413dd0SjdolecekThis document attempts to list items for the system administrator 714b413dd0Sjdolecekto check and set up after the installation and first complete boot of the 724b413dd0Sjdoleceksystem. 734b413dd0SjdolecekThe idea is to create a list of items that can be checked off so that you have 744b413dd0Sjdoleceka warm fuzzy feeling that something obvious has not been missed. 754b413dd0SjdolecekA basic knowledge of 764b413dd0Sjdolecek.Ux 774b413dd0Sjdolecekis assumed. 784b413dd0Sjdolecek.Pp 794b413dd0SjdolecekComplete instructions for correcting and fixing items is not provided. 804b413dd0SjdolecekThere are manual pages and other methodologies available for doing that. 814b413dd0SjdolecekFor example, to view the man page for the 824b413dd0Sjdolecek.Xr ls 1 834b413dd0Sjdolecekcommand, type: 844b413dd0Sjdolecek.Bd -literal -offset indent 854b413dd0Sjdolecek.Ic man 1 ls 864b413dd0Sjdolecek.Ed 874b413dd0Sjdolecek.Pp 884b413dd0SjdolecekAdministrators will rapidly become more familiar with 894b413dd0Sjdolecek.Nx 904b413dd0Sjdolecekif they get used to using the manual pages. 914b413dd0Sjdolecek.Ss Login 92e33fbdfaSniaOn a fresh install with no other user accounts, login as 934b413dd0Sjdolecek.Dq Ic root . 944b413dd0SjdolecekYou can do so on the console, or over the network using 954b413dd0Sjdolecek.Xr ssh 1 . 96c8e910afSsnjIf you have enabled the SSH daemon (see 97c8e910afSsnj.Xr sshd 8 ) 98c8e910afSsnjand wish to allow root logins over the network, edit the 994b413dd0Sjdolecek.Pa /etc/ssh/sshd_config 1004b413dd0Sjdolecekfile and set 101c8e910afSsnj.Dq PermitRootLogin 1024b413dd0Sjdolecekto 1034b413dd0Sjdolecek.Dq yes 1044b413dd0Sjdolecek(see 1056a0fa0e8Sreed.Xr sshd_config 5 ) . 1064b413dd0SjdolecekThe default is to not permit root logins over the network 1074b413dd0Sjdolecekafter fresh install in 1084b413dd0Sjdolecek.Nx . 1094b413dd0Sjdolecek.Pp 1104b413dd0SjdolecekUpon successful login on the console, you may see the message 1114b413dd0Sjdolecek.Dq We recommend creating a non-root account... . 1124b413dd0SjdolecekFor security reasons, it is bad practice to login as root during 1134b413dd0Sjdolecekregular use and maintenance of the system. 114e8c92f0cSjnemethIn fact, the system will only let you login as root on a secure 115e8c92f0cSjnemethterminal. 116e8c92f0cSjnemethBy default, only the console is considered to be a secure terminal. 1174b413dd0SjdolecekInstead, administrators are encouraged to add a 1184b413dd0Sjdolecek.Dq regular 1194b413dd0Sjdolecekuser, add said user to the 1204b413dd0Sjdolecek.Dq wheel 1214b413dd0Sjdolecekgroup, then use the 1224e39658fShubertf.Xr su 1 1231068f92fSniacommand when root privileges are required: 1241068f92fSnia.Bd -literal -offset indent 1251068f92fSnia.Ic useradd -G wheel -m myuser 1261068f92fSnia.Ic passwd myuser 1271068f92fSnia.Ed 1284b413dd0Sjdolecek.Ss Root password 1294b413dd0SjdolecekChange the password for the root user. 1304b413dd0Sjdolecek(Note that throughout the documentation, the term 1314b413dd0Sjdolecek.Dq superuser 1324b413dd0Sjdolecekis a synonym for the root user.) 1334b413dd0SjdolecekChoose a password that has numbers, digits, and special characters (not space) 1344b413dd0Sjdolecekas well as from the upper and lower case alphabet. 1354b413dd0SjdolecekDo not choose any word in any language. 1364b413dd0SjdolecekIt is common for an intruder to use dictionary attacks. 1374b413dd0SjdolecekType the command 1384b413dd0Sjdolecek.Ic /usr/bin/passwd 1394b413dd0Sjdolecekto change it. 1404b413dd0Sjdolecek.Pp 1414b413dd0SjdolecekIt is a good idea to always specify the full path name for both the 1424b413dd0Sjdolecek.Xr passwd 1 1434b413dd0Sjdolecekand 1444b413dd0Sjdolecek.Xr su 1 1454b413dd0Sjdolecekcommands as this inhibits the possibility of files placed in your execution 1464b413dd0Sjdolecek.Ev PATH 1474b413dd0Sjdolecekfor most shells. 1484b413dd0SjdolecekFurthermore, the superuser's 1494b413dd0Sjdolecek.Ev PATH 1504b413dd0Sjdolecekshould never contain the current directory 1514b413dd0Sjdolecek.Po Dq \&. 1524b413dd0Sjdolecek.Pc . 1534b413dd0Sjdolecek.Ss System date 1544b413dd0SjdolecekCheck the system date with the 1554b413dd0Sjdolecek.Xr date 1 1564b413dd0Sjdolecekcommand. 1574b413dd0SjdolecekIf needed, change the date, and/or change the symbolic link of 1584b413dd0Sjdolecek.Pa /etc/localtime 1594e39658fShubertfto the correct time zone in the 1604b413dd0Sjdolecek.Pa /usr/share/zoneinfo 1614b413dd0Sjdolecekdirectory. 1624b413dd0Sjdolecek.Pp 1634b413dd0SjdolecekExamples: 1644b413dd0Sjdolecek.Bl -tag -width date 165baeda315Snia.It Cm date 202010051820 166baeda315SniaSet the current date to October 5th, 2020 6:20pm. 1674b413dd0Sjdolecek.It Cm ln -fs /usr/share/zoneinfo/Europe/Helsinki /etc/localtime 1684b413dd0SjdolecekSet the time zone to Eastern Europe Summer Time. 1694b413dd0Sjdolecek.El 1704b413dd0Sjdolecek.Ss Console settings 1714b413dd0SjdolecekOne of the first things you will likely need to do is to set up your 1724b413dd0Sjdolecekkeyboard map (and maybe some other aspects about the system console). 1731068f92fSniaTo change your keyboard layout, edit the 174c39edb67Swiz.Dq Va encoding 1754b413dd0Sjdolecekvariable found in 1764b413dd0Sjdolecek.Pa /etc/wscons.conf . 1774b413dd0Sjdolecek.Pp 1784b413dd0Sjdolecek.Xr wscons.conf 5 1794b413dd0Sjdolecekcontains more information about this file. 180e4f8ed19Snia.Ss Security alerts 181e4f8ed19SniaAll significant and easily fixed problems will be reported at 1826fea7fb4Snia.Lk https://www.NetBSD.org/support/security/ the security advisories web page . 183e4f8ed19SniaIt is recommended that you check this page regularly. 184e4f8ed19Snia.Pp 185e4f8ed19SniaAdditionally, you should set 186e4f8ed19Snia.Dq fetch_pkg_vulnerabilities=YES 187e4f8ed19Sniain 188e4f8ed19Snia.Pa /etc/daily.conf 189e4f8ed19Sniato allow your system to automatically update the local database of known 190e4f8ed19Sniavulnerable packages to the latest version available on-line. 191e4f8ed19SniaThe system will later check, on a daily basis, if any of your installed 192e4f8ed19Sniapackages are vulnerable based on the contents of this database. 193e4f8ed19SniaSee 194e4f8ed19Snia.Xr daily.conf 5 195e4f8ed19Sniaand 196e4f8ed19Snia.Xr security.conf 5 197e4f8ed19Sniafor more details. 198e4f8ed19Snia.Ss Entropy 199e4f8ed19SniaIf your machine does not have a hardware random number generator, it 200e4f8ed19Sniamay not be safe to use on the internet until it has enough entropy to 201e4f8ed19Sniagenerate unpredictable secrets for programs like web browsers and 202e4f8ed19Snia.Xr ssh 1 . 203e4f8ed19SniaYou can use 204e4f8ed19Snia.Xr rndctl 8 205e4f8ed19Sniato list the entropy sources with 206e4f8ed19Snia.Ic rndctl -l , 207e4f8ed19Sniaor save entropy from another machine running 208e4f8ed19Snia.Nx 209e4f8ed19Sniawith 210e4f8ed19Snia.Ic rndctl -S 211e4f8ed19Sniaand load it on this one with 212e4f8ed19Snia.Ic rndctl -L 213e4f8ed19Snia(as long as there are no eavesdroppers on the medium between the two 214e4f8ed19Sniamachines). 215e4f8ed19SniaSee 216e4f8ed19Snia.Xr entropy 7 217e4f8ed19Sniafor more details. 2184b413dd0Sjdolecek.Ss Check hostname 2194b413dd0SjdolecekUse the 2204b413dd0Sjdolecek.Ic hostname 2214b413dd0Sjdolecekcommand to verify that the name of your machine is correct. 2224b413dd0SjdolecekSee the man page for 2234b413dd0Sjdolecek.Xr hostname 1 2244b413dd0Sjdolecekif it needs to be changed. 2254b413dd0SjdolecekYou will also need to change the contents of the 226c39edb67Swiz.Dq Va hostname 2274b413dd0Sjdolecekvariable in 2284b413dd0Sjdolecek.Pa /etc/rc.conf 2294b413dd0Sjdolecekor edit the 2304b413dd0Sjdolecek.Pa /etc/myname 2314e39658fShubertffile to have it stick around for the next reboot. 23268ce5cccSsnjNote that 23368ce5cccSsnj.Dq Va hostname 23468ce5cccSsnjis supposed include a domainname, and that this should 2354e39658fShubertfnot be confused with YP (NIS) 236218d0a78Swiz.Xr domainname 1 . 237147b99baStsutsuiIf you are using 238a1249432Sroy.Xr dhcpcd 8 239147b99baStsutsuito configure network interfaces, it might override these local hostname 240147b99baStsutsuisettings if your DHCP server specifies client's hostname with other network 241147b99baStsutsuiconfigurations. 2424b413dd0Sjdolecek.Ss Verify network interface configuration 2434b413dd0SjdolecekThe first thing to do is an 2444b413dd0Sjdolecek.Ic ifconfig -a 2454b413dd0Sjdolecekto see if the network interfaces are properly configured. 2464b413dd0SjdolecekCorrect by editing 2474b413dd0Sjdolecek.Pa /etc/ifconfig. Ns Ar interface 2484e39658fShubertfor the corresponding 2494e39658fShubertf.Dq Va ifconfig_ Ns Ar interface 2504e39658fShubertfvariable in 2514e39658fShubertf.Xr rc.conf 5 2524b413dd0Sjdolecek(where 2534b413dd0Sjdolecek.Ar interface 2544b413dd0Sjdolecekis the interface name, e.g., 2554b413dd0Sjdolecek.Dq le0 ) 2564b413dd0Sjdolecekand then using 2574b413dd0Sjdolecek.Xr ifconfig 8 2584b413dd0Sjdolecekto manually configure it 2594b413dd0Sjdolecekif you do not wish to reboot. 2604e39658fShubertf.Pp 261e4f8ed19SniaAlternatively, many networks allow interfaces to be configured 262e4f8ed19Sniaautomatically via DHCP. 263cc55bad4SwizTo get 264a1249432Sroy.Xr dhcpcd 8 265147b99baStsutsuito start automatically on boot, 266147b99baStsutsuiyou will need to have this line in 267147b99baStsutsui.Pa /etc/rc.conf : 268147b99baStsutsui.Pp 269a1249432Sroy.Dl dhcpcd=YES 270147b99baStsutsui.Pp 271147b99baStsutsuiSee 272a1249432Sroy.Xr dhcpcd 8 273147b99baStsutsuiand 274a1249432Sroy.Xr dhcpcd.conf 5 275cc55bad4Swizfor more information on setting up a DHCP client. 276e4f8ed19SniaFor information on setting up Wi-Fi, see 277e4f8ed19Snia.Sx Wireless networking . 278147b99baStsutsui.Pp 2794e39658fShubertfYou can add new 2804e39658fShubertf.Dq virtual interfaces 2814e39658fShubertfby adding the required entries to 2824e39658fShubertf.Pa /etc/ifconfig. Ns Ar interface . 2834b413dd0SjdolecekRead the 2844b413dd0Sjdolecek.Xr ifconfig.if 5 2854b413dd0Sjdolecekman page for more information on the format of 2864b413dd0Sjdolecek.Pa /etc/ifconfig. Ns Ar interface 2874b413dd0Sjdolecekfiles. 2884b413dd0SjdolecekThe loopback interface will look something like: 2894b413dd0Sjdolecek.Bd -literal -offset indent 29001869ca4Swizlo0: flags=8009<UP,LOOPBACK,MULTICAST> mtu 32972 2914b413dd0Sjdolecek inet 127.0.0.1 netmask 0xff000000 2924b413dd0Sjdolecek inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 2934b413dd0Sjdolecek inet6 ::1 prefixlen 128 2944b413dd0Sjdolecek.Ed 2954b413dd0Sjdolecek.Pp 2964b413dd0Sjdolecekan Ethernet interface something like: 2974b413dd0Sjdolecek.Bd -literal -offset indent 29801869ca4Swizle0: flags=9863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> 2994b413dd0Sjdolecek inet 192.168.4.52 netmask 0xffffff00 broadcast 192.168.4.255 3004b413dd0Sjdolecek inet6 fe80::5ef0:f0f0%le0 prefixlen 64 scopeid 0x1 3014b413dd0Sjdolecek.Ed 3024b413dd0Sjdolecek.Pp 3034e39658fShubertfand a PPP interface something like: 3044b413dd0Sjdolecek.Bd -literal -offset indent 30501869ca4Swizppp0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> 30601869ca4Swiz inet 203.3.131.108 --> 198.181.0.253 netmask 0xffff0000 3074b413dd0Sjdolecek.Ed 3084b413dd0Sjdolecek.Pp 3094b413dd0SjdolecekSee 310218d0a78Swiz.Xr mrouted 8 3114b413dd0Sjdolecekfor instructions on configuring multicast routing. 3124b413dd0Sjdolecek.Ss Check routing tables 3134b413dd0SjdolecekIssue a 3144b413dd0Sjdolecek.Ic netstat -rn 3154b413dd0Sjdolecekcommand. 3164b413dd0SjdolecekThe output will look something like: 3174b413dd0Sjdolecek.Bd -literal -offset indent 3184b413dd0SjdolecekRouting tables 3194b413dd0Sjdolecek 3204b413dd0SjdolecekInternet: 3214b413dd0SjdolecekDestination Gateway Flags Refs Use Mtu Interface 3224b413dd0Sjdolecekdefault 192.168.4.254 UGS 0 11098028 - le0 3234b413dd0Sjdolecek127 127.0.0.1 UGRS 0 0 - lo0 3244b413dd0Sjdolecek127.0.0.1 127.0.0.1 UH 3 24 - lo0 3254b413dd0Sjdolecek192.168.4 link#1 UC 0 0 - le0 3264b413dd0Sjdolecek192.168.4.52 8:0:20:73:b8:4a UHL 1 6707 - le0 3274b413dd0Sjdolecek192.168.4.254 0:60:3e:99:67:ea UHL 1 0 - le0 3284b413dd0Sjdolecek 3294b413dd0SjdolecekInternet6: 3304b413dd0SjdolecekDestination Gateway Flags Refs Use Mtu Interface 33101869ca4Swiz::/96 ::1 UGRS 0 0 32972 lo0 => 3324b413dd0Sjdolecek::1 ::1 UH 4 0 32972 lo0 3334b413dd0Sjdolecek::ffff:0.0.0.0/96 ::1 UGRS 0 0 32972 lo0 3344b413dd0Sjdolecekfc80::/10 ::1 UGRS 0 0 32972 lo0 3354b413dd0Sjdolecekfe80::/10 ::1 UGRS 0 0 32972 lo0 3364b413dd0Sjdolecekfe80::%le0/64 link#1 UC 0 0 1500 le0 3374b413dd0Sjdolecekfe80::%lo0/64 fe80::1%lo0 U 0 0 32972 lo0 3384b413dd0Sjdolecekff01::/32 ::1 U 0 0 32972 lo0 3394b413dd0Sjdolecekff02::%le0/32 link#1 UC 0 0 1500 le0 3404b413dd0Sjdolecekff02::%lo0/32 fe80::1%lo0 UC 0 0 32972 lo0 3414b413dd0Sjdolecek.Ed 3424b413dd0Sjdolecek.Pp 3434b413dd0SjdolecekThe default gateway address is stored in the 344c39edb67Swiz.Dq Va defaultroute 3454e39658fShubertfvariable in 3464b413dd0Sjdolecek.Pa /etc/rc.conf , 3474b413dd0Sjdolecekor in the file 3484b413dd0Sjdolecek.Pa /etc/mygate . 3494b413dd0SjdolecekIf you need to edit this file, a painless way to reconfigure the network 3504b413dd0Sjdolecekafterwards is to issue 3514b413dd0Sjdolecek.Bd -literal -offset indent 3522a63a35fSriastradh.Ic service network restart 3534b413dd0Sjdolecek.Ed 3544b413dd0Sjdolecek.Pp 3554b413dd0SjdolecekOr, you may prefer to manually configure using a series of 3564b413dd0Sjdolecek.Ic route add 3574b413dd0Sjdolecekand 3584b413dd0Sjdolecek.Ic route delete 3594b413dd0Sjdolecekcommands (see 3604b413dd0Sjdolecek.Xr route 8 ) . 3614b413dd0SjdolecekIf you run 362a1249432Sroy.Xr dhcpcd 8 363a1249432Sroyyou will have to kill it by running 364a1249432Sroy.Bd -literal -offset indent 3652a63a35fSriastradh.Ic service dhcpcd stop 3664b413dd0Sjdolecek.Ed 367624d8cd9Swiz.Pp 368a1249432Sroybefore you flush the routes. 3694b413dd0Sjdolecek.Pp 3704e39658fShubertfIf you wish to route packets between interfaces, add one or both 3714e39658fShubertfof the following directives (depending on whether IPv4 or IPv6 routing 3724e39658fShubertfis required) to 3734e39658fShubertf.Pa /etc/sysctl.conf : 3744e39658fShubertf.Pp 3754b413dd0Sjdolecek.Dl net.inet.ip.forwarding=1 3764b413dd0Sjdolecek.Dl net.inet6.ip6.forwarding=1 3774b413dd0Sjdolecek.Pp 3784e39658fShubertfAs an alternative, compile a new kernel with the 379c8e910afSsnj.Dq GATEWAY 3804b413dd0Sjdolecekoption. 3814b413dd0SjdolecekPackets are not forwarded by default, due to RFC requirements. 38275bbbb98Snia.Ss Device nodes 38375bbbb98SniaBy default, nodes are created in 38475bbbb98Snia.Pa /dev 38575bbbb98Sniafor a fairly typical number of devices. 38675bbbb98Snia.Pp 38775bbbb98SniaHowever, if this system has a large number of devices connected 38875bbbb98Snia(e.g. for large scale storage), you may want to enable 38975bbbb98Snia.Xr devpubd 8 39075bbbb98Sniato ensure a sufficient number of nodes are available. 39175bbbb98SniaSet 39275bbbb98Snia.Dq Va devpubd=YES 39375bbbb98Sniain 39475bbbb98Snia.Pa /etc/rc.conf 39575bbbb98Sniato create nodes automatically during system runtime. 39675bbbb98SniaYou can also run the node creation script by hand: 39775bbbb98Snia.Bd -literal -offset indent 39875bbbb98Snia.Ic cd /dev && sh MAKEDEV 39975bbbb98Snia.Ed 400c8e910afSsnj.Ss Secure Shell (SSH) 4014e39658fShubertfBy default, all services are disabled in a fresh 4024e39658fShubertf.Nx 403c8e910afSsnjinstallation, and SSH is no exception. 4048a4655ceSwizYou may wish to enable it so you can remotely control your system. 4054e39658fShubertfSet 406c8e910afSsnj.Dq Va sshd=YES 4074e39658fShubertfin 4084b413dd0Sjdolecek.Pa /etc/rc.conf 4094b413dd0Sjdolecekand then starting the server with the command 4104b413dd0Sjdolecek.Bd -literal -offset indent 4112a63a35fSriastradh.Ic service sshd start 4124b413dd0Sjdolecek.Ed 4134b413dd0Sjdolecek.Pp 4144b413dd0SjdolecekThe first time the server is started, it will generate a new keypair, 4154b413dd0Sjdolecekwhich will be stored inside the directory 4164b413dd0Sjdolecek.Pa /etc/ssh . 4170f6a31aaSriastradh.Ss Host names and DNS 4180f6a31aaSriastradhThe system resolves host names according the rules for hosts in the 4190f6a31aaSriastradhname service switch configuration at 4200f6a31aaSriastradh.Pa /etc/nsswitch.conf . 4210f6a31aaSriastradhBy default, it will query 4220f6a31aaSriastradh.Pa /etc/hosts 4230f6a31aaSriastradhfirst, and then the DNS resolver specified in 4240f6a31aaSriastradh.Pa /etc/resolv.conf . 4254b413dd0Sjdolecek.Pp 4265d8c0724SniaMulticast DNS and DNS Service Discovery are usually not enabled by 4271068f92fSniadefault on a fresh 4281068f92fSnia.Nx 4291068f92fSniasystem, and can be enabled by setting 4305d8c0724Snia.Dq mdnsd=YES 4315d8c0724Sniain 4325d8c0724Snia.Pa /etc/rc.conf , 4335d8c0724Sniaand either rebooting or running the following command: 4345d8c0724Snia.Bd -literal -offset indent 4355d8c0724Snia.Ic service mdnsd start 4365d8c0724Snia.Ed 4375d8c0724Snia.Pp 438e4f8ed19SniaYou may also wish to enable mdnsd as a source for host lookups 439e4f8ed19Sniain 440e4f8ed19Snia.Pa /etc/nsswitch.conf , 441e4f8ed19Sniasee 442e4f8ed19Snia.Xr nsswitch.conf 5 . 443e4f8ed19Snia.Pp 4440f6a31aaSriastradhIf your network does not have a usable DNS resolver, e.g. one provided 4450f6a31aaSriastradhby DHCP, you can run a local caching recursive resolver by setting 446c8e910afSsnj.Dq named=YES 447c8e910afSsnjin 4484b413dd0Sjdolecek.Pa /etc/rc.conf 4490f6a31aaSriastradhand either rebooting or running the following command: 4500f6a31aaSriastradh.Bd -literal -offset indent 4512a63a35fSriastradh.Ic service named start 4520f6a31aaSriastradh.Ed 4530f6a31aaSriastradh.Pp 4544b413dd0Sjdolecek.Xr named 8 4550f6a31aaSriastradhis configured in 4560f6a31aaSriastradh.Pa /etc/named.conf 4570f6a31aaSriastradhby default to run as a local caching recursive resolver. 4580f6a31aaSriastradhThen, to make the system use it, put the following in 4590f6a31aaSriastradh.Pa /etc/resolv.conf : 4600f6a31aaSriastradh.Bd -literal -offset indent 4610f6a31aaSriastradhnameserver 127.0.0.1 4620f6a31aaSriastradh.Ed 4635011d7a9Smaya.Ss Wireless networking 46440ec0685SniaTo configure the system to connect to a Wi-Fi network with a password 4655312d4afSniausing WPA: 4665011d7a9Smaya.Bd -literal -offset indent 4670837df3bSmaya.Ic wpa_passphrase networkname password >> /etc/wpa_supplicant.conf 4685011d7a9Smaya.Ed 4695011d7a9Smaya.Pp 470*ba290545SkreTo configure the system to connect to an open wireless network with 4715312d4afSniano password, edit 47221521a3cSnia.Pa /etc/wpa_supplicant.conf 47321521a3cSniainstead of using 47421521a3cSnia.Xr wpa_passphrase 8 : 47521521a3cSnia.Bd -literal -offset indent 47621521a3cSnianetwork={ 47721521a3cSnia ssid="Public-WiFi" 47821521a3cSnia key_mgmt=NONE 47921521a3cSnia priority=100 48021521a3cSnia} 48121521a3cSnia.Ed 48221521a3cSnia.Pp 483a52c896fSniaThen bring up the interface and start the necessary daemons: 4845312d4afSnia.Bd -literal -offset indent 485a52c896fSnia.Ic ifconfig iwm0 up 4865312d4afSnia.Ic service wpa_supplicant onestart 4875312d4afSnia.Ic service dhcpcd onestart 4885312d4afSnia.Ed 4895312d4afSnia.Pp 4900837df3bSmayaTo automatically connect at boot, add the following to 4919bc1e477Smaya.Pa /etc/rc.conf : 4929bc1e477Smaya.Pp 493a52c896fSnia.Dl ifconfig_iwm0="up" 4949bc1e477Smaya.Dl dhcpcd=YES 4959bc1e477Smaya.Dl wpa_supplicant=YES 4962143acc3Snia.Pp 4972143acc3SniaWhile using 4982143acc3Snia.Xr wpa_supplicant 8 , 4995312d4afSniayou can easily retrieve network scan results with 5002143acc3Snia.Xr wpa_cli 8 : 5012143acc3Snia.Bd -literal -offset indent 5022143acc3Snia.Ic wpa_cli scan_results 5032143acc3Snia.Ed 5042143acc3Snia.Pp 5052143acc3SniaOr trigger a rescan: 5062143acc3Snia.Bd -literal -offset indent 5072143acc3Snia.Ic wpa_cli scan 5082143acc3Snia.Ed 5094e39658fShubertf.Ss RPC-based network services 5104e39658fShubertfSeveral services depend on the RPC portmapper 5114e39658fShubertf.Xr rpcbind 8 5124e39658fShubertf- formerly known as 51316bb723dSwiz.Ic portmap 51416bb723dSwiz- being running for proper operation. 5154e39658fShubertfThis includes YP (NIS) and NFS exports, among other services. 5164e39658fShubertfTo get the RPC portmapper to start automatically on boot, 5174e39658fShubertfyou will need to have this line in 5184e39658fShubertf.Pa /etc/rc.conf : 5194e39658fShubertf.Pp 520e1ee35d1Swiz.Dl rpcbind=YES 521e4f8ed19Snia.Ss YP (Network Information Service) Setup 5224b413dd0SjdolecekCheck the YP domain name with the 5234b413dd0Sjdolecek.Xr domainname 1 5244b413dd0Sjdolecekcommand. 5254b413dd0SjdolecekIf necessary, correct it by editing the 5264b413dd0Sjdolecek.Pa /etc/defaultdomain 5274b413dd0Sjdolecekfile or by setting the 528c39edb67Swiz.Dq Va domainname 5294b413dd0Sjdolecekvariable in 5304b413dd0Sjdolecek.Pa /etc/rc.conf . 5314b413dd0SjdolecekThe 5324b413dd0Sjdolecek.Pa /etc/rc.d/network 5334b413dd0Sjdolecekscript reads this file on bootup to determine and set the domain name. 5344b413dd0SjdolecekYou may also set the running system's domain name with the 5354b413dd0Sjdolecek.Xr domainname 1 5364b413dd0Sjdolecekcommand. 5374b413dd0SjdolecekTo start YP client services, simply run 5384b413dd0Sjdolecek.Ic ypbind , 5394b413dd0Sjdolecekthen perform the remaining 5404b413dd0SjdolecekYP activation as described in 5414b413dd0Sjdolecek.Xr passwd 5 5424b413dd0Sjdolecekand 5434b413dd0Sjdolecek.Xr group 5 . 5444b413dd0Sjdolecek.Pp 5454e39658fShubertfIn particular, to enable YP passwd support, you'll need to update 5464b413dd0Sjdolecek.Pa /etc/nsswitch.conf 5474b413dd0Sjdolecekto include 5484b413dd0Sjdolecek.Dq nis 5494b413dd0Sjdolecekfor the 5504b413dd0Sjdolecek.Dq passwd 5514e39658fShubertfand 5524e39658fShubertf.Dq group 5534e39658fShubertfentries. 5548a4655ceSwizA traditional way to accomplish the same thing is to 5554b413dd0Sjdolecekadd following entry to local passwd database via 5564b413dd0Sjdolecek.Xr vipw 8 : 5574b413dd0Sjdolecek.Bd -literal -offset indent 5584b413dd0Sjdolecek.Li +:*:::::::: 5594b413dd0Sjdolecek.Ed 560624d8cd9Swiz.Pp 5618a4655ceSwizNote this entry has to be the very last one. 5628a4655ceSwizThis traditional way works with the default 5634b413dd0Sjdolecek.Xr nsswitch.conf 5 5644b413dd0Sjdoleceksetting of 5654b413dd0Sjdolecek.Dq passwd , 5664b413dd0Sjdolecekwhich is 5674b413dd0Sjdolecek.Dq compat . 5684b413dd0Sjdolecek.Pp 5694e39658fShubertfThere are many more YP man pages available to help you. 5704b413dd0SjdolecekYou can find more information by starting with 5711b55e10fSreed.Xr nis 8 . 5724b413dd0Sjdolecek.Ss Check disk mounts 5734b413dd0SjdolecekCheck that the disks are mounted correctly by 5744b413dd0Sjdolecekcomparing the 5754b413dd0Sjdolecek.Pa /etc/fstab 5764b413dd0Sjdolecekfile against the output of the 5774b413dd0Sjdolecek.Xr mount 8 5784b413dd0Sjdolecekand 5794b413dd0Sjdolecek.Xr df 1 5804b413dd0Sjdolecekcommands. 5814b413dd0SjdolecekExample: 5824b413dd0Sjdolecek.Bd -literal -offset indent 5834b413dd0Sjdolecek.Li # Ic cat /etc/fstab 5844b413dd0Sjdolecek/dev/sd0a / ffs rw 1 1 5854e39658fShubertf/dev/sd0b none swap sw 5869029dfc4Shubertf/dev/sd0e /usr ffs rw 1 2 5879029dfc4Shubertf/dev/sd0f /var ffs rw 1 3 5889029dfc4Shubertf/dev/sd0g /tmp ffs rw 1 4 5899029dfc4Shubertf/dev/sd0h /home ffs rw 1 5 5904e39658fShubertf 5914b413dd0Sjdolecek.Li # Ic mount 5924b413dd0Sjdolecek/dev/sd0a on / type ffs (local) 5939029dfc4Shubertf/dev/sd0e on /usr type ffs (local) 5949029dfc4Shubertf/dev/sd0f on /var type ffs (local) 5959029dfc4Shubertf/dev/sd0g on /tmp type ffs (local) 5969029dfc4Shubertf/dev/sd0h on /home type ffs (local) 5974e39658fShubertf 5984b413dd0Sjdolecek.Li # Ic df 5994b413dd0SjdolecekFilesystem 1024-blocks Used Avail Capacity Mounted on 6004b413dd0Sjdolecek/dev/sd0a 22311 14589 6606 69% / 6014b413dd0Sjdolecek/dev/sd0e 203399 150221 43008 78% /usr 6024b413dd0Sjdolecek/dev/sd0f 10447 682 9242 7% /var 6034b413dd0Sjdolecek/dev/sd0g 18823 2 17879 0% /tmp 6044b413dd0Sjdolecek/dev/sd0h 7519 5255 1888 74% /home 6054e39658fShubertf 6064b413dd0Sjdolecek.Li # Ic pstat -s 6074b413dd0SjdolecekDevice 512-blocks Used Avail Capacity Priority 6084b413dd0Sjdolecek/dev/sd0b 131072 84656 46416 65% 0 6094b413dd0Sjdolecek.Ed 6104b413dd0Sjdolecek.Pp 6114b413dd0SjdolecekEdit 6124b413dd0Sjdolecek.Pa /etc/fstab 6134b413dd0Sjdolecekand use the 6144b413dd0Sjdolecek.Xr mount 8 6154b413dd0Sjdolecekand 6164b413dd0Sjdolecek.Xr umount 8 6174b413dd0Sjdolecekcommands as appropriate. 6184b413dd0SjdolecekRefer to the above example and 6194b413dd0Sjdolecek.Xr fstab 5 6204b413dd0Sjdolecekfor information on the format of this file. 6214b413dd0Sjdolecek.Pp 6224b413dd0SjdolecekYou may wish to do NFS mounts now too, or you can do them later. 6232c36209bSpeter.Ss Clock synchronization 6242c36209bSpeterIn order to make sure the system clock is synchronized 6254e39658fShubertfto that of a publicly accessible NTP server, 6264e39658fShubertfmake sure that 6274e39658fShubertf.Pa /etc/rc.conf 6284e39658fShubertfcontains the following: 6294e39658fShubertf.Pp 630c8e910afSsnj.Dl ntpdate=YES 631c8e910afSsnj.Dl ntpd=YES 6324e39658fShubertf.Pp 6334e39658fShubertfSee 6344e39658fShubertf.Xr date 1 , 6354e39658fShubertf.Xr ntpdate 8 , 6364e39658fShubertf.Xr ntpd 8 , 6374e39658fShubertf.Xr rdate 8 , 6384e39658fShubertfand 6394e39658fShubertf.Xr timed 8 6404e39658fShubertffor more information on setting the system's date. 641306a842fSwiz.Ss Installing packages 6421068f92fSniaThe 6431068f92fSnia.Nx 6441068f92fSniapackages collection, pkgsrc, includes a large set of third-party software. 6451068f92fSniaA lot of it is available as binary packages that you can download from 6461068f92fSnia.Lk https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/ 6471068f92fSniaor a mirror. 6481068f92fSnia.Pp 6491068f92fSniaFor most users, using pkgin to manage binary packages is recommended. 6501068f92fSnia.Pp 6511068f92fSniaTo install pkgin, if it was not done by the installer: 6521068f92fSnia.Bd -literal -offset indent 6531068f92fSnia.Ic PKG_PATH=https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/[...] 6541068f92fSnia.Ic export PKG_PATH 6551068f92fSnia.Ic pkg_add pkgin 6561068f92fSnia.Ic pkgin update 6571068f92fSnia.Ic pkgin install bash mpg123 fluxbox ... 6581068f92fSnia.Ed 6591068f92fSnia.Pp 6601068f92fSniaSee 6611068f92fSnia.Lk https://www.pkgsrc.org/ 6621068f92fSniaand 6631068f92fSnia.Pa pkgsrc/doc/pkgsrc.txt 6641068f92fSniafor more details. 6654e39658fShubertf.Sh CHANGING /etc FILES 6664e39658fShubertfThe system should be usable now, but you may wish to do more customizing, 6674e39658fShubertfsuch as adding users, etc. 6684b413dd0SjdolecekMany of the following sections may be skipped 6694b413dd0Sjdolecekif you are not using that package (for example, skip the 6704b413dd0Sjdolecek.Sx Kerberos 6714b413dd0Sjdoleceksection if you won't be using Kerberos). 6724b413dd0SjdolecekWe suggest that you 6734b413dd0Sjdolecek.Ic cd /etc 6744b413dd0Sjdolecekand edit most of the files in that directory. 6754b413dd0Sjdolecek.Pp 6764b413dd0SjdolecekNote that the 6774b413dd0Sjdolecek.Pa /etc/motd 6784b413dd0Sjdolecekfile is modified by 6794b413dd0Sjdolecek.Pa /etc/rc.d/motd 6804b413dd0Sjdolecekwhenever the system is booted. 6814b413dd0SjdolecekTo keep any custom message intact, ensure that you leave two blank lines 6824b413dd0Sjdolecekat the top, or your message will be overwritten. 6834b413dd0Sjdolecek.Ss Add new users 6844e39658fShubertfTo add new users and groups, there are 6854b413dd0Sjdolecek.Xr useradd 8 6864b413dd0Sjdolecekand 68729aa1b84Ssnj.Xr groupadd 8 ; 6884e39658fShubertfsee also 6894e39658fShubertf.Xr user 8 69099445dedSmikefor further programs for user and group manipulation. 6914b413dd0SjdolecekYou may use 6924b413dd0Sjdolecek.Xr vipw 8 6934b413dd0Sjdolecekto add users to the 6944b413dd0Sjdolecek.Pa /etc/passwd 6954b413dd0Sjdolecekfile 6964b413dd0Sjdolecekand edit 6974b413dd0Sjdolecek.Pa /etc/group 6984b413dd0Sjdolecekby hand to add new groups. 6994b413dd0SjdolecekThe manual page for 7004b413dd0Sjdolecek.Xr su 1 , 7014b413dd0Sjdolecektells you to make sure to put people in 7024b413dd0Sjdolecekthe 7034b413dd0Sjdolecek.Sq wheel 7044b413dd0Sjdolecekgroup if they need root access (non-Kerberos). 7054b413dd0SjdolecekFor example: 7064b413dd0Sjdolecek.Bd -literal -offset indent 7074b413dd0Sjdolecekwheel:*:0:root,myself 7084b413dd0Sjdolecek.Ed 7094b413dd0Sjdolecek.Pp 7104b413dd0SjdolecekFollow instructions for 7114b413dd0Sjdolecek.Xr kerberos 8 7124b413dd0Sjdolecekif using 7134b413dd0SjdolecekKerberos 7144b413dd0Sjdolecekfor authentication. 7154e39658fShubertf.Ss System boot scripts and /etc/rc.local 7164e39658fShubertf.Pa /etc/rc 7174e39658fShubertfand the 71861b48ddaSwiz.Pa /etc/rc.d/* 7194e39658fShubertfscripts are invoked at boot time after single user mode has exited, 7204e39658fShubertfand at shutdown. 721beb8d4ffSwizThe whole process is controlled by the master script 7224e39658fShubertf.Pa /etc/rc . 7234e39658fShubertfThis script should not be changed by administrators. 7244b413dd0Sjdolecek.Pp 7254e39658fShubertfThe directory 7264e39658fShubertf.Pa /etc/rc.d 727f76e5aa2Sdhollandcontains a series of scripts used at startup/shutdown, called by 7284e39658fShubertf.Pa /etc/rc . 7294e39658fShubertf.Pa /etc/rc 7304e39658fShubertfis in turn influenced by the configuration variables present in 7314e39658fShubertf.Pa /etc/rc.conf . 7324e39658fShubertf.Pp 7334e39658fShubertfThe script 734218d0a78Swiz.Pa /etc/rc.local 7354b413dd0Sjdolecekis run as the last thing during multiuser boot, and is provided 7364b413dd0Sjdolecekto allow any other local hooks necessary for the system. 7374e39658fShubertf.Ss rc.conf 7384e39658fShubertfTo enable or disable various services on system startup, 7394e39658fShubertfcorresponding entries can be made in 7404e39658fShubertf.Pa /etc/rc.conf . 7414e39658fShubertfYou can take a look at 7424b413dd0Sjdolecek.Pa /etc/defaults/rc.conf 7434b413dd0Sjdolecekto see a list of default system variables, which you can override in 7444b413dd0Sjdolecek.Pa /etc/rc.conf . 7454b413dd0SjdolecekNote you are 7464b413dd0Sjdolecek.Em not 7474b413dd0Sjdoleceksupposed to change 7484b413dd0Sjdolecek.Pa /etc/defaults/rc.conf 7494b413dd0Sjdolecekdirectly, edit only 7504b413dd0Sjdolecek.Pa /etc/rc.conf . 7514b413dd0SjdolecekSee 7524b413dd0Sjdolecek.Xr rc.conf 5 7534b413dd0Sjdolecekfor further information. 7541068f92fSnia.Ss Automounter daemon (AMD) 7551068f92fSniaTo use the 7561068f92fSnia.Xr amd 8 7571068f92fSniaautomounter, create the 7581068f92fSnia.Pa /etc/amd 7591068f92fSniadirectory, copy example config files from 7601068f92fSnia.Pa /usr/share/examples/amd 7611068f92fSniato 7621068f92fSnia.Pa /etc/amd 7631068f92fSniaand customize them as needed. 7641068f92fSniaAlternatively, you can get your maps with YP. 7651068f92fSnia.Ss Concatenated disks (ccd) 7661068f92fSniaIf you are using 7671068f92fSnia.Xr ccd 4 7681068f92fSniaconcatenated disks, edit 7691068f92fSnia.Pa /etc/ccd.conf . 7701068f92fSniaYou may wish to take a look to 7711068f92fSnia.Xr ccdconfig 8 7721068f92fSniafor more information about this file. 7731068f92fSniaUse the 7741068f92fSnia.Ic ccdconfig -U 7751068f92fSniacommand to unload and the 7761068f92fSnia.Ic ccdconfig -C 7771068f92fSniacommand to create tables internal to the kernel for the concatenated disks. 7781068f92fSniaYou then 7791068f92fSnia.Xr mount 8 , 7801068f92fSnia.Xr umount 8 , 7811068f92fSniaand edit 7821068f92fSnia.Pa /etc/fstab 7831068f92fSniaas needed. 784e4f8ed19Snia.Ss Nx Packet Filter 785e4f8ed19Snia.Xr npf 7 786e4f8ed19Sniais the default firewall used on 787e4f8ed19Snia.Nx . 788e4f8ed19SniaYou may wish to enable it if your machine is connected directly to the 789e4f8ed19Sniainternet. 790e4f8ed19SniaTo do this, edit 791e4f8ed19Snia.Pa /etc/npf.conf 792e4f8ed19Sniaand set 793e4f8ed19Snia.Dq npf=YES 794e4f8ed19Sniain 795e4f8ed19Snia.Pa /etc/rc.conf . 796e4f8ed19SniaConfiguration examples for NPF can be found in 797e4f8ed19Snia.Pa /usr/share/examples/npf . 798e4f8ed19SniaBefore installing a configuration, you can validate it with 799e4f8ed19Snia.Xr npfctl 8 . 800c8e910afSsnj.Ss X Display Manager 8014b413dd0SjdolecekIf you've installed X, you may want to turn on 8024b413dd0Sjdolecek.Xr xdm 1 , 8034b413dd0Sjdolecekthe X Display Manager. 804c8e910afSsnjTo do this, set 805c8e910afSsnj.Dq xdm=YES 806c8e910afSsnjin 807c8e910afSsnj.Pa /etc/rc.conf . 8084b413dd0Sjdolecek.Ss Printers 8094b413dd0SjdolecekEdit 8104b413dd0Sjdolecek.Pa /etc/printcap 8114b413dd0Sjdolecekand 8124b413dd0Sjdolecek.Pa /etc/hosts.lpd 8134b413dd0Sjdolecekto get any printers set up. 8144b413dd0SjdolecekConsult 8154b413dd0Sjdolecek.Xr lpd 8 8164b413dd0Sjdolecekand 8174b413dd0Sjdolecek.Xr printcap 5 8184b413dd0Sjdolecekif needed. 819e4f8ed19Snia.Ss Internet Services (inetd) 820e4f8ed19SniaVarious internet services can be enabled in 821e4f8ed19Snia.Pa /etc/inetd.conf , 822e4f8ed19Sniaincluding 823e4f8ed19Snia.Xr httpd 8 824e4f8ed19Sniaand 825e4f8ed19Snia.Xr finger 1 . 8268a4655ceSwizNote that by default all services are disabled for security reasons. 827e4f8ed19SniaOnly add things that are really needed. 8284b413dd0Sjdolecek.Ss Kerberos 8294e39658fShubertfIf you are going to use Kerberos for authentication, 8304e39658fShubertfsee 8314b413dd0Sjdolecek.Xr kerberos 8 8324e39658fShubertfand 8334e39658fShubertf.Dq info heimdal 834649791bdSwizfor more information. 835649791bdSwizIf you already have a Kerberos master, change directory to 8364b413dd0Sjdolecek.Pa /etc/kerberosV 8374b413dd0Sjdolecekand configure. 8384b413dd0SjdolecekRemember to get a 8394b413dd0Sjdolecek.Pa srvtab 8404b413dd0Sjdolecekfrom the master so that the remote commands work. 8414b413dd0Sjdolecek.Ss Mail Aliases 8424b413dd0SjdolecekCheck 8434b413dd0Sjdolecek.Pa /etc/mail/aliases 8444b413dd0Sjdolecekand update appropriately if you want e-mail to be routed 84568ce5cccSsnjto non-local addresses or to different users. 8464b413dd0Sjdolecek.Pp 8474b413dd0SjdolecekRun 848218d0a78Swiz.Xr newaliases 1 8494b413dd0Sjdolecekafter changes. 8504b413dd0Sjdolecek.Ss Postfix 8514b413dd0Sjdolecek.Nx 852e4f8ed19Sniauses Postfix as its Mail Transfer Agent. 85368ce5cccSsnjPostfix is started by default, but its initial configuration does not 85468ce5cccSsnjcause it to listen on the network for incoming connections. 85568ce5cccSsnjTo configure Postfix, see 8564b413dd0Sjdolecek.Pa /etc/postfix/main.cf 85768ce5cccSsnjand 85868ce5cccSsnj.Pa /etc/postfix/master.cf . 85968ce5cccSsnjIf you wish to use a different MTA (e.g., sendmail), install your MTA of 86068ce5cccSsnjchoice and edit 8614b413dd0Sjdolecek.Pa /etc/mailer.conf 86268ce5cccSsnjto point to the proper binaries. 8634b413dd0Sjdolecek.Ss DHCP server 8644b413dd0SjdolecekIf this is a 8654b413dd0SjdolecekDHCP 8664b413dd0Sjdolecekserver, edit 8674b413dd0Sjdolecek.Pa /etc/dhcpd.conf 8684b413dd0Sjdolecekand 8694b413dd0Sjdolecek.Pa /etc/dhcpd.interfaces 8704b413dd0Sjdolecekas needed. 8714b413dd0SjdolecekYou will have to make sure 8724b413dd0Sjdolecek.Pa /etc/rc.conf 873c8e910afSsnjhas 874c8e910afSsnj.Dq dhcpd=YES 8754b413dd0Sjdolecekor run 8764b413dd0Sjdolecek.Xr dhcpd 8 8774b413dd0Sjdolecekmanually. 8784b413dd0Sjdolecek.Ss Bootparam server 8794b413dd0SjdolecekIf this is a 8804b413dd0SjdolecekBootparam 8814b413dd0Sjdolecekserver, edit 8824b413dd0Sjdolecek.Pa /etc/bootparams 8834b413dd0Sjdolecekas needed. 8844b413dd0SjdolecekYou will have to turn it on in 8854b413dd0Sjdolecek.Pa /etc/rc.conf 886c8e910afSsnjby adding 887c8e910afSsnj.Dq bootparamd=YES . 8884b413dd0Sjdolecek.Ss NFS server 8894b413dd0SjdolecekIf this is an NFS server, make sure 8904b413dd0Sjdolecek.Pa /etc/rc.conf 8914b413dd0Sjdolecekhas: 8924b413dd0Sjdolecek.Bd -literal -offset indent 893c8e910afSsnjnfs_server=YES 894c8e910afSsnjmountd=YES 895c8e910afSsnjrpcbind=YES 8964b413dd0Sjdolecek.Ed 8974b413dd0Sjdolecek.Pp 8984b413dd0SjdolecekEdit 8994b413dd0Sjdolecek.Pa /etc/exports 9008a4655ceSwizand get it correct. 9018a4655ceSwizAfter this, you can start the server by issuing: 9024b413dd0Sjdolecek.Bd -literal -offset indent 9032a63a35fSriastradh.Ic service rpcbind start 9042a63a35fSriastradh.Ic service mountd start 9052a63a35fSriastradh.Ic service nfsd start 9064b413dd0Sjdolecek.Ed 9072c36209bSpeterwhich will also start dependencies. 9084b413dd0Sjdolecek.Ss HP remote boot server 9094b413dd0SjdolecekEdit 9104b413dd0Sjdolecek.Pa /etc/rbootd.conf 9114b413dd0Sjdolecekif needed for remote booting. 9124b413dd0SjdolecekIf you do not have HP computers doing remote booting, do not enable this. 9134b413dd0Sjdolecek.Ss Daily, weekly, monthly scripts 9144b413dd0SjdolecekLook at and possibly edit the 9154b413dd0Sjdolecek.Pa /etc/daily.conf , /etc/weekly.conf , 9164b413dd0Sjdolecekand 9174b413dd0Sjdolecek.Pa /etc/monthly.conf 9188a4655ceSwizconfiguration files. 9198a4655ceSwizYou can check which values you can set by looking 9204b413dd0Sjdolecekto their matching files in 9214b413dd0Sjdolecek.Pa /etc/defaults . 9224b413dd0SjdolecekYour site specific things should go into 9234b413dd0Sjdolecek.Pa /etc/daily.local , /etc/weekly.local , 9244b413dd0Sjdolecekand 9254b413dd0Sjdolecek.Pa /etc/monthly.local . 9264b413dd0Sjdolecek.Pp 9274b413dd0SjdolecekThese scripts have been limited so as to keep the system running without 9284b413dd0Sjdolecekfilling up disk space from normal running processes and database updates. 9294b413dd0Sjdolecek(You probably do not need to understand them.) 9304b413dd0Sjdolecek.Ss Other files in /etc 9314b413dd0SjdolecekLook at the other files in 9324b413dd0Sjdolecek.Pa /etc 9334b413dd0Sjdolecekand edit them as needed. 9344b413dd0Sjdolecek(Do not edit files ending in 9354b413dd0Sjdolecek.Pa .db 9364b413dd0Sjdolecek\(em like 9374b413dd0Sjdolecek.Pa pwd.db , spwd.db , 9384b413dd0Sjdoleceknor 9394b413dd0Sjdolecek.Pa localtime , 9404b413dd0Sjdoleceknor 9414b413dd0Sjdolecek.Pa rmt , 9424b413dd0Sjdoleceknor any directories.) 9434b413dd0Sjdolecek.Ss Crontab (background running processes) 9444b413dd0SjdolecekCheck what is running by typing 9454b413dd0Sjdolecek.Ic crontab -l 9464b413dd0Sjdolecekas root 9474b413dd0Sjdolecekand see if anything unexpected is present. 9484b413dd0SjdolecekDo you need anything else? 9494b413dd0SjdolecekDo you wish to change things? 9504e39658fShubertfFor example, if you do not 9514b413dd0Sjdoleceklike root getting standard output of the daily scripts, and want only 9524b413dd0Sjdolecekthe security scripts that are mailed internally, you can type 9534b413dd0Sjdolecek.Ic crontab -e 9544b413dd0Sjdolecekand change some of the lines to read: 9554b413dd0Sjdolecek.Bd -literal -offset indent 95601869ca4Swiz30 1 * * * /bin/sh /etc/daily 2>&1 > /var/log/daily.out 95701869ca4Swiz30 3 * * 6 /bin/sh /etc/weekly 2>&1 > /var/log/weekly.out 95801869ca4Swiz30 5 1 * * /bin/sh /etc/monthly 2>&1 > /var/log/monthly.out 9594b413dd0Sjdolecek.Ed 9604b413dd0Sjdolecek.Pp 9614b413dd0SjdolecekSee 9624b413dd0Sjdolecek.Xr crontab 5 . 9634b413dd0Sjdolecek.Ss Next day cleanup 9644b413dd0SjdolecekAfter the first night's security run, change ownerships and permissions 9654b413dd0Sjdolecekon files, directories, and devices; root should have received mail 96601869ca4Swizwith subject: "<hostname> daily insecurity output.". 9674b413dd0SjdolecekThis mail contains 9684b413dd0Sjdoleceka set of security recommendations, presented as a list looking like this: 9694b413dd0Sjdolecek.Bd -literal -offset indent 9704b413dd0Sjdolecekvar/mail: 9714b413dd0Sjdolecek permissions (0755, 0775) 9724b413dd0Sjdoleceketc/daily: 9734b413dd0Sjdolecek user (0, 3) 9744b413dd0Sjdolecek.Ed 9754b413dd0Sjdolecek.Pp 9764b413dd0SjdolecekThe best bet is to follow the advice in that list. 9774b413dd0SjdolecekThe recommended setting is the first item in parentheses, while 9784b413dd0Sjdolecekthe current setting is the second one. 9794b413dd0SjdolecekThis list is generated by 9804b413dd0Sjdolecek.Xr mtree 8 9814b413dd0Sjdolecekusing 9824b413dd0Sjdolecek.Pa /etc/mtree/special . 9834b413dd0SjdolecekUse 9844b413dd0Sjdolecek.Xr chmod 1 , 9854b413dd0Sjdolecek.Xr chgrp 1 , 9864b413dd0Sjdolecekand 9874b413dd0Sjdolecek.Xr chown 8 9884b413dd0Sjdolecekas needed. 9891068f92fSnia.Sh SYSTEM TESTING 9901068f92fSniaAt this point, the system should be fully configured to your liking. 9911068f92fSniaIt is now a good time to ensure that the system behaves according to 9921068f92fSniaits specifications and that it is stable on your hardware. 9931068f92fSniaPlease refer to 9941068f92fSnia.Xr tests 7 9951068f92fSniafor details on how to do so. 996857376a3Snia.Pp 9974e39658fShubertfYou can use 9984e39658fShubertf.Xr ps 1 , 9994e39658fShubertf.Xr netstat 1 , 10004e39658fShubertfand 10014e39658fShubertf.Xr fstat 1 10024e39658fShubertfto check on running processes, network connections, and opened files, 1003649791bdSwizrespectively. 1004649791bdSwizOther tools you may find useful are 10054e39658fShubertf.Xr systat 1 10064e39658fShubertfand 10074e39658fShubertf.Xr top 1 . 10084b413dd0Sjdolecek.Sh SEE ALSO 10094b413dd0Sjdolecek.Xr chgrp 1 , 10104b413dd0Sjdolecek.Xr chmod 1 , 1011a9b411c1Speter.Xr config 1 , 10124b413dd0Sjdolecek.Xr crontab 1 , 10134b413dd0Sjdolecek.Xr date 1 , 10144b413dd0Sjdolecek.Xr df 1 , 10154b413dd0Sjdolecek.Xr domainname 1 , 101629aa1b84Ssnj.Xr fstat 1 , 10174b413dd0Sjdolecek.Xr hostname 1 , 10184b413dd0Sjdolecek.Xr make 1 , 10194b413dd0Sjdolecek.Xr man 1 , 10204b413dd0Sjdolecek.Xr netstat 1 , 1021218d0a78Swiz.Xr newaliases 1 , 10224b413dd0Sjdolecek.Xr passwd 1 , 102329aa1b84Ssnj.Xr pkg_add 1 , 102429aa1b84Ssnj.Xr ps 1 , 102529aa1b84Ssnj.Xr ssh 1 , 10264b413dd0Sjdolecek.Xr su 1 , 102729aa1b84Ssnj.Xr systat 1 , 102829aa1b84Ssnj.Xr top 1 , 102929aa1b84Ssnj.Xr xdm 1 , 10304b413dd0Sjdolecek.Xr ccd 4 , 10314b413dd0Sjdolecek.Xr aliases 5 , 10324b413dd0Sjdolecek.Xr crontab 5 , 1033a1249432Sroy.Xr dhcpcd.conf 5 , 10344b413dd0Sjdolecek.Xr exports 5 , 10354b413dd0Sjdolecek.Xr fstab 5 , 10364b413dd0Sjdolecek.Xr group 5 , 10370f6a31aaSriastradh.Xr hosts 5 , 103829aa1b84Ssnj.Xr ifconfig.if 5 , 1039899a0301Sjdolecek.Xr mailer.conf 5 , 10400f6a31aaSriastradh.Xr named.conf 5 , 104129aa1b84Ssnj.Xr nsswitch.conf 5 , 10424b413dd0Sjdolecek.Xr passwd 5 , 104329aa1b84Ssnj.Xr printcap 5 , 10444b413dd0Sjdolecek.Xr rc.conf 5 , 10454b413dd0Sjdolecek.Xr resolv.conf 5 , 104629aa1b84Ssnj.Xr sshd_config 5 , 10473f51937cSwiz.Xr wpa_supplicant.conf 5 , 104829aa1b84Ssnj.Xr wscons.conf 5 , 10498ae40ed4Sjmmv.Xr hier 7 , 10504b413dd0Sjdolecek.Xr hostname 7 , 105181d584faSwiz.Xr pkgsrc 7 , 105210a750e9Sjmmv.Xr tests 7 , 10534b413dd0Sjdolecek.Xr amd 8 , 10544b413dd0Sjdolecek.Xr ccdconfig 8 , 10554b413dd0Sjdolecek.Xr chown 8 , 10562143acc3Snia.Xr devpubd 8 , 1057a1249432Sroy.Xr dhcpcd 8 , 10584b413dd0Sjdolecek.Xr dhcpd 8 , 105929aa1b84Ssnj.Xr dmesg 8 , 106029aa1b84Ssnj.Xr groupadd 8 , 10614b413dd0Sjdolecek.Xr ifconfig 8 , 10624b413dd0Sjdolecek.Xr inetd 8 , 10634b413dd0Sjdolecek.Xr kerberos 8 , 106429aa1b84Ssnj.Xr lpd 8 , 10652143acc3Snia.Xr mdnsd 8 , 10664b413dd0Sjdolecek.Xr mount 8 , 1067218d0a78Swiz.Xr mrouted 8 , 10684b413dd0Sjdolecek.Xr mtree 8 , 10694b413dd0Sjdolecek.Xr named 8 , 10703bb55b2eSwiz.Xr nis 8 , 107129aa1b84Ssnj.Xr ntpd 8 , 107229aa1b84Ssnj.Xr ntpdate 8 , 10734b413dd0Sjdolecek.Xr rbootd 8 , 10744b413dd0Sjdolecek.Xr rc 8 , 107529aa1b84Ssnj.Xr rdate 8 , 10764b413dd0Sjdolecek.Xr rmt 8 , 10774b413dd0Sjdolecek.Xr route 8 , 10781b55e10fSreed.Xr rpc.bootparamd 8 , 107929aa1b84Ssnj.Xr rpcbind 8 , 108029aa1b84Ssnj.Xr sshd 8 , 108129aa1b84Ssnj.Xr timed 8 , 10824b413dd0Sjdolecek.Xr umount 8 , 10839e244eddSreed.Xr useradd 8 , 10844b413dd0Sjdolecek.Xr vipw 8 , 10852143acc3Snia.Xr wpa_cli 8 , 10865011d7a9Smaya.Xr wpa_supplicant 8 , 108729aa1b84Ssnj.Xr yp 8 , 10884b413dd0Sjdolecek.Xr ypbind 8 10894b413dd0Sjdolecek.Sh HISTORY 10904b413dd0SjdolecekThis document first appeared in 10914b413dd0Sjdolecek.Ox 2.2 . 10924b413dd0SjdolecekIt has been adapted to 10934b413dd0Sjdolecek.Nx 10944b413dd0Sjdolecekand first appeared in 10954b413dd0Sjdolecek.Nx 2.0 . 1096