Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debian preseed late_command not executed

Tags:

debian

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?

like image 622
Denny Crane Avatar asked Oct 13 '15 21:10

Denny Crane


1 Answers

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
like image 158
xshadow Avatar answered Nov 15 '22 03:11

xshadow