src/sbin/vnconfig/vnconfig.8

177 lines
5.4 KiB
Groff

.\" $OpenBSD: vnconfig.8,v 1.7 2022/08/16 13:59:51 kn Exp $
.\"
.\" Copyright (c) 1993 University of Utah.
.\" Copyright (c) 1980, 1989, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" the Systems Programming Group of the University of Utah Computer
.\" Science Department.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)vnconfig.8 8.1 (Berkeley) 6/5/93
.\"
.\"
.\" Copyright (c) 2007 Alexander von Gernler <grunk@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: August 16 2022 $
.Dt VNCONFIG 8
.Os
.Sh NAME
.Nm vnconfig
.Nd configure vnode disks
.Sh SYNOPSIS
.Nm vnconfig
.Op Fl v
.Oo
.Fl k | K Ar rounds
.Op Fl S Ar saltfile
.Oc
.Op Fl t Ar disktype
.Op Ar vnd_dev
.Ar image
.Nm vnconfig
.Fl l
.Op Ar vnd_dev
.Nm vnconfig
.Fl u
.Op Fl v
.Ar vnd_dev
.Sh DESCRIPTION
The
.Nm vnconfig
command configures vnode pseudo disk devices.
It will associate (or disassociate) the special file
.Ar vnd_dev
with the regular file
.Ar image ,
allowing the latter to be accessed as though it were a disk.
If
.Ar vnd_dev
is not specified, an unused one will be allocated and the name printed
to
.Va stdout .
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl K Ar rounds
Associate an encryption key with the device.
All data will be encrypted using the Blowfish cipher before it is
written to the disk.
The user is asked for both a passphrase and the name of a salt file.
The salt file can also be specified on the command line using the
.Fl S
option.
The passphrase and salt are combined according to PKCS #5 PBKDF2 for the
specified number of
rounds to generate the actual key used.
.Ar rounds
is a number between 1000 and
.Dv INT_MAX .
DO NOT LOSE THE SALT FILE.
.It Fl k
Associate an encryption key with the device.
The user is asked for the encryption key.
All data will be encrypted using the Blowfish cipher before it is
written to the disk.
.It Fl l
List the vnd devices and indicate which ones are in use.
If a specific
.Ar vnd_dev
is given, then only that one will be described.
.It Fl S Ar saltfile
When
.Fl K
is used, specify the
.Pa saltfile .
.It Fl t Ar disktype
Specify a
.Ar disktype
entry from the
.Xr disktab 5
database.
The
.Ar vnd_dev
will have the sector size, sectors per track, and tracks per cylinder values
of the specified
.Ar disktype .
The defaults are 512-byte sectors, 100 sectors per track and 1 track per
cylinder.
.It Fl u
Unconfigure a
.Ar vnd_dev .
.It Fl v
Print messages to stderr describing actions taken.
.El
.Sh FILES
.Bl -tag -width /etc/rvnd?? -compact
.It Pa /dev/{,r}vnd*
.El
.Sh EXAMPLES
Configure a CD-ROM or DVD image file as vnode disk vnd0
and mount the ISO 9660 file system contained in it:
.Bd -literal -offset indent
# vnconfig vnd0 /tmp/diskimage
# mount -t cd9660 /dev/vnd0c /mnt
.Ed
.Pp
Configure an encrypted image file as vnode disk vnd0 and mount the FFS
file system contained in the
.Sq a
partition of the disklabel.
Same as above, but now configure the vnode using PKCS #5 PBKDF2 and
a salt file with 20000 rounds:
.Bd -literal -offset indent
# vnconfig -K 20000 vnd0 /tmp/cryptimg
Encryption key:
Salt file: /tmp/cryptsalt
# mount /dev/vnd0a /mnt
.Ed
.Sh SEE ALSO
.Xr vnd 4 ,
.Xr disktab 5 ,
.Xr fstab 5 ,
.Xr mount 8 ,
.Xr swapon 8 ,
.Xr umount 8
.Sh HISTORY
The
.Nm
command first appeared in
.Ox 4.2 .