-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-ssh-connectivity.sh
More file actions
executable file
·62 lines (51 loc) · 1.61 KB
/
test-ssh-connectivity.sh
File metadata and controls
executable file
·62 lines (51 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
# SSH Connectivity Test Script for Pair Networks
# Tests various connection methods to identify the correct approach
echo "🔍 Testing SSH connectivity to Pair Networks..."
# Test different hostnames and IPs
HOSTS=(
"certifiedhq.com"
"certifiedhq.pairserver.com"
"216.146.206.69"
"216.146.192.24"
)
SSH_KEY="~/.ssh/stackblog_pair_rsa"
USER="certifiedhq"
echo "📋 Testing SSH connections:"
echo " User: $USER"
echo " Key: $SSH_KEY"
echo ""
for host in "${HOSTS[@]}"; do
echo "Testing $host..."
if timeout 10 ssh -o ConnectTimeout=8 -o BatchMode=yes -i $SSH_KEY $USER@$host "echo 'SUCCESS: Connected to' && hostname && pwd" 2>/dev/null; then
echo "✅ SUCCESS: $host"
echo "🎯 Use this host for deployment: $host"
break
else
echo "❌ FAILED: $host (timeout/refused)"
fi
echo ""
done
echo ""
echo "🔍 Network diagnostics:"
echo ""
for host in "${HOSTS[@]}"; do
echo "Ping test for $host:"
if ping -c 2 -W 3 $host > /dev/null 2>&1; then
echo "✅ Ping successful: $host"
else
echo "❌ Ping failed: $host"
fi
done
echo ""
echo "📋 SSH Key Information:"
ssh-keygen -lf ~/.ssh/stackblog_pair_rsa.pub 2>/dev/null || echo "❌ SSH key not found"
echo ""
echo "📋 Current SSH Agent Keys:"
ssh-add -l 2>/dev/null || echo "❌ No keys in SSH agent"
echo ""
echo "🎯 Next Steps:"
echo "1. If no connections work, try from different network/computer"
echo "2. Verify SSH key is active in Pair Networks control panel"
echo "3. Use working host in deploy-pair-networks.sh"
echo "4. Run deployment: ./deploy-pair-networks.sh"