You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ami create: an image of an MPI rank-0 instance carries the cohort's root SSH key, which a child cohort reuses #1338
Found while fixing #1241. That fix discards per-instance state under /etc/spawn, /etc/profile.d, /var/lib/spored and /var/lib/spawn when an instance boots from an image of another instance. It does not cover root's SSH material, which the MPI user data writes and an image also carries.
Rank 0 mints the cohort's cluster key only if none exists: if [ ! -f /root/.ssh/id_rsa ]; then ssh-keygen ... fi. So on rank 0 of a cohort launched from an image of an earlier rank 0, the parent cohort's private key is still there and gets REUSED. Every member of the new cohort then authorizes that key, so whoever holds the parent cohort's key (its other members, if they are still running, or anyone with a copy of the image) can ssh as root into the new cohort.
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys and installPubKeyCommand (pkg/mpicohort) both APPEND, so root's authorized_keys on the image keeps the parent cohort's public key, and a child authorizes it whether or not it runs MPI.
cat >> /root/.ssh/config appends the Host * / StrictHostKeyChecking no block on every launch, so it accumulates copies.
Not verified
Worked out from the code. I have not launched a cohort from an image of a rank-0 instance.
Options
In the MPI user data, mint a fresh key per cohort (always, rather than only when id_rsa is missing) and write root's authorized_keys entry for the cluster key with a marker so it can be replaced, not appended.
Or have spawn ami create (launcher.ImageStateCleanupScript) remove the cluster key and its authorized_keys line before the snapshot. The source stays a working MPI node after that only if it is not re-wired, so the first option looks better.
Activity
fix(mpi,efa): mint the MPI cluster key per instance; --efa-group shar…
fix(mpi): strip inherited MPI cluster keys at boot (#1343)
fix(mpi): strip inherited MPI cluster keys at boot (#1343)
fix(mpi): strip inherited MPI cluster keys at boot (#1343) (#1363)