Jip-Hop / sedunlocksrv-pba

Conveniently unlock your Self Encrypting Drive on startup (via HTTPS) without the need to attach monitor and keyboard
GNU General Public License v3.0
36 stars 8 forks source link

SSH SED unlock service #5

Closed kapitainsky closed 1 year ago

kapitainsky commented 1 year ago
Screenshot 2023-04-28 at 12 13 23 pm

build.sh - builds image exactly like before build.sh SSH - adds ssh unlocking service

New dependencies : apt install dropbear <-- needed to generate host keys ./ssh/authorized_keys <-- user has to provide

Usage: ssh -p 2222 tc@IP

Not using default port 22 as do not want to have certificates conflicts. Most likely unlocked server has SSH access already but with different keys.

kapitainsky commented 1 year ago

Please have a look and let me know if anything should be changed

kapitainsky commented 1 year ago

When you are happy with this PR I will also add some info to README.md

Jip-Hop commented 1 year ago

Thanks for the PR. Integration looks clean!

What is the reason you don't allow passwords with a space? From the top of my head, I think the HTTPS unlock server and the drives themselves support passwords with spaces.

Also, why do you read the password character-for-character in a while loop? Could you use: read -s -p "Password: " password? This won't leave the unlock password in the terminal history.

Could you add dropbear to the dependencies in the Dockefile? Otherwise building the image with ssh will fail with the docker build method.

Did you confirm the image works as intended when flashed to the SED PBA?

Readme info would make it complete. 🙂

kapitainsky commented 1 year ago

Re. spaces - if you are right it is very bad practice. I will google a bit more.

Re. while-loop - it looks more pretty:) you see when you type - and * hide what you type. Normally I would use systemd-ask-password but it is not available on tiny core

Re. docker - I will look into it - not familiar with docker but should be easy

Re. test - yes

Re. Readme - it will be last step

kapitainsky commented 1 year ago

This is preview as I did not want to spend more time if you were unhappy with overall approach. Will finish this weekend

Jip-Hop commented 1 year ago

Great! I'm happy with overall approach 🙂

kapitainsky commented 1 year ago

I have allowed passwords with spaces. Added some README.

I think it is ready.

Jip-Hop commented 1 year ago

Thanks a lot :)