我的late_command在预先安装Debian jessie时没有执行。我甚至找不到.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
有什么建议吗?
不需要尾随空格。我还遇到了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