An Odd SSH Key Regeneration Question

Discussion in 'DIY and Makers Spot' started by pc-tecky, Feb 19, 2018.

  1. pc-tecky

    pc-tecky Member

    Joined:
    May 1, 2013
    Messages:
    154
    Likes Received:
    21
    So in following along various posts and tutorials for network booting (PXE) Raspberry Pi's, there is a line of code to regenerate the SSH private and public keys. Interesting indeed. So if the theory or case is that the primary system keys would be identical to the other PXE hosted keys for subsequent systems (A, B, C, D, etc.), then why is this regeneration of keys not needed for most other Linux distros and freshly burned images installed to computers, USB flash drives, or liveCDs?
     
    #1
  2. JustinH

    JustinH Active Member

    Joined:
    Jan 21, 2015
    Messages:
    123
    Likes Received:
    71
    Most of the liveCD’s etc will create new SSH keys upon boot (unless you have some persistent storage).
    When the keys are generated they are usually stored in /etc/sshd/ so on a PXE scenario all hosts that share the /etc directory would have the same keys.
    For normal installs - when SSHD starts up it will check if keys exist and if not create new ones (via the startup scripts). By default the SSH packages don’t include any keys when you install the package.


    Sent from my iPhone using Tapatalk
     
    #2

Share This Page