#!/usr/bin/env bash # bastion-connector.sh # Simple helper to SSH into private VPC hosts via a bastion jump server. # Usage: # ./bastion-connector.sh [USERNAME] # # Example: # ./bastion-connector.sh 10.15.3.42 ubuntu # ./bastion-connector.sh 10.15.7.10 root # --- Configurable Variables --- BASTION_HOST="bastion.vpc.example.com" # Change to your real bastion hostname/IP TARGET_IP="$1" TARGET_USER="${2:-ubuntu}" # Default username if not provided # --- Validation --- if [ -z "$TARGET_IP" ]; then echo "Usage: $0 [USERNAME]" exit 1 fi echo "🔌 Connecting to $TARGET_IP via bastion $BASTION_HOST ..." ssh -J "$TARGET_USER@$BASTION_HOST" "$TARGET_USER@$TARGET_IP"