Total fichiers créés: 20
Documentation: 8 fichiers (62 KB)
Configuration: 9 fichiers (6.5 KB)
Clés SSH: 4 fichiers (1.0 KB)
Total: ~69.5 KB
sshproxy-lab/
│
├── 📋 ORCHESTRATION
│ └── docker-compose.yaml 884 bytes
│
├── 📚 DOCUMENTATION (à lire dans cet ordre)
│ ├── PLAN_DE_LECTURE.md 6905 bytes ← COMMENCER ICI
│ ├── SYNTHESE_COMPLETE.md 10103 bytes ← VUE D'ENSEMBLE
│ ├── ELI5_EXPLICATION.md 6329 bytes ← SIMPLIFIÉE
│ ├── QUICK_REFERENCE.md 10827 bytes ← DIAGRAMMES
│ ├── DOCUMENTATION_COMPLETE.md 17275 bytes ← ULTRA-DÉTAILLÉ
│ ├── RESOLUTION_RAPPORT.md 4681 bytes ← DEBUGGING
│ └── INDEX_FICHIERS.md 9766 bytes ← REFERENCE
│
├── 🔐 GATEWAY (proxy SSH)
│ ├── Dockerfile 3580 bytes ← Build multi-stage
│ ├── sshd_config 702 bytes ← ForceCommand crucial!
│ ├── sshproxy.yaml 751 bytes ← -tt crucial!
│ └── sshproxy-wrapper.sh 367 bytes ← Wrapper shell
│
├── 🖥️ DESTINATIONS (SSH normal)
│ ├── Dockerfile 832 bytes ← Build simple
│ └── sshd_config 459 bytes ← SSH normal
│
└── 🔑 AUTHENTIFICATION
├── lab_rsa 411 bytes ← Clé Windows privée
├── lab_rsa.pub 102 bytes ← Clé publique
├── gateway_rsa 419 bytes ← Clé gateway privée
└── gateway_rsa.pub 108 bytes ← Clé publique
| Fichier | Taille | Temps lecture | Priorité |
|---|---|---|---|
| PLAN_DE_LECTURE.md | 6.9 KB | 5 min | ⭐⭐⭐ |
| SYNTHESE_COMPLETE.md | 10.1 KB | 10 min | ⭐⭐⭐ |
| QUICK_REFERENCE.md | 10.8 KB | 10 min | ⭐⭐⭐ |
| ELI5_EXPLICATION.md | 6.3 KB | 7 min | ⭐⭐ |
| DOCUMENTATION_COMPLETE.md | 17.3 KB | 30 min | ⭐⭐ |
| RESOLUTION_RAPPORT.md | 4.7 KB | 5 min | ⭐ |
| INDEX_FICHIERS.md | 9.8 KB | 15 min | ⭐ |
| Total | 65 KB | ~2h | - |
docker-compose.yaml
├── Service gateway → gateway/Dockerfile
├── Service dest1 → dest/Dockerfile
└── Service dest2 → dest/Dockerfile
gateway/
├── Dockerfile (compile sshproxy + installe sshd)
├── sshd_config (ForceCommand = la clé!)
├── sshproxy.yaml (-tt = crucial pour interactivité)
└── sshproxy-wrapper.sh (lance sshproxy)
dest/
├── Dockerfile (SSH normal)
└── sshd_config (pas de ForceCommand)
keys/
├── lab_rsa (privée) → Windows garde
├── lab_rsa.pub → gateway authorized_keys
├── gateway_rsa (privée) → compilée dans gateway image
└── gateway_rsa.pub → dest1/dest2 authorized_keys
✓ Définit 3 services: gateway, dest1, dest2
✓ Réseau privé: 172.30.0.0/24
✓ Port 2222 → gateway:22
✓ Stage 1 (builder): Compile sshproxy v2.1.0
✓ Stage 2 (final): installe sshd + config
✓ Critique: chown testuser /etc/sshproxy/gateway_rsa
✓ PasswordAuthentication no
✓ ForceCommand /usr/sbin/sshproxy-wrapper ← MAGIQUE!
✓ AllowTcpForwarding no
✓ Destinations: [172.30.0.11:22, 172.30.0.12:22]
✓ Route selection: random
✓ Args: "-tt" -i gateway_rsa ← -tt CRUCIAL!
✓ Détecte SSH_ORIGINAL_COMMAND
✓ Lance sshproxy (même pour shell interactif)
✓ Simple: juste openssh-server
✓ Crée testuser
✓ Copie gateway_rsa.pub
✓ SSH normal (pas de ForceCommand)
✓ Accepte gateway_rsa.pub
✓ lab_rsa: Windows → Gateway (vous gardez privée)
✓ gateway_rsa: Gateway → Destinations (compilée dans image)
✓ docker-compose.yaml
✓ gateway/Dockerfile
✓ gateway/sshd_config
✓ gateway/sshproxy.yaml
✓ gateway/sshproxy-wrapper.sh
✓ dest/Dockerfile
✓ dest/sshd_config
✓ keys/lab_rsa + lab_rsa.pub
✓ keys/gateway_rsa + gateway_rsa.pub
= 11 fichiers pour fonctionner!
✓ PLAN_DE_LECTURE.md
✓ SYNTHESE_COMPLETE.md
✓ QUICK_REFERENCE.md
✓ ELI5_EXPLICATION.md
✓ DOCUMENTATION_COMPLETE.md
✓ RESOLUTION_RAPPORT.md
✓ INDEX_FICHIERS.md
= 7 fichiers doc pour comprendre
☐ docker-compose.yaml
└─ 1 fichier (884 bytes)
☐ gateway/
├─ Dockerfile (3580 bytes)
├─ sshd_config (702 bytes)
├─ sshproxy.yaml (751 bytes)
└─ sshproxy-wrapper.sh (367 bytes)
☐ dest/
├─ Dockerfile (832 bytes)
└─ sshd_config (459 bytes)
☐ keys/
├─ lab_rsa (411 bytes)
├─ lab_rsa.pub (102 bytes)
├─ gateway_rsa (419 bytes)
└─ gateway_rsa.pub (108 bytes)
Total: 20 fichiers / 69.5 KB
| Fichier | Pourquoi | Impact |
|---|---|---|
| docker-compose.yaml | Orchestration | Sans: conteneurs isolés |
| gateway/Dockerfile | Build proxy | Sans: pas de sshproxy |
| gateway/sshd_config | ForceCommand | Sans: pas d'interception |
| gateway/sshproxy.yaml | Config proxy | Sans: destinations inconnues |
| keys/lab_rsa.pub | Auth client | Sans: connexion refusée |
| keys/gateway_rsa | Auth gateway | Sans: permission denied |
lab_rsa.pub (102)
gateway_rsa.pub (108)
sshproxy-wrapper.sh (367)
lab_rsa (411)
gateway_rsa (419)
sshd_config dest (459)
sshd_config gateway (702)
sshproxy.yaml (751)
Dockerfile dest (832)
docker-compose.yaml (884)
Dockerfile gateway (3580)
RESOLUTION_RAPPORT.md (4681)
ELI5_EXPLICATION.md (6329)
PLAN_DE_LECTURE.md (6905)
INDEX_FICHIERS.md (9766)
SYNTHESE_COMPLETE.md (10103)
QUICK_REFERENCE.md (10827)
DOCUMENTATION_COMPLETE.md (17275)
| Fichier | Complexité | À comprendre |
|---|---|---|
| docker-compose.yaml | ⭐ | Services + réseau |
| dest/Dockerfile | ⭐ | RUN + COPY basique |
| dest/sshd_config | ⭐ | Config text simple |
| gateway/sshproxy-wrapper.sh | ⭐⭐ | Bash if/else |
| gateway/sshd_config | ⭐⭐ | Config texte + ForceCommand |
| gateway/sshproxy.yaml | ⭐⭐ | YAML + structure |
| gateway/Dockerfile | ⭐⭐⭐ | Multi-stage + Go build |
| keys/* | ⭐ | Fichiers binaires (génération ok) |
| DOCUMENTATION_COMPLETE.md | ⭐⭐⭐ | Complexe mais optionnel |
✓ docker compose config # Valide syntax
✓ docker compose up -d # Lance 3 conteneurs
✓ docker ps # 3 en running
✓ docker compose build --no-cache
✓ docker images | grep sshproxy
✓ docker exec sshproxy-gateway sshproxy --version
✓ ssh -p 2222 localhost # Connexion acceptée
✓ docker exec sshproxy-gateway sshd -t # Syntax valide
✓ docker exec sshproxy-gateway cat /etc/sshproxy/sshproxy.yaml
✓ sshproxy -help # Binaire exécutable
✓ ssh-keygen -l -f keys/lab_rsa # Clé valide
✓ ssh-keygen -l -f keys/gateway_rsa # Clé valide
11 fichiers de config → Proxy SSH transparent
7 fichiers de doc → Pour comprendre
2 points critiques:
ForceCommand dans sshd_config-tt dans sshproxy.yamlTotal d'effort: ~30 min pour reproduire + 2h pour maîtriser