XWLinux

SSH config — 5 minut do wygodnego SSH

Productivity 2024-10-25

SSH config (~/.ssh/config) — aliasy dla serwerów.

Format: Host n355 HostName 192.168.1.246 User ai Port 22 IdentityFile ~/.ssh/id_ed25519

Host larva HostName 192.168.1.230 User ai Port 1122

Host docker HostName 192.168.1.231 User ai

Host * AddKeysToAgent yes UseKeychain no IdentityFile ~/.ssh/id_ed25519 ServerAliveInterval 60 Compression yes

Użycie: - ssh n355 (zamiast ssh ai@192.168.1.246) - scp file.txt n355:/tmp/ - rsync -avz dir/ n355:dir/ - sftp n355

Ciekawostka: ProxyJump (dawniej ProxyCommand) — ssh -J gateway n355 (przez gateway). ~/.ssh/config.d/ (drop-in). ssh-agent + ssh-add — klucze w pamięci.