Sure, I suppose as long as sshd is up and running in the ramdisk environment (which you mentioned in another comment, along with all other services) you could always reconnect. Very neat and clever!
What happens if the SSH session closes before dd finishes? Sounds pretty badass but I don’t think I would trust this approach in prod lol
True, but I was more thinking about the issue of reconnecting in general when you just nuked sshd.