update README to use package config for authorized keys

Now that the host key is created automatically, this allows using breakglass
without ever creating or modifying a permanent partition.
This commit is contained in:
Michael Stapelberg 2022-01-03 11:39:01 +01:00
parent 9bea6256b0
commit 77705dbe49

View File

@ -15,7 +15,21 @@ started via the gokrazy web interface.
## Installation ## Installation
Add the `github.com/gokrazy/breakglass` package to your `gokr-packer` Please see https://gokrazy.org/quickstart/ if youre unfamiliar with gokrazy.
First, install your SSH public key(s) as authorized via [package
config](https://gokrazy.org/userguide/package-config/) for the
`github.com/gokrazy/breakglass` package:
```
mkdir -p extrafiles/github.com/gokrazy/breakglass/etc/
cat ~/.ssh/id_*.pub extrafiles/github.com/gokrazy/breakglass/etc/breakglass.authorized_keys
mkdir -p flags/github.com/gokrazy/breakglass/
echo '-authorized_keys=/etc/breakglass.authorized_keys' > flags/github.com/gokrazy/breakglass/flags.txt
```
Then, add the `github.com/gokrazy/breakglass` package to your `gokr-packer`
command, e.g.: command, e.g.:
``` ```
@ -25,15 +39,6 @@ gokr-packer -overwrite=/dev/sdx \
github.com/gokrazy/breakglass github.com/gokrazy/breakglass
``` ```
On the permanent file system of your gokrazy installation, create a
host key and an authorized keys file. Assuming you mounted the
permanent file system at `/media/sdx4`:
```
sudo ssh-keygen -N '' -t ed25519 -f /media/sdx4/breakglass.host_key
sudo install -m 600 ~/.ssh/id_*.pub /media/sdx4/breakglass.authorized_keys
```
## Usage ## Usage
Be sure to install the convenience SSH wrapper tool on the host: Be sure to install the convenience SSH wrapper tool on the host: