How can I enter recovery mode (for Mac OS, on an iMac) remotely?
You can set NVRAM options from command line to boot into recovery:

sudo nvram "recovery-boot-mode=unused"
sudo reboot


This will put your system into recovery mode.

NVRAM (nonvolatile random-access memory) is a small amount of memory that holds certain settings and can be accessed at boot by the Mac's firmware.