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

Trimming SSH lines removes spaces from them

KamilaBorowska opened this issue · comments

In #165, trimming user keys was introduced. This appears to be buggy, removing spaces from keys.

$ line='ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK8rVxv/PJRJPXrsbaOL/aR7W9TPsGyjfV2Y+HutuDoH'

$ line=$(echo -n "$line" | sed 's/\r//g')

$ echo $line
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK8rVxv/PJRJPXrsbaOL/aR7W9TPsGyjfV2Y+HutuDoH

$ trimmed_line=$(echo -n "$line" | tr -d '[:space:]')

$ echo $trimmed_line
ssh-ed25519AAAAC3NzaC1lZDI1NTE5AAAAIK8rVxv/PJRJPXrsbaOL/aR7W9TPsGyjfV2Y+HutuDoH

Note how space was removed from SSH key after ssh-ed25519 making it unusable.

experiencing similar behavior which led to my machines being unusable. it's probably best to fork based off of the last known good commit hash and move forward.

i'm using this without issue.