Skip to content

Commit c46994e

Browse files
JkktBkktahesford
andcommitted
docs: dracut-crypt-ssh keys name and format fix
Co-authored-by: Andrew J. Hesford <[email protected]>
1 parent 54bbde2 commit c46994e

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

docs/general/remote-access.rst

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -178,18 +178,29 @@ into the image. However, there are two problems with this:
178178
format.
179179

180180
To create dedicated host keys in the proper format, decide on a location, for example ``/etc/dropbear``, and create the
181-
new keys::
181+
new keys:
182182

183-
mkdir -p /etc/dropbear
184-
for keytype in rsa ecdsa ed25519; do
185-
dropbearkey -t "${keytype}" -f "/etc/dropbear/dropbear_${keytype}_host_key"
186-
done
183+
.. tabs::
187184

188-
.. note::
189-
The dracut module expects to install RSA and ECDSA keys, so at minimum those keys should be created.
190-
The mkinitcpio module supports RSA, ECDSA, and ED25519 keys.
185+
.. group-tab:: Dracut
186+
187+
The dracut module expects to install RSA and ECDSA keys, so at least these keys should be created. The ``dracut-crypt-ssh`` module forces the use of the ``dropbearconvert`` utility during creation of the initramfs image to convert OpenSSH keys into the format used by ``dropbear``. Care must be taken to ensure that OpenSSH keys are created in the PEM format expected by ``dropbearconvert``::
188+
189+
mkdir -p /etc/dropbear
190+
for keytype in rsa ecdsa ed25519; do
191+
ssh-keygen -g -N "" -m PEM -t "${keytype}" -f "/etc/dropbear/ssh_host_${keytype}_key"c
192+
done
193+
194+
.. group-tab:: mkinitcpio
191195

192-
Not all versions of ``dropbear`` support ED25519 keys, so it is fine if the ED25519 key fails to generate.
196+
For mkinitcpio, generate keys for all supported types::
197+
198+
mkdir -p /etc/dropbear
199+
for keytype in rsa ecdsa ed25519; do
200+
dropbearkey -t "${keytype}" -f "/etc/dropbear/dropbear_${keytype}_host_key"
201+
done
202+
203+
Not all versions of ``dropbear`` support ED25519 keys, so it is fine if creation of the ED25519 key fails.
193204

194205
The Dracut and mkinitcpio dropbear modules do not allow for password authentication over SSH; instead key-based
195206
authentication is forced. The authorized keys for dropbear can be configured by putting an `authorized_keys file
@@ -208,7 +219,7 @@ realized by symlinking your user's ``authorized_keys`` file::
208219
# Enable dropbear ssh server and pull in network configuration args
209220
add_dracutmodules+=" crypt-ssh "
210221
install_optional_items+=" /etc/cmdline.d/dracut-network.conf "
211-
# Copy system keys for consistent access
222+
# Use pre-generated keys for consistent access
212223
dropbear_rsa_key=/etc/dropbear/ssh_host_rsa_key
213224
dropbear_ecdsa_key=/etc/dropbear/ssh_host_ecdsa_key
214225
dropbear_acl=/etc/dropbear/root_key

0 commit comments

Comments
 (0)