I have set up a Raspian Buster OS with /etc in its own partition. Whenever I reboot the machine, the ssh keys in /etc/ssh keep being regenerated. I have checked jounrnalctl log, but it doesn't show anything. Another strange aspect is when the keys are regenerated they always have an older date/time that always stays the same. I also tried removing the keys and regenerating them via dpkg-reconfigure openssh-server
. On reboot, the date of the files revert to that previous date again along with new keys. How do I track down and solve this problem?
Update:
I had not mentioned that I was using an overlayFS earlier. In order to try the mount --bind / /mnt/dsk
suggestion, I turned the overlayFS off. After doing so, the problem still remains, but now the new keys being generated have the current timestamp on the files. The /mnt/dsk/etc/ssh/ keys never change.
/etc
being mounted early enough in the boot sequence? 3. If youmkdir -p /mnt/dsk; mount --bind / /mnt/dsk
, is there a/mnt/dsk/etc/ssh
? Does it contain the newly-generated keys?