Debian preseed late_command没有被执行

Den*_*ane 3 debian

在我预装的Debian jessie安装期间,我的late_command没有被执行.我甚至找不到.ssh目录.

[...]
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
Run Code Online (Sandbox Code Playgroud)

有什么可能错的建议?

小智 5

尾随空间不是必需的.我也有chmod指令的问题.

我附上剪辑,这对我有用:

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
Run Code Online (Sandbox Code Playgroud)