[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ssh Port Forwarding



* On 24.05. Thorsten Schmitz (Debian_Mailingliste@web.de) muttered:

> Jedes mal wenn ich den Befehl ssh ?L 4712:RemoteHost:80  eingebe kommt
> nur
> die Parameterliste vom ssh Befehl.

<man ssh>
SYNOPSIS
[...]
     ssh [-afgknqstvxACNTX1246] [-b bind_address]
         [-c cipher_spec] [-e escape_char]
         [-i identity_file] [-l login_name]
         [-m mac_spec] [-o option] [-p port]
         [-F configfile] [-L port:host:hostport]
         [-R port:host:hostport] [-D port] hostname |
         user@hostname [command]
[...]
     -L port:host:hostport
             Specifies that the given port on the local
             (client) host is to be forwarded to the given
             host and port on the remote side.  This works by
             allocating a socket to listen to port on the
             local side, and whenever a connection is made to
             this port, the connection is forwarded over the
             secure channel, and a connection is made to host
             port hostport from the remote machine.  Port for-
             wardings can also be specified in the configura-
             tion file.  Only root can forward privileged
             ports.  IPv6 addresses can be specified with an
             alternative syntax: port/host/hostport
</man ssh>

Also:

dein_rechner <----> rechner_A <----> rechner_B

$ ssh -L lokaler_port:rechner_B:remote_port dein_account@rechner_A


Beispiel: Nach

$ ssh -L 12345:rechner_B:25 dein_account@rechner_A

kannst Du Dich über

$ telnet localhost 12345

mit rechner_B über SMTP unterhalten.

> Bleibt der Tunnel für
> immer
> eingetragen (auch nach einem Reboot)?

Nein.

> Wie kann man diesen wieder
> beenden?

Du bekommst auch bei einem Port-Forward eine normale Shell. Also
sagst Du einfach:

dein_account@rechner_A $ logout

HTH
Til



Reply to: