Spaces:
Running
Running
File size: 585 Bytes
386b079 |
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 |
#!/bin/bash
echo "=== 快速 SSH 连接测试 ==="
echo ""
echo "测试 1: 使用超时和详细输出(端口 443)"
timeout 10 ssh -vT -o ConnectTimeout=5 -o StrictHostKeyChecking=no [email protected] 2>&1 | head -20
echo ""
echo "测试 2: 检查 SSH 配置"
if [ -f ~/.ssh/config ]; then
echo "当前 hf.co 配置:"
grep -A 10 "Host hf.co" ~/.ssh/config
else
echo "~/.ssh/config 不存在"
fi
echo ""
echo "测试 3: 检查 SSH key"
if [ -f ~/.ssh/id_ed25519 ]; then
echo "✓ SSH key 存在"
ls -lh ~/.ssh/id_ed25519*
else
echo "✗ SSH key 不存在"
fi
|