xref: /freebsd/stand/forth/check-password.4th.8 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1*5cc9fabeSDevin Teske.\" Copyright (c) 2011-2018 Devin Teske
2ca987d46SWarner Losh.\" All rights reserved.
3ca987d46SWarner Losh.\"
4ca987d46SWarner Losh.\" Redistribution and use in source and binary forms, with or without
5ca987d46SWarner Losh.\" modification, are permitted provided that the following conditions
6ca987d46SWarner Losh.\" are met:
7ca987d46SWarner Losh.\" 1. Redistributions of source code must retain the above copyright
8ca987d46SWarner Losh.\"    notice, this list of conditions and the following disclaimer.
9ca987d46SWarner Losh.\" 2. Redistributions in binary form must reproduce the above copyright
10ca987d46SWarner Losh.\"    notice, this list of conditions and the following disclaimer in the
11ca987d46SWarner Losh.\"    documentation and/or other materials provided with the distribution.
12ca987d46SWarner Losh.\"
13ca987d46SWarner Losh.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14ca987d46SWarner Losh.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15ca987d46SWarner Losh.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16ca987d46SWarner Losh.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17ca987d46SWarner Losh.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18ca987d46SWarner Losh.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19ca987d46SWarner Losh.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20ca987d46SWarner Losh.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21ca987d46SWarner Losh.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22ca987d46SWarner Losh.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23ca987d46SWarner Losh.\" SUCH DAMAGE.
24ca987d46SWarner Losh.\"
25*5cc9fabeSDevin Teske.Dd June 24, 2018
26ca987d46SWarner Losh.Dt CHECK-PASSWORD.4TH 8
27ca987d46SWarner Losh.Os
28ca987d46SWarner Losh.Sh NAME
29ca987d46SWarner Losh.Nm check-password.4th
30ca987d46SWarner Losh.Nd FreeBSD password-checking boot module
31ca987d46SWarner Losh.Sh DESCRIPTION
32ca987d46SWarner LoshThe file that goes by the name of
33ca987d46SWarner Losh.Nm
34ca987d46SWarner Loshis a set of commands designed to do one or more of the following:
35ca987d46SWarner Losh.Pp
36ca987d46SWarner Losh.Dl o Prevent booting without password
37ca987d46SWarner Losh.Dl o Prevent modification of boot options without password
38ca987d46SWarner Losh.Dl o Provide a password to mount geli(8) encrypted root disk(s)
39ca987d46SWarner Losh.Pp
40ca987d46SWarner LoshThe commands of
41ca987d46SWarner Losh.Nm
42ca987d46SWarner Loshby themselves are not enough for most uses.
43ca987d46SWarner LoshPlease refer to the
44ca987d46SWarner Loshexamples below for the most common situations, and to
45ca987d46SWarner Losh.Xr loader 8
46ca987d46SWarner Loshfor additional commands.
47ca987d46SWarner Losh.Pp
48ca987d46SWarner LoshBefore using any of the commands provided in
49ca987d46SWarner Losh.Nm ,
50ca987d46SWarner Loshit must be included
51ca987d46SWarner Loshthrough the command:
52ca987d46SWarner Losh.Pp
53ca987d46SWarner Losh.Dl include check-password.4th
54ca987d46SWarner Losh.Pp
55ca987d46SWarner LoshThis line is present in
56ca987d46SWarner Losh.Pa /boot/loader.4th
57ca987d46SWarner Loshfile, so it is not needed (and should not be re-issued) in a normal setup.
58ca987d46SWarner Losh.Pp
59ca987d46SWarner LoshThe commands provided by it are:
60ca987d46SWarner Losh.Pp
61ca987d46SWarner Losh.Bl -tag -width disable-module_module -compact -offset indent
62ca987d46SWarner Losh.It Ic check-password
63ca987d46SWarner LoshMulti-purpose function that can protect the interactive boot menu,
64ca987d46SWarner Loshprevent boot without password, or prompt for geli(8) passphrase
65ca987d46SWarner Losh.Pq depending on Xr loader.conf 5 settings .
66ca987d46SWarner Losh.Pp
67ca987d46SWarner LoshFirst checks
68ca987d46SWarner Losh.Va bootlock_password
69ca987d46SWarner Loshand if-set, the user cannot continue until the correct password is entered.
70ca987d46SWarner Losh.Pp
71ca987d46SWarner LoshNext, checks
72ca987d46SWarner Losh.Va geom_eli_passphrase_prompt
73ca987d46SWarner Loshand if set to
74ca987d46SWarner Losh.Li YES
75ca987d46SWarner Losh.Pq case-insensitive
76ca987d46SWarner Loshprompts the user to enter their GELI password for later mounting of the root
77ca987d46SWarner Loshdevice(s) during boot.
78ca987d46SWarner Losh.Pp
79ca987d46SWarner LoshLast, checks
80ca987d46SWarner Losh.Va password
81ca987d46SWarner Loshand if-set, tries to
82ca987d46SWarner Losh.Ic autoboot
83ca987d46SWarner Loshand only prompts for password on failure or user-interrupt.
84ca987d46SWarner LoshSee
85ca987d46SWarner Losh.Xr loader.conf 5
86ca987d46SWarner Loshfor additional information.
87ca987d46SWarner Losh.El
88ca987d46SWarner Losh.Pp
89ca987d46SWarner LoshThe environment variables that effect its behavior are:
90ca987d46SWarner Losh.Bl -tag -width bootlock_password -offset indent
91ca987d46SWarner Losh.It Va bootlock_password
92*5cc9fabeSDevin TeskeSets the bootlock password (up to 255 characters long) that is required by
93ca987d46SWarner Losh.Ic check-password
94ca987d46SWarner Loshto be entered before the system is allowed to boot.
95ca987d46SWarner Losh.It Va geom_eli_passphrase_prompt
96ca987d46SWarner LoshSelects whether loader(8) will prompt for GELI credentials, handing-off to the
97ca987d46SWarner Loshkernel for later mounting of
98ca987d46SWarner Losh.Xr geli 8
99ca987d46SWarner Loshencrypted root device(s).
100ca987d46SWarner Losh.It Va password
101*5cc9fabeSDevin TeskeSets the password (up to 255 characters long) that is required by
102ca987d46SWarner Losh.Ic check-password
103ca987d46SWarner Loshbefore the user is allowed to visit the boot menu.
104ca987d46SWarner Losh.El
105ca987d46SWarner Losh.Sh FILES
106ca987d46SWarner Losh.Bl -tag -width /boot/check-password.4th -compact
107ca987d46SWarner Losh.It Pa /boot/loader
108ca987d46SWarner LoshThe
109ca987d46SWarner Losh.Xr loader 8 .
110ca987d46SWarner Losh.It Pa /boot/check-password.4th
111ca987d46SWarner Losh.Nm
112ca987d46SWarner Loshitself.
113ca987d46SWarner Losh.It Pa /boot/loader.rc
114ca987d46SWarner Losh.Xr loader 8
115ca987d46SWarner Loshbootstrapping script.
116ca987d46SWarner Losh.El
117ca987d46SWarner Losh.Sh EXAMPLES
118ca987d46SWarner LoshStandard i386
119ca987d46SWarner Losh.Pa /boot/loader.rc :
120ca987d46SWarner Losh.Pp
121ca987d46SWarner Losh.Bd -literal -offset indent -compact
122ca987d46SWarner Loshinclude /boot/loader.4th
123ca987d46SWarner Loshcheck-password
124ca987d46SWarner Losh.Ed
125ca987d46SWarner Losh.Pp
126ca987d46SWarner LoshSet a password in
127ca987d46SWarner Losh.Xr loader.conf 5
128ca987d46SWarner Loshto prevent modification of boot options:
129ca987d46SWarner Losh.Pp
130ca987d46SWarner Losh.Bd -literal -offset indent -compact
131ca987d46SWarner Loshpassword="abc123"
132ca987d46SWarner Losh.Ed
133ca987d46SWarner Losh.Pp
134ca987d46SWarner LoshSet a password in
135ca987d46SWarner Losh.Xr loader.conf 5
136ca987d46SWarner Loshto prevent booting without password:
137ca987d46SWarner Losh.Pp
138ca987d46SWarner Losh.Bd -literal -offset indent -compact
139ca987d46SWarner Loshbootlock_password="boot"
140ca987d46SWarner Losh.Ed
141ca987d46SWarner Losh.Pp
142ca987d46SWarner LoshAdd the following to
143ca987d46SWarner Losh.Xr loader.conf 5
144ca987d46SWarner Loshto generate a prompt at boot to collect GELI credentials for mounting
145ca987d46SWarner Losh.Xr geli 8
146ca987d46SWarner Loshencrypted root device(s):
147ca987d46SWarner Losh.Pp
148ca987d46SWarner Losh.Bd -literal -offset indent -compact
149ca987d46SWarner Loshgeom_eli_passphrase_prompt="YES"
150ca987d46SWarner Losh.Ed
151ca987d46SWarner Losh.Sh SEE ALSO
152ca987d46SWarner Losh.Xr loader.conf 5 ,
153ca987d46SWarner Losh.Xr loader 8 ,
154ca987d46SWarner Losh.Xr loader.4th 8
155ca987d46SWarner Losh.Sh HISTORY
156ca987d46SWarner LoshThe
157ca987d46SWarner Losh.Nm
158ca987d46SWarner Loshset of commands first appeared in
159ca987d46SWarner Losh.Fx 9.0 .
160ca987d46SWarner Losh.Sh AUTHORS
161ca987d46SWarner LoshThe
162ca987d46SWarner Losh.Nm
163ca987d46SWarner Loshset of commands was written by
164ca987d46SWarner Losh.An -nosplit
165ca987d46SWarner Losh.An Devin Teske Aq dteske@FreeBSD.org .
166