SSH key generation error

I created an image for a batch of Jetson Nano boards. When flashing the firmware onto the devices, some devices experienced SSH connection problems. Troubleshooting revealed that the SSH key files were corrupted; the SSH keys appeared to be empty files. Therefore, I regenerated the key files using the following method.

sudo rm -f /etc/ssh/ssh_host_*

sudo ssh-keygen -A

sudo systemctl restart ssh

sudo systemctl status ssh

sudo sshd -t

After regenerating the key file, I was able to connect via SSH.

What could be causing this key file to be abnormal? Strangely, most devices don’t have this problem, so I don’t think it’s a firmware error. What are some troubleshooting steps?

Hi,

is the generated image a clean image or a cloned one?

Thanks

it is clean image

Hi,

Please provide detailed step-by-step commands for flashing, cloning, and mass-flashing an image.

Include all necessary instructions so we can fully reproduce the process on our development kit.

Thanks