dracut-crypt-ssh / dracut-crypt-ssh

dracut initramfs module to start dropbear sshd during boot to unlock the root filesystem with the (cryptsetup) LUKS passphrase remotely
GNU General Public License v2.0
287 stars 52 forks source link

Dropbear_acl non root authorized_keys owner #61

Open Sithuk opened 1 year ago

Sithuk commented 1 year ago

I set the dropbear_acl variable to a non root user’s authorized_keys file. I couldn’t login remotely so I checked the authorized_keys file in the initramfs. I’m using zfsbootmenu so I just dropped to the emergency shell to check it.

I noticed that the content of the file was correct, but its ownership was 1000:1000. I chown’d the authorized_keys to root:root and could instantly connect from the remote terminal.

Should the installation be setting the authorized_keys file ownership properties after copying it across?

Sithuk commented 1 year ago

Adding the following line to /60crypt-ssh/module-setup.sh fixed the issue. chown root:root "${initdir}/root/.ssh/authorized_keys"