Ssh jump-host

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen

Prinzip

  • host sieht ns nicht
  • host sieht fw
  • fw sieht ns
  • host springt über fw zu ns

Auf dem Host eintragen

  • cat ~/.ssh/config
Host fw
 Hostname 192.168.HS.2XX
 User kit   
 
Host ns
    Hostname 10.88.2XX.21
    User kit
    ProxyJump fw

Host www
    Hostname 10.88.2XX.11
    User kit
    ProxyJump fw

SSH key generieren

Auf dem host
  • ssh-keygen
  • ssh-copy-id fw
danach
  • ssh-copy-id ns

Einlogen vom Host

  • ssh ns

Voraussetzung

Auf dem Jump Host muss folgendes in der /etc/ssh/sshd_config aktiv sein.

AllowTcpForwarding yes

Manuell ohne Konfigurationsdatei

  • ssh -J kit@192.168.10.213:6666 kit@10.88.213.21