From owner-freebsd-hackers@freebsd.org Mon Mar 16 09:46:44 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E37AA260987 for ; Mon, 16 Mar 2020 09:46:44 +0000 (UTC) (envelope-from ben.rubson@gmx.com) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48grzk3x46z3FN5 for ; Mon, 16 Mar 2020 09:46:42 +0000 (UTC) (envelope-from ben.rubson@gmx.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1584351999; bh=4q56PPlwnrQcgZ9Z9WVsF4WbqTOhAB3U2y7seg3ppJk=; h=X-UI-Sender-Class:From:Subject:Date:References:To:In-Reply-To; b=O3AFUwNovn6oGxDsekCQv+aRfHl7sbzRh9bTKYyVVhz8lznKZ5ou2aa5L5T7EPKxm dBgaWLC1te3dmChrsoB7M/ONaFKjLl8VZxHV/98Zke0h5W919EFH5WQyD6LUKb+n+i Y2Nd1wL5WkqHKpFh/cgHfsiWpkg7hSTNiEA+U3z4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.0.102] ([82.64.198.151]) by mail.gmx.com (mrgmx004 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MWzk3-1ipHPi1iS9-00XH2a for ; Mon, 16 Mar 2020 10:46:39 +0100 From: Ben RUBSON Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: Allow to run SSHd in Installer (12.2 patch) Date: Mon, 16 Mar 2020 10:46:38 +0100 References: <202003121829.02CITGjQ075689@gndrsh.dnsmgr.net> To: freebsd-hackers@freebsd.org In-Reply-To: <202003121829.02CITGjQ075689@gndrsh.dnsmgr.net> Message-Id: X-Mailer: Apple Mail (2.3608.60.0.2.5) X-Provags-ID: V03:K1:Dy4CLDwcK8x0ssitTVRTf8oF+pEuC0H2UbNyvZcCRXmLl7U8EgD 0yEL32uM2XDFKB7Ue+k/qcM0v9UWUcacV7YtAfHvclAKZ2JpbIZJZ5OQz7cczOKHneN1uIx ELEX0ZnhJxr/0/QlLadtbsmnhBx7Ixx2e3nlOnJWceBEFD8CGqbbSSHt366kz1G0EVgVsG4 QVlE0kBumNyJ7P+HHM2NA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:iUvY5Ljauug=:pF/EUReBrhu+4F5oGbxqWm VZGxmeZyFS0GlPRP/BIvC9f+XMgJBckGo21YCGU7S9eC0+maPlFZfhvMaoxsdrMB4DAA5/635 CZRaxRnPz/Oi969XT9cNE/Fyn1nSuQ2TsHr/1tAeJol5GhhrQsJd0+SZlEN3FWUoZvt6ziv85 Px6IKKVVcl2wiHhvOjO0Ylg/lrU1P4oZCS6wBKNJyAC2wONHQmyrJQkSI9okr9CIA4cz8SRod ZFC/ubO0Rp8tBidViR3PgyoG9Lby7KGLh0p6iUoMmUoNGZAXpaP0wUou+HqMAZW92zjwQBMjJ JSmW3UcgWOamQicYqsmo+K2FTCzuq8/TWG/uwPlIZr2voyxqjsDF5i6gbm4GzSq8FjD6T8hCf e8GuDWFh7MHW/+vryv/Tt04f6oSquncOX0qi+dFryXK1C0LQAhELAEotAwnCNPRgBz9hmsc0F 7ksbozSz4dNeJGSVuVos/NsyWc76VxQFlu764yCuxLUww6o98AmO9mVtHhlX7gCeBcje6LKE7 nRK/4h1aJuZ3TSXENAoQG2qwUy2GQ4XrJ1k8GmpR0b88sUp9l4/Be0/IccxF6xqBOSxJGGp3A eTZrgOjULFaS48cneUOFvGDqQivAAEc1Jgb2bXpLL+kMijK9DlMyvGtmdW9jQqf1ip/DOf94J K0dFOoN2/UYfvwIrpHmmsu9oBGZKlqpW+RDSGPLdXeXlpgdwl9m8CtUKJaQx3iIkqXVKaPoFK SibPp6FJlYKZpKLyPuo/0b6IE6HvnzmCPzEWJ+1/f7JVQTxvTcpvmWPSib0rhLoMGgY2Dgy2X XTPpw2oXQ6LtU+f1zEMtrGWPPvhkLMpZVH14sYdUyp8Sana/ZVVFa/HKs9tSmTH5m78+UtBsy sOOL0h2pPxreWOXN8kjnrQjgNLtYbqrVtwbi7E9Jh+AOnoYs6Up62iTJlnvnGyXDTHjr2DtfH 1Z9RfY6pybVSvVliTeZA26l8ctv5B0t6mpCK6XJ3fdaV/demfogc56Ru14oWoibgsYLUI8uN2 2Es3te4txoLdUjJJ5gEldJxJBBQBCCNHG/jz9LlJZ8iTens4T2+caTn9a5l9QjjjDXaGIHQiF nQr0iE/yV9Rln8mKM4VdjNI63XXvavrYyH4RCJa3/+K4FSxqPpBh3SKCtDfjYDMeOTQwPRDRc F4pKI9s7GE3IIUqKnBZsMAOEyXaIQOwIvCCT3DFopAqZoRrxGL+Kmg0PwyEm+ent3maA6Owh6 hRHoMYG85vvBT01DP X-Rspamd-Queue-Id: 48grzk3x46z3FN5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.b=O3AFUwNo; dmarc=none; spf=pass (mx1.freebsd.org: domain of ben.rubson@gmx.com designates 212.227.15.15 as permitted sender) smtp.mailfrom=ben.rubson@gmx.com X-Spamd-Result: default: False [-2.01 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:212.227.15.0/24:c]; FREEMAIL_FROM(0.00)[gmx.com]; TO_DN_NONE(0.00)[]; MV_CASE(0.50)[]; DKIM_TRACE(0.00)[gmx.net:+]; RECEIVED_SPAMHAUS_PBL(0.00)[151.198.64.82.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; RCVD_IN_DNSWL_LOW(-0.10)[15.15.227.212.list.dnswl.org : 127.0.3.1]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmx.com]; R_DKIM_ALLOW(-0.20)[gmx.net:s=badeba3b8450]; NEURAL_HAM_MEDIUM(-0.91)[-0.912,0]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[gmx.com]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(0.00)[ip: (-6.91), ipnet: 212.227.0.0/16(-1.13), asn: 8560(2.18), country: DE(-0.02)]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Mar 2020 09:46:45 -0000 Thank you Ruben & Rodney for your interest into this. Of course your solution works Rodney but is not really convenient trough = a remote console. What my patch tends to fix :) Fingers crossed ! Ben > On 12 Mar 2020, at 19:29, Rodney W. Grimes = wrote: >=20 > I have been starting sshd from install media since 5.4 or so, > here is my current method that should work on 11, 12 and 13: >=20 > # This version for FreeBSD 11.0R, works for 12.0 too >=20 > mkdir /tmp/ssh > cp -p /etc/ssh/sshd_config /tmp/ssh > echo 'PermitRootLogin yes' >> /tmp/ssh/sshd_config > echo 'AllowGroups wheel' >> /tmp/ssh/sshd_config > echo 'PermitEmptyPasswords yes' >> /tmp/ssh/sshd_config > echo 'HostKey /tmp/ssh/ssh_host_rsa_key' >> /tmp/ssh/sshd_config > echo 'HostKey /tmp/ssh/ssh_host_dsa_key' >> /tmp/ssh/sshd_config > echo 'UsePAM no' >> /tmp/ssh/sshd_config > echo 'PasswordAuthentication yes' >> /tmp/ssh/sshd_config >=20 > ssh-keygen -t rsa -f /tmp/ssh/ssh_host_rsa_key -N '' > ssh-keygen -t dsa -f /tmp/ssh/ssh_host_dsa_key -N '' >=20 > /usr/sbin/sshd -f /tmp/ssh/sshd_config >=20 > For those that "need" this feature today :-) Just drop to > a shell after booting from install media, run the above > commands, and you can get in. BEWARE, passwordless root login = enabled! >=20 >> Hi Ben, >>=20 >> I'm not a FreeBSD developer (so not your targeted audience) but would=20= >> very much like to see this land in a release! >>=20 >> Kind regards, >>=20 >> Ruben >>=20 >> On 3/10/20 4:07 PM, Ben RUBSON wrote: >>=20 >>>> On 2 Mar 2020, at 13:09, Ben RUBSON wrote: >>>>=20 >>>> Hi, >>>>=20 >>>> I've done some work to allow to connect to FreeBSD installer = through SSH. >>>> It can be useful for example if we have specific tasks to perform = before installation, such as disks configuration etc... >>>> Working through a SSH connection is much more convenient than in = front of a console. >>>> FreeBSD installer can then also be used as a rescue disk. >>>>=20 >>>> To achieve this, I've modified FreeBSD installer, so that after = having installed SSHd, if performs following configuration modifications = : >>>> - generate host keys into /var/ssh (as default /etc/ssh is not = writable) ; >>>> - only allow keys authentication ; >>>> - allow root authentication ; >>>> - read authorized_keys file from /var/ssh (as default homedirs are = not writable). >>>>=20 >>>> SSHd can then be started thanks to the installer shell : service = sshd start >>>> And a public key put into for example = /var/ssh-keys/root/authorized_keys, thanks to fetch or whatever. >>>>=20 >>>> Work is here : >>>> https://github.com/freebsd/freebsd/pull/156 >>>> Rather simple, and ready to be merged. >>>>=20 >>>> This job is more than 2 years old, I would then really be glad if = we could see this in 12.2 installation ISOs. >>>> It would prevent me from having to modify the new ISO files to = implement this patch. >>>=20 >>> Any thoughts ? :) >>>=20 >>> Thank you very much ! >>>=20 >>> Ben