My custom installer ISO has authorized keys for the nixos user set via users.users.nixos.openssh.authorizedKeys.keys but none for root.
In such cases it would be helpful if nixos-anywhere would additionally try to copy over the authorized_keys file from /etc/ssh/authorized_keys.d/$USER.
|
# Installation will fail if non-root user is used for installer. |
|
# Switch to root user by copying authorized_keys. |
|
if [[ ${isInstaller} == "y" ]] && [[ ${sshUser} != "root" ]]; then |
|
# Allow copy to fail if authorized_keys does not exist, like if using /etc/ssh/authorized_keys.d/ |
|
runSsh "${maybeSudo} mkdir -p /root/.ssh; ${maybeSudo} cp ~/.ssh/authorized_keys /root/.ssh || true" |
|
sshConnection="root@${sshHost}" |
|
fi |
My custom installer ISO has authorized keys for the
nixosuser set viausers.users.nixos.openssh.authorizedKeys.keysbut none forroot.In such cases it would be helpful if
nixos-anywherewould additionally try to copy over theauthorized_keysfile from/etc/ssh/authorized_keys.d/$USER.nixos-anywhere/src/nixos-anywhere.sh
Lines 1030 to 1036 in e86fad4