Coder Social home page Coder Social logo

rwanyoike / mkinitcpio-remote-cryptroot Goto Github PK

View Code? Open in Web Editor NEW
1.0 4.0 0.0 5 KB

๐Ÿ” A systemd init (systemd hook) based implementation for booting a LUKS-encrypted system remotely

Home Page: https://wiki.archlinux.org/index.php/Dm-crypt/Specialties#Remote_unlocking_of_the_root_(or_other)_partition

License: MIT License

Shell 100.00%
archlinux mkinitcpio systemd cryptroot ssh luks encryption

mkinitcpio-remote-cryptroot's Introduction

mkinitcpio-remote-cryptroot

systemd-networkd + tinysshd + systemd-tty-ask-password-agent

SRB2Kart

[Arch Linux] If you want to be able to boot a fully LUKS-encrypted system remotely, you will need a way to enter a passphrase for the root partition/volume at startup. This can be achieved by running a set of mkinitcpio hooks that configure a network interface, ssh access, and a password agent in initramfs.

$ ssh root@<remote host>
๐Ÿ” Please enter passphrase for disk cryptroot: (press TAB for no echo)

Works as of systemd 245 (245.6-7-arch)

Example

Example /etc/mkinitcpio.conf:

...
HOOKS=(base autodetect modconf block filesystems keyboard fsck systemd sd-encrypt network tinyssh password-agent)
...

Hooks

systemd (owned by the systemd package)

See: https://wiki.archlinux.org/index.php/Mkinitcpio#Common_hooks

This hook triggers a systemd based init, which does not run any runtime hooks but uses systemd units instead.

sd-encrypt (owned by the cryptsetup package)

See: https://wiki.archlinux.org/index.php/Mkinitcpio#Common_hooks

This hook allows for an encrypted root device with systemd initramfs.

Recommend: That you set a root device timeout kernel parameter:

rootflags=x-systemd.device-timeout=0

network

This hook sets up the systemd-networkd.service systemd service and copies over any *.initramfs files in /etc/systemd/network.

Example:

# /etc/systemd/network/wired.network.initramfs

[Match]
Name=*

[Network]
DHCP=yes

tinyssh

This hook sets up the initrd-tinyssh.service systemd service, converts the openssh ed25519 host key to binary format for TinySSH, and copies over the authorized keys file at /etc/tinyssh/root_key.

Example:

# /etc/tinyssh/root_key

ssh-ed25519 <base64-encoded key> <comment>

password-agent

This hook adds the command systemd-tty-ask-password-agent --query to /root/.profile (for sh invocation).

License

This project is licensed under the MIT License.

mkinitcpio-remote-cryptroot's People

Contributors

rwanyoike avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.