Thanks subzero79 for mentioning the drop bear method. I think it works perfectly.
For any one else that would like to unlock LUKS partitions remotely by ssh using dropbear at boot up here is what I did.
* My setup is as such: OMV 5, LUKS+UnionFS+SnapRaid which I setup using https://michaelxander.com/diy-nas/. Becarefull not to reboot here if you are using unionfs becuase the system will panic and drop you to rescue mode because the LUKS drives have not been encrypted. (post 247546)
* I updated my /etc/crypttab to look like this
# <target name> <source device> <key file> <options>
sdb-crypt /dev/sdb none luks,initramfs
sdc-crypt /dev/sdc none luks,initramfs
sdd-crypt /dev/sdd none luks,initramfs
Just by doing this at the next reboot the system will ask you for the pass phrase for each disk. This is nice in itself.
Also note you can change luks,initramfs to luks,initramfs,keyscript=decrypt_keyctl if you want the same password to cached for 60 seconds and used on all the drives. There are other scritpts that my be hand in /lib/cryptsetup/scripts
Setting up Dropbear
* I guided by the the instructions on on how to setup Dropbear at https://www.arminpech.de/2019/12/23/debian-unlock-luks-root-partition-remotely-by-ssh-using-dropbear/ I did this:
** apt-get install dropbear-initramfs
** I copied my public key from by putty client to /etc/dropbear-initramfs/authorized_keys You have to do this because Dropbear has disabled password based logins.
** Changed the DROPBEAR_OPTIONS line in /etc/dropbear-initramfs/config
DROPBEAR_OPTIONS="-p 2222"
** Ran update-initramfs -k all -u
Results
When your system reboots it will wait for you to enter the passphrase for each disk. But now you can SSH into the system too.
I used putty with my private key that is paired with the public key that I added in the step above to port 2222.
You login as root and are automatically taken to the command prompt.
Enter bin/cryptroot-unlock and respond the passphrases for each disk.
Afterwards you will be logged out and the boot process will proceed as normal.
#OMV5.x