From 20af6b67a811fd43d55d7476b1d1f1953a74e704 Mon Sep 17 00:00:00 2001 From: Tommy Rantti Date: Sat, 26 Sep 2026 20:32:23 +0300 Subject: [PATCH] Derive SSH host alias from DNSName instead of raw HostName Tailscale's raw HostName field is whatever the OS reports (e.g. "Pixel 9" with a literal space for an Android device), which breaks when written unquoted into an SSH config Host line - ssh_config treats space-separated words as multiple patterns, not one literal name. DNSName is already sanitized (hyphens, no spaces) for exactly this purpose, so derive the alias from its first label instead. Co-Authored-By: Claude Sonnet 5 --- bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index b6abeaf..4ff44c4 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -261,7 +261,7 @@ Host $name IdentityFile ~/.ssh/id_ed25519_${KEY_NAME} EOF ) - done < <(echo "$status_json" | jq -r '.Peer[] | "\(.HostName) \(.DNSName | rtrimstr("."))"') + done < <(echo "$status_json" | jq -r '.Peer[] | (.DNSName | rtrimstr(".")) as $d | "\($d | split(".")[0]) \($d)"') new_block+=$'\n'"$end" local old_block