random-archer / mkinitcpio-systemd-tool

Provisioning tool for systemd in initramfs (systemd-tool)
https://www.archlinux.org/packages/community/any/mkinitcpio-systemd-tool/
Other
112 stars 27 forks source link

fix: Typo preventing the copy of authorized_keys file #106

Closed dvzrv closed 11 months ago

dvzrv commented 11 months ago

Fix a typo in the InitrdPath instruction in initrd-shell.service, which prevents the copy of the authorized_keys file and leads to error during run of mkinitcpio.

Fixes #105

sosyco commented 10 months ago

I use this functionality, but your patch didn't solve the problem: extra/mkinitcpio-systemd-tool 38-2 [Installiert]

mkinitcpio -p linux ... -> Running build hook: [systemd] -> Running build hook: [systemd-tool] **==> ERROR: invalid source path /etc/mkinitcpio-systemd-tool/config/authorized_keys** replacing initramfs unit file: /usr/lib/systemd/system/initrd-shell.service **==> ERROR: invalid source path /etc/mkinitcpio-systemd-tool/config/authorized_keys** remove existing /etc/tinyssh/sshkeydir convert openssh to tinysshd host key ed25519 ...

Last correct state: extra/mkinitcpio-systemd-tool 37-3 [installed]

mkinitcpio -p linux ... -> Running build hook: [systemd] -> Running build hook: [systemd-tool] replacing initramfs unit file: /usr/lib/systemd/system/initrd-debug-progs.service replacing initramfs unit file: /usr/lib/systemd/system/initrd-shell.service remove existing /etc/tinyssh/sshkeydir convert openssh to tinysshd host key ed25519 ...

dvzrv commented 10 months ago

mkinitcpio -p linux ... -> Running build hook: [systemd] -> Running build hook: [systemd-tool] **==> ERROR: invalid source path /etc/mkinitcpio-systemd-tool/config/authorized_keys** replacing initramfs unit file: /usr/lib/systemd/system/initrd-shell.service **==> ERROR: invalid source path /etc/mkinitcpio-systemd-tool/config/authorized_keys** remove existing /etc/tinyssh/sshkeydir convert openssh to tinysshd host key ed25519 ...

Does that file exist? If not, I guess that error is expected.

sosyco commented 10 months ago

/etc/mkinitcpio-systemd-tool/config/authorized_keys has to be a copy of /.ssh/authorized_keys generated on every mkinitcpio -p linux. So why should I generate this file manually?

->https://github.com/random-archer/mkinitcpio-systemd-tool#provisioning-questions-and-answers ... which ssh user keys are used by initramfs sshd server(s)?

they come from host /root/.ssh/authorized_keys

....

dvzrv commented 10 months ago
they come from host /root/.ssh/authorized_keys

This information is unfortunately wrong and still needs to be updated, see https://github.com/random-archer/mkinitcpio-systemd-tool/pull/104#issuecomment-1756331432