Luks-unlock-by-usb-ssh-passphrase

a hook-script for ubuntu server 14.04 to unlock a LUKS-drive at boot, using ssh, an usb-drive or passphrase

Download as .zip Download as .tar.gz View on GitHub

LUKS-unlock-by-usb-ssh-passphrase

a hook-script for ubuntu server 14.04 to unlock a LUKS-drive at boot, using ssh, an usb-drive or passphrase

    CAUTION! Usage of this file happens on your own risk!

This script has been tested on fresh installations/upgrades of ubuntu server 14.04 and 16.04. Unfortunately I don’t have the opportunity to test it more in depth.

This script is based on the LUKS-tripple-unlock script (https://github.com/chadoe/luks-triple-unlock) by Martin van Beurden,

on the tutorial Entschlüsseln mit einem USB-Stick (https://wiki.ubuntuusers.de/System_verschl%C3%BCsseln/Entschl%C3%BCsseln_mit_einem_USB-Schl%C3%BCssel/ ), Revision from 14. Juni 2016 08:32 last edited by noisefloor and originally created by Franco_bez (https://ubuntuusers.de/user/franco_bez/)

and decryptkeydevice by Franco_bez (https://ubuntuusers.de/user/franco_bez/) as found at (https://wiki.ubuntuusers.de/System_verschl%C3%BCsseln/Entschl%C3%BCsseln_mit_einem_USB-Schl%C3%BCssel/#Anlegen-der-noetigen-Konfigurationsdateien), published under CC BY-NC-SA 2.0 DE (http://creativecommons.org/licenses/by-nc-sa/2.0/de/deed.de).

All credits and rights for these scripts belong to them.

I made this script because I used an usb-drive to unlock my server. Wanting to be able to remotely reboot the server if necessary, I had to let the usb-drive plugged into the server, which makes any encryption more or less useless. Because of that I began searching for other ways to unlock the server and found the script i mentioned above, which was very similar to the script I already used for unlocking. After having read both of them it was clear they have got the same roots, so I thought it should be possible to combine them, which is exactly what I did.

This Script was tested on Ubuntu Server 14.04 and 16.04. I am not responsible for any changes you make to your system. Continue with caution and ensure to have an initramfs-backup you can use to boot if something strange happens.

The script works for me when having one LVM to unlock. This script also works with RAID 1.

This script uses dropbear. For detailed instructions how to set up dropbear, please use the following article: https://www.thomas-krenn.com/de/wiki/Voll-verschl%C3%BCsseltes-System_via_SSH_freischalten

How to install this file:

How to use this file:

One last word concerning the License: unfortunately, here are two projects merged which are published under different Licenses. The install.sh-script from Martin van Beurden may be used under the MIT-License, whereas the script from Franco_be which is found at ubuntuusers.de has to be published under the CC BY-NC-SA 2.0 DE by the forum-guidelines from ubuntuusers.de. So its a bit unclear which License to use. Because the MIT-License is pretty easy, whereas the CC-License is pretty restrictive it seems to be the most logical decission to use this License for the scripts. I hope this is okay with everyone who contributed to the scripts I used. If it is not, please feel free to contact me so we can decide how to go on.