elitak / nixos-infect

[GPLv3+] install nixos over the existing OS in a DigitalOcean droplet (and others with minor modifications)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fails with cert-authority authorized keys

fiddlerwoaroof opened this issue · comments

I like to use SSH certificate authorities to authorize all my computers at once. The regex in nixos-infect strips off the "cert-authority" prefix, making authentication impossible:

&& keys=$(sed -E 's/^.*((ssh|ecdsa)-[^[:space:]]+)[[:space:]]+([^[:space:]]+)([[:space:]]*.*)$/\1 \3\4/' "$trypath") \

Here's a sample authorized_keys line for this sort of authentication:

cert-authority ssh-ed25519 00000000000000000000000000000000000000000000000000000000000000000000 2020-11-23

I forked this project and have used this modified sed command successfully: https://github.com/fiddlerwoaroof/nixos-infect/blob/8f3bb10b93e9216b92196d8ca4b082184a2d554e/nixos-infect#L16