Last active
February 10, 2026 02:49
-
-
Save fxstein/a91f07347160276336ebb05045b94073 to your computer and use it in GitHub Desktop.
Pi SSH client setup — connect any Mac to Pi
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
| #!/usr/bin/env bash | |
| # ============================================================ | |
| # PI CLIENT SETUP — Connect any Mac to Pi via SSH | |
| # Usage: curl -fsSL https://raw.githubusercontent.com/pionizer/pi-infra/main/setup-client.sh | bash | |
| # ============================================================ | |
| set -euo pipefail | |
| echo "🥧 Pi Client Setup" | |
| echo "" | |
| # ============================================================= | |
| # 1. CLOUDFLARED | |
| # ============================================================= | |
| if command -v cloudflared &>/dev/null; then | |
| echo "✅ cloudflared installed" | |
| else | |
| echo "📦 Installing cloudflared..." | |
| if command -v brew &>/dev/null; then | |
| brew install cloudflared | |
| else | |
| echo "❌ Homebrew not found. Install cloudflared manually:" | |
| echo " https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/" | |
| exit 1 | |
| fi | |
| fi | |
| # ============================================================= | |
| # 2. SSH CONFIG | |
| # ============================================================= | |
| SSH_CONFIG="$HOME/.ssh/config" | |
| GLUON_HOST="o-gluon.pionizer.ai" | |
| CLOUDFLARED_PATH=$(which cloudflared) | |
| mkdir -p "$HOME/.ssh" | |
| touch "$SSH_CONFIG" | |
| chmod 600 "$SSH_CONFIG" | |
| if grep -q "$GLUON_HOST" "$SSH_CONFIG" 2>/dev/null; then | |
| echo "✅ SSH config exists for $GLUON_HOST" | |
| else | |
| printf '\nHost %s\n ProxyCommand %s access ssh --hostname %%h\n User oratzes\n' \ | |
| "$GLUON_HOST" "$CLOUDFLARED_PATH" >> "$SSH_CONFIG" | |
| echo "✅ Added $GLUON_HOST to ~/.ssh/config" | |
| fi | |
| # ============================================================= | |
| # 3. VERIFY | |
| # ============================================================= | |
| echo "" | |
| echo "✅ Done! Connect with:" | |
| echo "" | |
| echo " ssh $GLUON_HOST" | |
| echo "" | |
| echo "First time: Google Auth will open in your browser." | |
| echo "Accept the host key fingerprint when prompted (yes)." | |
| echo "" | |
| echo "Passwordless login:" | |
| echo "" | |
| echo " ssh-copy-id $GLUON_HOST" | |
| echo "" | |
| echo "After that, only Google Auth (once per 24h) — no password." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment