How would I automatically copy the disk encrypted keyfile at boot?


Recommended Posts

My array is encrypted and at boot up  I'm required to enter the path to the keyfile. (right now stored on my flash drive) I'm limited because my router/pfsense is a docker so I can't copy the keyfile across from my network etc using wget. So if I store the keyfile on the flash can I do a command like cp /boot/config/ssh/sshkeyimusing to my go file as a temp measure? Where would I copy that file too at boot time? Yes I know this bypasses the whole idea of the encrypted disks. I really just wanted to try it out

Link to comment

Copy the keyfile to /root . Easiest way is to add the copy command to /boot/config/go, before you start emhttp

#!/bin/bash

# let encrypted array auto-start (obviously, not secure)
cp /boot/config/custom/keyfile /root

# Start the Management Utility
/usr/local/sbin/emhttp &

 

 

Link to comment
10 minutes ago, ljm42 said:

Copy the keyfile to /root . Easiest way is to add the copy command to /boot/config/go, before you start emhttp


#!/bin/bash

# let encrypted array auto-start (obviously, not secure)
cp /boot/config/custom/keyfile /root

# Start the Management Utility
/usr/local/sbin/emhttp &

 

 

what does this do?

 

# Start the Management Utility

/usr/local/sbin/emhttp &

 

Link to comment
Just now, wdelarme said:

what does this do?

 

# Start the Management Utility

/usr/local/sbin/emhttp &

 

That starts the webgui.  It is in your go script already, I was just showing that you want to copy the file before that line so the array will be able to auto-start.

Link to comment
Just now, ljm42 said:

I guess this is a good time to mention that you need to be careful when editing this file :) 

 

Also, be sure to use a good text editor that understands Linux line endings (such as Notepad++), definitely not the standard Windows Notepad.

I use VI or vim usually (Only way to learn it is to use it)

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.