summaryrefslogtreecommitdiff
path: root/share/man/man8/afterboot.8
blob: b257d3c4aee26c2935dc2a5ca267a9a4ba838b39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
.Dd October 20, 1997
.Dt AFTERBOOT 8
\!\" Originally created by Marshall M. Midden -- 1997-10-20, m4@umn.edu
.Os OpenBSD
.Sh NAME
.Nm afterboot
.Nd things to check after the first complete boot
.Sh DESCRIPTION
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.
.Pp
Complete instructions for correcting and fixing items is not provided.
There are man pages and other methodologies available for doing that.
\!\"--------------------------------------------------------------------------
.Ss Login
Login on console as
.Ql Xr root .
There is no password initially.
You will not be able to login over the network, only the console.
\!\"--------------------------------------------------------------------------
.Ss System Date
Check the system date with the
.Nm date
command.
If needed, set the system date, and/or change the symbolic link of
.Pa /etc/localtime
to the correct time zone in the
.Pa /usr/share/zoneinfo
directory.
\!\"--------------------------------------------------------------------------
.Ss Root password
Set the password for the root login.
Choose a password that has numbers, digits, and special characters (not space)
as well as the upper and lower case alphabet.  Do not choose any word in any
language.  It is common for an intruder to use dictionary attacks.
Use the
.Nm /usr/bin/passwd
command to change it.  It is a good idea to always specify the full path
name for both the
.Nm passwd
and the
.Nm su
commands.  This inhibits the possibility of files placed in your execution
.Ev PATH
for most shells.
\!\"--------------------------------------------------------------------------
.Ss Check hostname
Type the
.Nm hostname
command to verify that the name of your machine is correct.
See the man page for
.Nm hostname
if you need to change it.
You will also need to edit the
.Pa /etc/myname
file to have it stick around for the next reboot.
\!\"--------------------------------------------------------------------------
.Ss Verify network interfaces configured correctly
The first thing to do is an
.Nm ifconfig -a
to see if the network interfaces are properly configured.
Correct by editing
.Pa /etc/hostname.{INTERFACE}
and via
.Nm ifconfig
if you do not wish to reboot.
The loopback interface will look something like:
.Bd -literal -offset indent
lo0: flags=8009<UP,LOOPBACK,MULTICAST>
	inet 127.0.0.1 netmask 0xff000000
.Ed
.Pp
An ethernet interface something like:
.Bd -literal -offset indent
le0: flags=9863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST>
	inet 192.168.4.52 netmask 0xffffff00 broadcast 192.168.4.255
.Ed
\!\"--------------------------------------------------------------------------
\!\" Will someone else fill in the ppp and slip interfaces.
\!\"--------------------------------------------------------------------------
.Pp
You may wish to turn off multicast routing in
.Pa /etc/netstart
by commenting out the line (placing a # sign at the start of a line):
.Bd -literal -offset indent
# route add -net 224.0.0.0 -interface $hostname
.Ed
.Pp
\!\"--------------------------------------------------------------------------
.Ss Check for routing correct
Do a
.Nm netstat -r -n
command.  The output will look something like:
.Bd -literal -offset indent
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
.Ed
.Pp
Fix by editing the file
.Pa /etc/mygate
and using
.Nm route delete
and
.Nm route add
if you do not wish to reboot.
.Pp
If you wish to route packets between interfaces you do that by putting
.Bd -literal -offset indent
# sysctl -w net.inet.ip.forwarding=1
.Ed
.Pp
early on in the boot process (ie. start of
.Pa /etc/netstart ,
or by compiling a new kernel with the option GATEWAY.
Packets are not forwarded by default, due to RFC requirements.
.Pp
You can add new "virtual interfaces" by adding the required entries to
.Pa /etc/ifaliases .
\!\"--------------------------------------------------------------------------
.Ss Bind Name Server
If you are using the Bind Name Server (DNS), check the
.Pa /etc/resolv.conf
file.  It may look something like:
.Bd -literal -offset indent
domain nts.umn.edu
nameserver 128.101.101.101
nameserver 134.84.84.84
search nts.umn.edu. umn.edu.
lookup file bind
.Ed
.Pp
If using a caching name server add the line "nameserver 127.0.0.1" first.
(Of course, you need to change "named_flags" in
.Pa /etc/rc.conf
and add the
.Pa named.boot
file in the appropriate place.  The same holds true if this is the
name server for your domain.  In addition, make sure that
.Nm named
is running.
[Otherwise there are long waits while timeouts happen.])
\!\"--------------------------------------------------------------------------
.Ss YP verification
Check the domainname with the
.Nm domainname
command, and edit
.Pa /etc/defaultdomain
to correct.  You may change the running system with the
.Nm domainname
command.
To start YP client services, simply run
.Nm ypbind .
Then perform the remaining
YP activation as described in
.Xr passwd 5 ,
and
.Xr group 5 .
There are many more YP man pages on the system.  You can find more information
by starting at
.Xr yp 8 .
.Ss Check disks are mounted correctly.
Check that the disks are mounted correctly by
checking file
.Pa /etc/fstab
against the output of the
.Nm mount
and the
.Nm df
commands.
Example:
.Bd -literal -offset indent
# cat /etc/fstab
/dev/sd0a / ffs rw 1 1
/dev/sd0b none swap sw 0 0
/dev/sd0d /usr ffs rw,nodev 1 2
/dev/sd0e /var ffs rw,nodev,noexec 1 2
/dev/sd0g /tmp ffs rw,nodev,noexec,nosuid 1 2
/dev/sd0h /home ffs rw,nodev,nosuid 1 2
# mount
/dev/sd0a on / type ffs (local)
/dev/sd0d on /usr type ffs (local, nodev)
/dev/sd0e on /var type ffs (local, nodev, noexec)
/dev/sd0g on /tmp type ffs (local, nodev, noexec, nosuid)
/dev/sd0h on /home type ffs (local, nodev, nosuid)
# df
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
.Ed
.Pp
Edit
.Pa /etc/fstab
and use the
.Nm umount
and
.Nm mount
commands as appropriate.  (See man pages.)
.Pp
You may wish to do NFS partitions later, but you may do them now.
\!\"--------------------------------------------------------------------------
.Ss Concatenated disks (ccd)
If you are using concatenated disks, edit
.Pa /etc/ccd.conf
and use the
.Nm ccdconfig -U
command to unload, and the
.Nm ccdconfig -C
command to create tables internal to the kernel for the concatenated disks.
You then
.Nm mount
and
.Nm umount
and edit
.Pa /etc/fstab
as needed.
\!\"--------------------------------------------------------------------------
.Ss AMD
Go into the
.Pa /etc/amd
directory if using this package and set it up by
renaming
.Pa amd.home.sample
to
.Pa amd.home .
You may wish to create a file
.Pa amd.home
in this directory, or alternatively supply your amd.home map via YP.
\!\"--------------------------------------------------------------------------
.Sh COMPILING A KERNEL
To compile your own kernel off a CDROM do the following:
.Bd -literal -offset indent
# cd /somewhere
# cp /usr/src/sys/arch/$ARCH/conf/SOMEFILE .
# edit SOMEFILE (to make any changes you want)
# config -s /usr/src/sys -b . SOMEFILE
# make
.Ed
.Pp
To compile a kernel inside a writable source tree, do the following:
.Bd -literal -offset indent
# cd /sys/arch/$ARCH/conf
# edit SOMEFILE (to make any changes you want)
# config SOMEFILE
# cd ../compile/SOMEFILE
# make
.Ed
.Pp
$ARCH should be the architecture (e.g. i386).  You can do a
.Nm make depend
so that you will have dependencies there the next time you do a compile.
.Pp
After either of these two steps, you can place the new kernel (called
.Pa bsd )
in
.Pa /
(i.e. /bsd) and the system will boot it next time.
Most people save their backup kernels as
.Pa /bsd.1 ,
.Pa /bsd.2 ...
\!\"--------------------------------------------------------------------------
.Sh CHANGING /ETC FILES
The system should be usable now, but you may wish to do more customizing,
such as adding of users, etc.  Many of the following sections may be skipped
if you are not using that package (for example
.Pa kerberos
section).  My suggestions are to
.Nm cd /etc
and edit most files.
\!\"--------------------------------------------------------------------------
.Ss /etc/motd
Edit motd to make lawyers comfortable and make sure that no mention
of the word "Welcome" appears.  (Some U.S. lawyers have stated that
the word "Welcome" is an invitation to come on in.)
\!\"--------------------------------------------------------------------------
.Ss Add new users
Add users.  There is a
.Nm adduser
script.
You may use
.Nm vipw
to add users to the
.Pa /etc/passwd
file
and edit
.Pa /etc/group
by hand if you desire.
.Xr su 8 ,
tells you to make sure to put people in
.Pa /etc/group
under the
.Pa wheel
group if they need root access (non-kerberos).  Something like:
.Bd -literal -offset indent
wheel:*:0:root,myself
.Ed
.Pp
Follow instructions for
.Pa kerberos
if using
.Pa kerberos
for authentication.
\!\"--------------------------------------------------------------------------
.Ss rc.conf, netstart, rc.local, rc.securelevel
Check for any local changes needed in the files:
.Pa /etc/rc.conf, /etc/netstart, /etc/rc.local, rc.securelevel.
Turning on something like the Network Time Protocol in
.Pa /etc/rc.securelevel
requires:
a) making sure the package is installed,
b) uncommenting the lines in
.Pa rc.securelevel
(delete the # signs):
.Bd -literal -offset indent
if [ -x /usr/local/sbin/xntpd ]; then
     /usr/local/sbin/tickadj -Aq
     echo -n ' xntpd';       /usr/local/sbin/xntpd
fi
.Ed
\!\"--------------------------------------------------------------------------
.Ss Printers
Edit /etc/printcap and /etc/hosts.lpd to get any printers set up.
\!\"--------------------------------------------------------------------------
.Ss Tighten up security
You might wish to tighten up security more by editing
.Pa /etc/fbtab
as when installing X.
In
.Pa /etc/inetd.conf
turn off extra stuff that you do not need,
and only add things that are really needed.
\!\"--------------------------------------------------------------------------
.Ss Kerberos
If you are going to use
.Pa kerberos
for authentication, and you already have a
.Pa kerberos
master, go into the directory
.Pa /etc/kerberosIV
and configure
.Pa kerberos.
Remember to get a
.Pa srvtab
from the master so that the remote commands work.
\!\"--------------------------------------------------------------------------
.Ss Mail Aliases
Edit
.Pa /etc/aliases
and set the four standard aliases to go to either a mailing list, or
the system administrator.
.Bd -literal -offset indent
# Well-known aliases -- these should be filled in!
root:		sysadm
manager:	sysadm
dumper:		sysadm
operator:	sysadm
.Ed
.Pp
Run
.Nm newaliases
after changes.
\!\"--------------------------------------------------------------------------
.Ss Bootp server
If this is a
.Pa bootp
server, edit
.Pa /etc/bootptab
as needed.  You will have to turn it on in
.Pa /etc/inetd.conf
or run
.Nm bootpd
in stand-a-lone mode.
\!\"--------------------------------------------------------------------------
.Ss NFS server
If this is an NFS server
make sure
.Pa /etc/rc.conf
has:
.Bd -literal -offset indent
nfs_server=YES
.Ed
.Pp
Edit
.Pa /etc/exports
and get it correct.
It is probably easier to reboot than get the daemons running, manually,
but you can get the order correct by looking at
.Pa /etc/netstart.
\!\"--------------------------------------------------------------------------
.Ss HP remote boot server
Edit
.Pa /etc/rbootd.config
if needed for remote booting.
If you do not have HP computers doing remote booting, do not enable this.
\!\"--------------------------------------------------------------------------
.Ss Daily, Weekly, Monthly scripts
Look at and possibly edit the
.Pa /etc/daily, /etc/weekly,
and
.Pa /etc/monthly
scripts.  Your site specific things should go into
.Pa /etc/daily.local, /etc/weekly.local,
and
.Pa /etc/monthly.local.
.Pp
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.)
\!\"--------------------------------------------------------------------------
.Ss Other files in /etc
Look at the other files in
.Pa /etc
and edit as needed.
(Do not edit files ending in
.Pa .db
-- like
.Pa aliases.db, pwd.db, spwd.db,
nor
.Pa localtime,
nor
.Pa rmt,
nor any directories.)
\!\"--------------------------------------------------------------------------
.Ss Crontab (background running processes)
Check what is running via
.Nm crontab -l
to see if anything unexpected is present.
Do you need anything else?  Do you wish to change things?  I do not
like root getting standard output of the daily scripts, only the security
scripts that are mailed internally:
.Bd -literal -offset indent
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
.Ed
\!\"--------------------------------------------------------------------------
.Ss Next day cleanup
After the first nights security run, change ownerships and permissions
on things.  The best bet is to have permissions as in the security list.
(The first of the two listed permissions, and the first group number of
the two).
Use
.Nm chmod ,
.Nm chgrp ,
and
.Nm chown
as needed.
\!\"--------------------------------------------------------------------------
.Ss Install packages
Install your own packages.
The simple way is to copy source and compile and link/load.
.Pp
Copy vendor binaries and install them.  You will need to install any
shared libraries, etc.
(Hint:
.Nm man -k compat
to find out how to install and use compatibility mode.)
.Pp
Install any of a large group of Third-Party Software that is available
in source form.  See
.Pa http://www.openbsd.org
under
.Pa Ports: a Nice Way to Get Third-Party Software.
.Pp
You may have some difficulty installing due to various compiling errors.
Don't get discouraged easily!  Sometimes checking the mailing lists for
past problems that people have encountered will result in a fix posted.
One recent item says to delete
.Pa -lcrypt
from
.Pa Makefiles
as the routines are present in the normal libraries.
.Sh SEE ALSO
.Xr adduser 8 ,
.Xr aliases 5 ,
.Xr amd 8 ,
.Xr bootpd 8 ,
.Xr bootptab 5 ,
.Xr ccd 4 ,
.Xr ccdconfig 8 ,
.Xr chgrp 1 ,
.Xr chmod 1 ,
.Xr chown 8 ,
.Xr config 8 ,
.Xr crontab 1 ,
.Xr crontab 5 ,
.Xr date 1 ,
.Xr df 1 ,
.Xr domainname 8 ,
.Xr exports 5 ,
.Xr ext_srvtab 8 ,
.Xr fbtab 5 ,
.Xr fstab 5 ,
.Xr group 5 ,
.Xr hostname 1 ,
.Xr hostname 7 ,
.Xr ifconfig 8 ,
.Xr inetd 8 ,
.Xr kerberos 1 ,
.Xr krb.conf 5 ,
.Xr krb.realms 5 ,
.Xr make 1 ,
.Xr man 1 ,
.Xr mount 8 ,
.Xr named 8 ,
.Xr netstat 1 ,
.Xr newaliases 1 ,
.Xr passwd 1 ,
.Xr passwd 5 ,
.Xr rbootd 5 ,
.Xr rc 8 ,
.Xr resolv.conf 5 ,
.Xr rmt 8 ,
.Xr route 8 ,
.Xr su 1 ,
.Xr umount 8 ,
.Xr vipw 8 ,
.Xr ypbind 8 .
.Sh HISTORY
This document first appeared
.Ox 2.2 .