#!/usr/bin/env bash
# buat-config.sh — bangun ulang ~/.ssh/config contoh untuk blok latihan.
# Dipanggil di awal tiap blok karena setiap blok latihan berdiri sendiri.
set -e
mkdir -p ~/.ssh
chmod 700 ~/.ssh
cat > ~/.ssh/config <<'EOF'
Host server-kantor
    HostName 192.0.2.10
    User budi
    Port 2222
    IdentityFile ~/.ssh/id_ed25519

Host backup
    HostName 198.51.100.20
    User siti
    IdentityFile ~/.ssh/id_backup
    ProxyJump server-kantor

Host pi-arsip
    HostName 192.0.2.20
    User budi
    IdentityFile ~/.ssh/id_ed25519

Host *
    ServerAliveInterval 60
EOF
chmod 600 ~/.ssh/config
