Surfen über sichere SSH Verbindung
Es gibt Momente in denen vorherrschenden Netzwerkumgebungen nicht vertraut werden kann bzw. will (z.B. wenn man über einen unverschlüsselten WLAN Hotspot suft, so wie ich gerade
) , in solchen Momenten bietet sich (fast) immer SSH an
.
SSH hat einen “eingebauten” SOCKS Proxy der sehr Trivial zu bedienen ist:
$ ssh -N -C -D port user@zielrechner
In meinem Wahlbrowser kann ich nun einfach einen SOCKS Proxy definieren.
Im Firefox kann ich das z.B. so tun:
Edit -> Preferences -> Advanced -> Network -> Settings -> Manual Proxy Configuration
Als SOCKS Proxy trage ich nun “localhost” bzw “127.0.0.1″ und als Port denselben wie oben.
Ich kann euch auch das Firefox Plugin “SwitchProxy” empfehlen dadurch wird das proxywechseln (vor allem wenn wir diese öfters wechseln
) zum Kinderspiel!
Das tolle daran ist, das SSH ersten ein Standardtool ist und somit auf sehr vielen Linuxen/Unixen installiert ist, zweitens lange Konfigurationsorgien entfallen wenn mal fix ein SOCKS Proxy benötigt wird :) .
Legende:
-D [bind_address:] port
Specifies a local “dynamic” application-level port forwarding. This works
by allocating a socket to listen to port on the local side, optionally bound
to the specified bind_address. Whenever a connection is made to this port,
the connection is forwarded over the secure channel, and the application
protocol is then used to determine where to connect to from the remote machine.
Currently the SOCKS4 and SOCKS5 protocols are supported, and ssh will act as a
SOCKS server. Only root can forward privileged ports. Dynamic port forwardings
can also be specified in the configuration file.
IPv6 addresses can be specified with an alternative syntax:
[bind_address/] port or by enclosing the address in square brackets. Only
the superuser can forward privileged ports. By default, the local port is
bound in accordance with the GatewayPorts setting. However, an explicit
bind_address may be used to bind the connection to a specific address. The
bind_address of “localhost” indicates that the listening port be bound for
local use only, while an empty address or ‘*’ indicates that the port should
be available from all interfaces.
-C Requests compression of all data (including stdin, stdout, stderr, and data
for forwarded X11 and TCP connections). The compression algorithm is the same
used by gzip(1), and the "level" can be controlled by the CompressionLevel
option for protocol version 1. Compression is desirable on modem lines and
other slow connections, but will only slow down things on fast networks. The
default value can be set on a host-by-host basis in the configuration files;
see the Compression option.
-N Do not execute a remote command. This is useful for just forwarding ports
(protocol version 2 only).



July 15th, 2008 at 2:44 pm
SSH ist einfach nur geil. Ich wusste zwar, dass es eine eierlegende Wollmilchsau ist. Aber das sie Ihren Käse und die Omletts und Pullis selber macht war mir auch teilweise noch nicht so bewusst.
Saufette Sache
July 16th, 2008 at 8:59 am
Mhh ja, ich wollte die Verbindung zuerst über ein Squid durch einen SSH Tunnel routen (Squid deshalb weil er ganz komfortabel auch meine DSN abfragen durch den SSH Tunnel jagen sollte). Naja ein bissel man Pages gelesen
und auf diese Lösung gestoßen.
PS: hab ne “hostinfo” eingebaut