Debian Preseed late_command
In Debian installation process, the preseed.cfg file allows for automated installations by pre-configuring various installation parameters. In this article I will focus on the d-i preseed/late_command string parameter, which is used to run custom commands at the end of the installation process. Here is an example that I recently used in my packer-vbox-debian-latest project: d-i preseed/late_command string \ mkdir --mode=700 /target/home/testuser/.ssh; \ wget -q http://10.0.2.2:8081/key.pub -O /target/home/testuser/.ssh/authorized_keys; \ in-target chown testuser:testuser /home/testuser/.ssh; \ in-target chown testuser:testuser /home/testuser/.ssh/authorized_keys; \ in-target chmod 0600 /home/testuser/.ssh/authorized_keys As you can see, sometimes /target is used, other times in-target, I must admit I struggled a bit to understand the difference and when to use one instead of the other. ...