1.\" $NetBSD: creds_msdos.8,v 1.6 2024/05/13 23:10:47 gutteridge Exp $ 2.\" 3.\" Copyright (c) 2019 Matthew R. Green 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 22.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25.\" SUCH DAMAGE. 26.\" 27.Dd June 10, 2019 28.Dt CREDS_MSDOS 8 29.Os 30.Sh NAME 31.Nm creds_msdos 32.Nd automatically add login credentials from MS-DOS partition 33.Sh SYNOPSIS 34.Nm 35.Ar start 36.Sh DESCRIPTION 37The 38.Nm 39rc.d script allows automatic addition of login credentials during boot 40using a special file found on the MS-DOS partition of a bootable image. 41This script is not distributed with the normal system and is only 42included with pre-installed bootable images. 43The goal is to allow remote access of the system without having to 44edit the primary root file system (which may not be accessible from 45the host the image is being written from), but place this information 46in the MS-DOS partition that most platforms can easily access. 47.Pp 48Typically, an installable image (such as 49.Pa arm64.img ) 50is written to an SD card or similar media, and has both a native FFS 51partition as well as an MS-DOS partition for booting. 52If this script is enabled and has been pointed at the boot partition 53it will inspect the file 54.Pa creds.txt 55for any credentials to be added to the system. 56.Pp 57The following list gives the supported options in the credentials files. 58In all cases 59.Ar user 60is the username to be created, and the user will be added to the 61.Ql wheel 62group. 63.Bl -tag -width Ic 64.\" 65.It Ic sshkeyfile Ar user Ar keyfile 66Look for the 67.Ar keyfile 68in the MS-DOS boot partition and merge ssh keys from this file into user's 69.Pa ~/.ssh/authorized_keys 70file. 71.\" 72.It Ic sshkey Ar user Ar keystring 73Add the 74.Ar keystring 75to the user's 76.Pa ~/.ssh/authorized_keys 77file. 78.\" 79.It Ic useraddpwhash Ar user Ar pwhash 80Use 81.Ar pwhash 82as the users's password hash. 83.\" 84.It Ic useradd Ar user Ar password 85Use 86.Ar password 87as the users's unencrypted raw password that will be hashed. 88.Pp 89This method is 90.Em not recommended 91as it leaves unencrypted passwords around until such time that the script runs. 92If this method is used then the 93.Pa creds.txt 94file will be shredded and deleted using 95.Ql rm -P 96after the credentials are updated. 97.El 98.Sh FILES 99.Pa /boot/creds.txt 100.Sh SEE ALSO 101.Xr pwhash 1 , 102.Xr rm 1 , 103.Xr ssh 1 , 104.Xr ssh_config 5 , 105.Xr mount_msdos 8 , 106.Xr sshd 8 , 107.Xr useradd 8 108.Sh HISTORY 109The 110.Nm 111script appeared in 112.Nx 9.0 . 113.Sh AUTHORS 114.An Matthew R. Green Aq Mt mrg@eterna23.net . 115