Denny Crane
Denny Crane

Reputation: 659

Debian preseed late_command not executed

My late_command is not executed during my preseeded installation of Debian jessie. I don't even find the .ssh directory.

[...]
d-i preseed/late_command string \
  in-target mkdir /root/.ssh ; \
  in-target /bin/sh -c "echo 'ssh-rsa $long_key > /root/.ssh/authorized_keys" ; \
  in-target chmod 0700 /root/.ssh ; \
  in-target chmod 0600 /root/.ssh/authorized_keys
d-i finish-install/reboot_in_progress note

Any suggestions what could possibly wrong?

Upvotes: 6

Views: 6833

Answers (1)

xshadow
xshadow

Reputation: 81

Trailing spaces are not neccessary. I had also problems with chmod instructions.

I attached the snipped, that worked for me:

d-i preseed/late_command string in-target mkdir -p /root/.ssh; \
in-target /bin/sh -c "echo 'ssh-ed25519 AAAAC3NzaC1IAg1wilR9asDXIPwTsvZXasdTXqasdKv0rIqqweAtxGVgup foobar' >> /root/.ssh/authorized_keys"; \
in-target chown -R root:root /root/.ssh/

d-i finish-install/reboot_in_progress note

Upvotes: 7

Related Questions