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

SSH key extraction doesn't work with ssh-import-id

Noratrieb opened this issue · comments

commented

I used ssh-import-id-gh Nilstrieb which results in
/root/.ssh/authorized_keys containing

ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG0n1ikUG9rYqobh7WpAyXrqZqxQoQ2zNJrFPj12gTpP Nilstrieb@github/87124356 # ssh-import-id gh:Nilstrieb

Then running sed -E 's/^.*((ssh|ecdsa)-[^[:space:]]+)[[:space:]]+([^[:space:]]+)([[:space:]]*.*)$/\1 \3\4/' /root/. ssh/authorized_keys (the sed monster extracted from

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

ssh-import-id gh:Nilstrieb

not exactly what we want.

On Contabo Ubuntu 22.04 running sed (GNU sed) 4.8