SSH_HOST="192.168.1.100" ./scripts/vps-setup.shSSH_HOST="192.168.1.100" ./scripts/deploy.sh webSOURCE_HOST="192.168.1.100" DESTINATION_HOST="192.168.1.101" \
./scripts/deploy-bastion.sh myapp example.com 3000SSH_HOST="sql-steelgem" ./scripts/vps-setup.sh
SOURCE_HOST="edge-prod" DESTINATION_HOST="node-steelgem" \
./scripts/deploy-bastion.sh myapp example.com 3000SSH_HOST="192.168.1.100" SSH_USER="ubuntu" SSH_PORT="22" ./scripts/vps-setup.shcp .env.example .env
# Edit .env
./scripts/vps-setup.sh# Add to ~/.ssh/config
Host sql-steelgem
HostName 192.168.1.100
User ubuntu
Port 22
# Then use
SSH_HOST="sql-steelgem" ./scripts/vps-setup.shsudo ./scripts/vps-setup.shSSH_HOST="new-vps-ip" ./scripts/vps-setup.shfor host in 192.168.1.100 192.168.1.101 192.168.1.102; do
SSH_HOST="$host" ./scripts/deploy.sh web
done# Create .env with all servers
cat > .env << EOF
SOURCE_HOST="192.168.1.100"
DESTINATION_HOST="192.168.1.101"
SSH_SUDOERS=true
INSTALL_TAILSCALE=true
EOF
# Deploy to both servers
SSH_HOST="192.168.1.100" ./scripts/deploy.sh production
SSH_HOST="192.168.1.101" ./scripts/deploy.sh production
# Deploy application
./scripts/deploy-bastion.sh myapp example.com 3000SSH_HOST="192.168.1.100" ssh ubuntu@192.168.1.100 "echo OK"SSH_HOST="192.168.1.100" ./scripts/vps-setup.sh --helpssh ubuntu@192.168.1.100 "curl -I http://localhost 2>/dev/null | head -1"| File | Type | Purpose |
|---|---|---|
| scripts/ssh-config.sh | NEW | SSH connection resolution |
| scripts/vps-setup.sh | MODIFIED | Remote execution support |
| scripts/deploy.sh | MODIFIED | Remote deployment |
| scripts/deploy-bastion.sh | MODIFIED | Dynamic hosts |
| .env.example | UPDATED | Configuration template |
| README.md | UPDATED | Documentation |
| IMPLEMENTATION-SUMMARY.md | NEW | Detailed changes |
| docs/DYNAMIC-SSH-GUIDE.md | NEW | Usage scenarios |
- README.md - Full documentation and usage guide
- .env.example - Configuration template with all options
- docs/DYNAMIC-SSH-GUIDE.md - 7 detailed scenarios with examples
- IMPLEMENTATION-SUMMARY.md - Technical implementation details
✅ No hardcoded aliases ✅ Flexible configuration ✅ Remote execution support ✅ Multiple server support ✅ Backward compatible ✅ Standard SSH integration
SSH_HOST- Target hostname or IP (enables remote mode)SSH_USER- SSH username (default: ubuntu)SSH_PORT- SSH port (default: 22)
SOURCE_HOST- Source server (default: edge-prod)DESTINATION_HOST- Destination server (default: node-steelgem)SOURCE_PATH- Path on source (default: /home/ubuntu/current)DESTINATION_PATH- Path on destination (default: /var/www/apps)
UBUNTU_SUDOERS- Grant sudoers to app userINSTALL_TAILSCALE- Install VPN (default: true)INSTALL_NGINX- Install web server (default: true)TAILSCALE_HOSTNAME- Tailscale node nameTAILSCALE_AUTH_KEY- Tailscale authentication key
- Read docs/DYNAMIC-SSH-GUIDE.md for detailed scenarios
- Review .env.example for all configuration options
- Run your first remote setup:
SSH_HOST="your-ip" ./scripts/vps-setup.sh - Deploy applications:
./scripts/deploy-bastion.sh myapp example.com 3000
Enjoy your new alias-free VPS workflow! 🚀