I have an init script that
mkdir -p raspi-os-image/home/pi/.ssh and adds a SSH key to
authorized_keys inside. The problem is, when doing this it needs to be done as root and then once the system is initialized, the
pi user cannot save anything new into
known_hosts due to
~/.ssh being owned by
When I am on the linux environment that has the OS image mounted (where I make the
mkdir call) I am unable to run
chown pi:pi raspi-os-image/home/pi/.ssh because
pi is not a valid user on this system.
Is there any way to do this? Must I create a
pi user on this system?