2

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.

Scott
  • 143
  • What's the timestamp on the newly generated keys? Are you running an NTP client? Are the keys regenerated before the system time is synchronized? – Kusalananda Jun 02 '20 at 20:06
  • How do you know the keys keep getting regenerated if they have the same date/time as the previous instance? 2. Is /etc being mounted early enough in the boot sequence? 3. If you mkdir -p /mnt/dsk; mount --bind / /mnt/dsk, is there a /mnt/dsk/etc/ssh? Does it contain the newly-generated keys?
  • – Chris Davies Jun 02 '20 at 20:16
  • @Kusalananda - The timestamp is always the same - an older date than current. Possibly, but new info below. – Scott Jun 03 '20 at 16:56
  • @roaima - Because their contents change each time. 2. Don't know. 3. No. I have some more info that I'll add with an edit to the original post. – Scott Jun 03 '20 at 16:57
  • If this problem still exists, please switch off Overlay FS (as you have mentioned in the update part of the question) and redescribe the problem. I can't identify which parts of "the problem still remains" you're referencing, and which parts are no longer an issue. – Chris Davies Dec 16 '20 at 19:32