Created
February 9, 2026 21:12
-
-
Save bhudgens/e76f61a91eeb8492b5706fa4b721cf8e to your computer and use it in GitHub Desktop.
Netbird Login Hack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NETBIRD_ADMIN_URL=https://netbird.example.com:443 | |
| NETBIRD_MANAGEMENT_URL=https://netbird.example.com:443 | |
| NETBIRD_SETUP_KEY=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX | |
| NETBIRD_HOSTNAME=homeassistant |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| if [ ! -f "$SCRIPT_DIR/.env" ]; then | |
| echo "ERROR: .env file not found. Copy .env.example to .env and fill in your values." | |
| exit 1 | |
| fi | |
| source "$SCRIPT_DIR/.env" | |
| for var in NETBIRD_ADMIN_URL NETBIRD_MANAGEMENT_URL NETBIRD_SETUP_KEY NETBIRD_HOSTNAME; do | |
| if [ -z "${!var}" ]; then | |
| echo "ERROR: $var is not set in .env" | |
| exit 1 | |
| fi | |
| done | |
| echo "=== NetBird HA Workaround ===" | |
| echo "This will:" | |
| echo " 1. Start an Ubuntu container" | |
| echo " 2. Install and downgrade NetBird to 0.63.0" | |
| echo " 3. Connect to your NetBird instance" | |
| echo " 4. Extract the PrivateKey for Home Assistant" | |
| echo "" | |
| echo "After NetBird connects, press Ctrl+C to stop it." | |
| echo "The PrivateKey will be printed automatically." | |
| echo "" | |
| docker run --rm -it \ | |
| --cap-add NET_ADMIN \ | |
| --cap-add SYS_RESOURCE \ | |
| --device /dev/net/tun:/dev/net/tun \ | |
| -e NETBIRD_ADMIN_URL="$NETBIRD_ADMIN_URL" \ | |
| -e NETBIRD_MANAGEMENT_URL="$NETBIRD_MANAGEMENT_URL" \ | |
| -e NETBIRD_SETUP_KEY="$NETBIRD_SETUP_KEY" \ | |
| -e NETBIRD_HOSTNAME="$NETBIRD_HOSTNAME" \ | |
| ubuntu:24.04 \ | |
| bash -c ' | |
| set -e | |
| echo ">>> Installing curl..." | |
| apt update -qq && apt install -y -qq curl > /dev/null 2>&1 | |
| echo ">>> Installing NetBird..." | |
| curl -fsSL https://pkgs.netbird.io/install.sh | sh > /dev/null 2>&1 | |
| echo ">>> Downgrading NetBird to 0.63.0..." | |
| apt install -y -qq --allow-downgrades netbird=0.63.0 > /dev/null 2>&1 | |
| mkdir -p /config | |
| echo ">>> Starting NetBird (press Ctrl+C after successful connection)..." | |
| echo "" | |
| netbird up \ | |
| --foreground-mode \ | |
| --config /config/config.json \ | |
| --log-file console \ | |
| --admin-url "$NETBIRD_ADMIN_URL" \ | |
| --management-url "$NETBIRD_MANAGEMENT_URL" \ | |
| --setup-key "$NETBIRD_SETUP_KEY" \ | |
| --hostname "$NETBIRD_HOSTNAME" \ | |
| --enable-rosenpass=false || true | |
| echo "" | |
| echo "============================================" | |
| echo "=== CONFIG OUTPUT ===" | |
| echo "============================================" | |
| cat /config/config.json | |
| echo "" | |
| echo "============================================" | |
| echo "" | |
| echo ">>> Copy the PrivateKey value above into your HA NetBird addon config.json" | |
| ' |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A script that performs the steps here for this bug. The parent bug seems to be tracked here.