Fix authorized_keys generation procedure

This commit is contained in:
Tanguy Herbron 2022-05-23 23:33:55 +02:00
parent 4abfa6f047
commit c3d71ab92c

View File

@ -468,7 +468,7 @@ d-i finish-install/reboot_in_progress note
# packages and run commands in the target system.
d-i preseed/late_command string apt-install zsh; \
in-target sudo -u creator mkdir -p -m 700 /home/creator/.ssh; \
in-target sudo -u creator install -m 600 /home/creator/.ssh/authorized_keys; \
in-target sudo -u creator echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDYsz4jdyzf9UcJ8eEavVmi+DNYE3ioeJBfTlVMw7Vsb tanguy@Diogenes" > /home/creator/.ssh/authorized_keys; \
in-target sudo -u creator sh -c 'echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDYsz4jdyzf9UcJ8eEavVmi+DNYE3ioeJBfTlVMw7Vsb tanguy@Diogenes" > /home/creator/.ssh/authorized_keys'; \
in-target chmod 600 /home/creator/.ssh/authorized_keys; \
in-target sed -i -E 's/#?PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config;