Debian preseed late_command没有被执行

时间:2015-10-13 21:59:04

标签: 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

任何可能出错的建议?

1 个答案:

答案 0 :(得分: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