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?