Логотип Git Ssh Custom Host

Git Ssh Custom Host

Спільнота
adityahimaone
git-ssh-custom-host

Set up SSH authentication for custom Git hosts (non-standard ports, custom domains, VPN-dependent hosts) with verification workflow and troubleshooting for common connectivity issues.

Огляд

Видавецьadityahimaone
Репозиторійhermes-agent-rtk-caveman
Назва навичкиgit-ssh-custom-host
Зірки
84
Форки
4
Файли в пакеті
Лише інструкції
ЛіцензіяMIT
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Усе необхідне — в інструкціях

    Усе потрібне моделі міститься в інструкціях — жодних додаткових файлів для синхронізації.

  • Відкритий вихідний код

    Опубліковано на GitHub користувачем adityahimaone. Перегляньте вихідний вміст перед установленням.

Встановлення

Установіть навичку ШІ Git Ssh Custom Host у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до Плагіни → Навички.
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/adityahimaone/hermes-agent-rtk-caveman/tree/main/skills/devops/git-ssh-custom-host
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Нова навичка → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/adityahimaone/hermes-agent-rtk-caveman.git /tmp/hermes-agent-rtk-caveman
mkdir -p .claude/skills
cp -r /tmp/hermes-agent-rtk-caveman/skills/devops/git-ssh-custom-host .claude/skills/git-ssh-custom-host
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Git Ssh Custom Host в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Git Ssh Custom Host, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції Markdown, а не код для певного постачальника, тому навичка Git Ssh Custom Host не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож невикористана навичка нічого не коштує.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

SSH Authentication for Custom Git Hosts

This skill sets up SSH-based authentication for Git hosts that aren't standard GitHub/GitLab.com (e.g., self-hosted GitLab, custom ports, internal domains, VPN-dependent hosts).

When to Use This Skill

  • Connecting to self-hosted GitLab/Gitea/Gitea instances
  • Using non-standard SSH ports (not port 22)
  • Hosts accessible only via VPN/internal network
  • Custom domain names that require DNS or /etc/hosts configuration
  • When standard github-auth skill doesn't apply due to host specificity

Detection Flow

First, understand what kind of host we're dealing with:

bash
# Get host details from user
echo \"Git host hostname (e.g., dev.fast-8.com):\"\nread GIT_HOST\necho \"Git host port (default 22):\"\nread GIT_PORT\necho \"Git username (usually 'git'):\"\nread GIT_USER

If no port specified, default to 22. If no username specified, default to 'git'.

Port Service Detection (Recommended)

Before configuring, verify what service is running on the target port:

bash
# Test if port is reachable
nc -z $GIT_HOST $GIT_PORT && echo \"Port $GIT_PORT reachable\" || echo \"Port $GIT_PORT unreachable\"

# If reachable, check what service is responding
if nc -z $GIT_HOST $GIT_PORT; then
  echo \"Checking service type on port $GIT_PORT...\"
  # Make a brief connection to see if it's SSH or HTTP
  RESPONSE=$(echo -n \"\" | nc $GIT_HOST $GIT_PORT 2>&1 | head -5)
  if echo \"$RESPONSE\" | grep -q \"SSH\" || echo \"$RESPONSE\" | grep -q \"^SSH-\"; then
    echo \"✓ Detected SSH service on port $GIT_PORT\"
  elif echo \"$RESPONSE\" | grep -q \"HTTP\" || echo \"$RESPONSE\" | grep -q \"<html\" || echo \"$RESPONSE\" | grep -q \"<!DOCTYPE\"; then
    echo \"⚠ Detected HTTP service on port $GIT_PORT - this is likely the web UI, not SSH\"
    echo \"  Try checking if SSH is available on the standard port (22) instead\"
    # Suggest checking standard SSH port
    nc -z $GIT_HOST 22 && echo \"  Port 22 is reachable - SSH might be on standard port\" || echo \"  Port 22 also unreachable\"
  else
    echo \"? Unclear service type on port $GIT_PORT\"
  fi
fi

read GIT_USER


If no port specified, default to 22.
If no username specified, default to 'git'.

## Step-by-Step Setup

### 1. Check for Existing SSH Key

```bash
# Check for existing SSH keys
ls -la ~/.ssh/id_*.pub 2>/dev/null || echo "No SSH keys found"

# If user wants to use existing key, note the path
# If needs new key, generate one:
ssh-keygen -t ed25519 -C "user@domain" -f ~/.ssh/id_custom_git -N ""

2. Configure SSH Config for Custom Host

Create or update ~/.ssh/config with host-specific settings:

bash
# Backup existing config if needed
cp ~/.ssh/config ~/.ssh/config.backup.$(date +%Y%m%d_%H%M%S) 2>/dev/null || true

# Add host configuration
cat >> ~/.ssh/config << EOF

# Custom Git host: $GIT_HOST
Host $GIT_HOST
    HostName $GIT_HOST
    Port ${GIT_PORT:-22}
    User ${GIT_USER:-git}
    IdentityFile ~/.ssh/id_custom_git
    IdentitiesOnly yes
    TCPKeepAlive yes
    ServerAliveInterval 30
    ServerAliveCountMax 3
EOF

# Set proper permissions
chmod 600 ~/.ssh/config

3. Add SSH Key to Agent

bash
# Start ssh-agent if needed
eval "$(ssh-agent -s)" 2>/dev/null || true

# Add the key
ssh-add ~/.ssh/id_custom_git

# Verify it's loaded
ssh-add -l | grep id_custom_git

4. Test Connectivity

bash
# Test SSH connection to the host
ssh -T $GIT_HOST

# Expected output varies by host:
# - GitLab: "Welcome to GitLab, @username!"
# - Generic: "PTY allocation request failed on channel 0" (still success if no permission error)
# - Success indicator: exit code 0 or 1 (but not 255 for network issues)

if [ $? -eq 255 ]; then
  echo "SSH connection failed - likely network/host issue"
elif [ $? -eq 1 ]; then
  echo "SSH connected but shell access restricted (normal for Git hosts)"
else
  echo "SSH connection successful"
fi

Troubleshooting Common Issues

A. Hostname Resolution Problems

If you get: ssh: Could not resolve hostname HOST: nodename nor servname provided, or not known

Solutions:

  1. Check VPN connection - Ensure VPN is active if host is internal
  2. Test DNS resolution:
    bash
    dig $GIT_HOST +short
    nslookup $GIT_HOST
    host $GIT_HOST
  3. Temporary /etc/hosts fix (if you have IP):
    bash
    # Get IP from user or network admin
    echo "IP_ADDRESS $GIT_HOST" | sudo tee -a /etc/hosts > /dev/null
  4. Check alternative hostname - Maybe there's an internal DNS name

B. Connection Timeout/Network Issues

If you get: ssh: connect to host HOST port PORT: Connection timed out or Operation timed out

Solutions:

  1. Verify VPN is active and allows traffic to target host/port
  2. Test port connectivity:
    bash
    nc -z $GIT_HOST $GIT_PORT && echo "Port open" || echo "Port blocked/unreachable"
  3. Check firewall settings on both client and server sides
  4. Try with verbose mode to see where it fails:
    bash
    ssh -v -T $GIT_HOST

C. Authentication Failures

If you get: Permission denied (publickey) or similar auth errors

Solutions:

  1. Verify key is loaded: ssh-add -l should show your key
  2. Check key permissions: chmod 600 ~/.ssh/id_custom_git
  3. Confirm public key is added to host (GitLab/Gitea settings → SSH Keys)
  4. Check for multiple identities: Try specifying key explicitly:
    bash
    ssh -i ~/.ssh/id_custom_git -T $GIT_HOST
  5. Verify SSH config is correct: ssh -G $GIT_HOST | grep -E "(hostname|user|port|identityfile)"

D. Host Key Verification

If you get: The authenticity of host '[HOST]:PORT ([IP]:PORT)' can't be established.

Normal on first connection - verify host key fingerprint with admin, then:

bash
ssh-keyscan -p $GIT_PORT $GIT_HOST >> ~/.ssh/known_hosts

Verification Steps

After setup, verify everything works:

bash
# 1. SSH config test
ssh -G $GIT_HOST | grep -E "(hostname|user|port|identityfile)"

# 2. Key loading test
ssh-add -l | grep id_custom_git

# 3. Connection test
ssh -T $GIT_HOST

# 4. Git test (if you have a repo URL)
# Replace with actual repo path
git ls-remote ssh://$GIT_HOST:${GIT_PORT:-22}/~$GIT_USER/test-repo.git

Usage Examples

Example 1: Standard GitLab on Custom Port

bash
GIT_HOST="dev.fas-8.com"
GIT_PORT="9874"
GIT_USER="git"

Example 2: Self-hosted Gitea

bash
GIT_HOST="git.internal.company.com"
GIT_PORT="2222"  # common alternative
GIT_USER="git"

Example 3: VPN-only Host with /etc/hosts workaround

bash
# After getting IP from network admin:
GIT_HOST="gitlab.vpn.internal"
GIT_IP="10.15.20.5"
# Add to /etc/hosts: sudo sh -c "echo \"$GIT_IP $GIT_HOST\" >> /etc/hosts"

Integration with Git Workflows

Once SSH is working, use standard git commands:

bash
# Clone
git clone ssh://$GIT_HOST:${GIT_PORT:-22}/$GIT_USER/repo-name.git

# Or if using SSH config host alias:
git clone $GIT_HOST:$GIT_USER/repo-name.git

# Standard git push/pull/fetch will use the SSH config automatically

Cleanup / Key Management

To remove this host configuration later:

  1. Remove host block from ~/.ssh/config
  2. Remove key from ssh-agent: ssh-add -d ~/.ssh/id_custom_git
  3. Optionally delete key files: rm ~/.ssh/id_custom_git*
  4. Remove from known_hosts if needed: ssh-keygen -R $GIT_HOST -p $GIT_PORT

Поширені запитання

Що робить навичка ШІ Git Ssh Custom Host?

Set up SSH authentication for custom Git hosts (non-standard ports, custom domains, VPN-dependent hosts) with verification workflow and troubleshooting for common connectivity issues.

Навіщо використовувати Git Ssh Custom Host у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Git Ssh Custom Host — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Git Ssh Custom Host у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/adityahimaone/hermes-agent-rtk-caveman/tree/main/skills/devops/git-ssh-custom-host. TypingMind прочитає файл SKILL.md і встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Git Ssh Custom Host?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Git Ssh Custom Host?

Зі скількома забажаєте. Якщо модель підтримує навички, ви можете використовувати з нею Git Ssh Custom Host — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama та інші — усе в TypingMind із власними ключами API.

Чи безкоштовна навичка ШІ Git Ssh Custom Host?

Так. Навичку опубліковано на GitHub: adityahimaone, за ліцензією MIT. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це багаторазовий набір інструкцій, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти для виклику — код, який десь виконується й повертає результат. Натомість навичка ШІ надає моделі знання та порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний ШІ-простір уже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇