SSH Tunnel
Original post provide by php-BloggerIch möchte für meinen Arbeitgeber an einem Projekt von zu Hause aus arbeiten. Auf meiner Linux Workstation in der Arbeit ist das Java basierte Web-Framework inkl. dem Tomcat als Application Server installiert. Zugriff auf meine Linux Workstation habe ich dort über einen Gate Server an dem ich mich anmelde und von dem aus ich dann auf meine Workstation gelange. Da ich über den Gate Server keine Tunnelverbindung aufmachen kann und will, muss eine andere Lösung her.
Zu Hause verbinde ich mich über eine fritzbox fon ins Internet. Über die fritzbox sind SSH Tunnelverbindungen auch nicht so ohne weiteres möglich. Glücklicherweise gibt es eine Lösung für das Problem:
Mit Hilfe der hervorragenden Anleitung auf der Seite tecchannel.de habe ich mir zunächst auf meiner fritzbox einen SSH Server installiert, sodass ich mich von aussen per SSH mit meiner fritzbox verbinden kann.
Wenn das funktioniert, kann ich nun einen SSH Tunnel von meiner Workstation in der Arbeit auf meinen Rechner zu Hause aufmachen. Das funktioniert über einen “Local Port Forward” mit Hilfe des folgenden Befehls:
ssh -f -N -L 2222:192.168.xxx.xxx:22 root@externe-ip-fritzbox
| -f | Bewirkt, dass SSH als Hintergrunsprozess gestartet wird und somit das Terminal nicht von SSH blockiert wird |
| -N | Bewirkt, dass kein Befehl auf dem Verbundenen Server ausgeführt wird, denn das ist bei lediglich einer Port Weiterleitung nicht erforderlich. |
| -L | Lokale Port Weiterleitung: Alle Anfragen an den Port ‘2222′ auf der Linux Workstation in der Arbeit (von der aus ich diese Kommandos absetze) werden durchgereicht - und zwar an Port ‘22′ des über die IP Adresse spezifizierten Rechners in meinem lokalen Netz zu Hause. Die IP Adresse 192.168.xxx.xxx ist tatsächlich die Adresse, über die mein Rechner zu Hause der fritzbox bekannt ist. |
| Als letzter Parameter wird der Login und die IP Adresse angegeben unter der mein Heimnetz im Internet erreichbar ist. |
Nun wäre ein SSH-Tunnel zwischen meiner Workstation in der Arbeit und meinem Rechner zu Hause aufgebaut. Per ’ssh -p 2222 username@localhost’ sollte man sich nun auf den Rechner zu Hause per SSH anmelden können (beispielsweise zum Test der Verbindung). Die fritzbox wird dadurch praktisch “untertunnelt”.
Anschliessend kann über diesen bestehenden SSH Tunnel ein sogenannter “Remote Port Forward” eingerichtet werden. Damit ich von zu Hause aus via “http://localhost:8080/” über meinen Browser auf den Tomcat in der Arbeit zugreifen kann, gebe ich folgenden Befehl (wiederum auf der Linux Workstation in der Arbeit) ein:
ssh -p 2222 -f -N -R 8080:localhost:8080 harald@localhost
| -p | Bewirkt, dass SSH den Port ‘2222′ für die Verbindung verwendet - das ist mein Tunnel, also die direkte Verbindung zu meinem Rechner zu Hause |
| -f | Bewirkt, dass SSH als Hintergrunsprozess gestartet wird und somit das Terminal nicht von SSH blockiert wird |
| -N | Bewirkt, dass kein Befehl auf dem Verbundenen Server ausgeführt wird, denn das ist bei lediglich einer Port Weiterleitung nicht erforderlich. |
| -R | Remote Port Weiterleitung: Der SSH Server auf meinem Rechner lokal zu Hause öffnet den Port 8080 für Verbindungen zurück zu meinem Rechner in der Arbeit. D.h. alle Anfragen an localhost:8080 von meinem Rechner zu Hause aus werden an meine Workstation in der Arbeit ebenfalls an Port 8080 durchgereicht. |
| Als letzter Parameter wird der Name des Useraccounts auf meinem Rechner zu Hause, jedoch der Hostname “localhost” angegeben (da ich mich wie weiter oben ja schon beschrieben, per ’ssh harald@localhost’ direkt von der Workstation in der Arbeit auf meinem Rechner zu Hause einloggen kann. |
Die Eingabe von “http://localhost:8080/” in meinen Browser zu Hause sollte mir nun die altbekannte Startseite des Tomcat in der Arbeit liefern.
Previous Articles:Flip A Web Site Fixer-upper
Want to buy and sell web sites for profit? In this practical guide, experienced site flipper Peter steps through the process, providing tips to keep you from the common pitfalls, and showing how to add value that translates to real profits when you sell.
Easy Reflections V3
This version brings about some significant advances, including full support for PNG alpha transparency in the source image, alpha transparency in the output image allowing for overlaying the mirrored images on-top of complex backgrounds or gradients, and colour tinting / saturation support.
PHP 5.2.2 And PHP 4.4.7 Released
Details about the PHP 4.4.7 release can be found in the release announcement for 4.4.7, the full list of changes is available in the ChangeLog for PHP 4. Security Enhancements and Fixes in PHP 5.2.2 and PHP 4.4.7:Fixed CVE-2007-1001, GD wbmp used with invalid image size (by Ivan Fratric)Fixed asciiz byte truncation inside mail() (MOPB-33 by Stefan Esser)Fixed a bug in mb_parse_str() that can be used to activate register_globals (MOPB-26 by Stefan Esser)Fixed unallocated memory access/double free in in array_user_key_compare() (MOPB-24 by Stefan Esser)Fixed a double free inside session_regenerate_id() (MOPB-22 by Stefan Esser)Added missing open_basedir & safe_mode checks to zip:// and bzip:// wrappers.
Browserfarm
Browserfarm zum Testen von Web Seiten mit folgenden Browsern: Internet Explorer 7.0 Internet Explorer 6.0 Internet Explorer 5.5 Internet Explorer 5.0 Firefox 3.0a (Nightly Build) Firefox 2.0 Firefox 1.5 (JRE 1.5) Firefox 1.5 (JRE 1.4) Firefox 1.0 Konqueror 3.5 Opera 9.0 elinks 0.10
Easy Reflections V2
I have updated my Easy Reflections code and released v2. Thanks to feedback and some code from Monte Ohrt (co-developer of Smarty) he added in cache support and fixed a banding issue with the alpha levels. It all works really nicely now - and the new version, with the new docs are available at http://reflection.corephp.co.uk.
More Articles:
Screen Capture Software
Record your screen, PowerPoint, multiple audio tracks, and webcam video to create compelling videos without ever leaving your desk. Show to anyone, anywhere - accessible 24/7. Deliver high-quality content to even your most remote audience. Download Camtasia Studio now!
The Principles Of Beautiful Web Design
and break when you look at your own? You don't need to go to art school to create those sweet designs, as Jason explains. Read his hands-on tour of the underlying concepts of web page layout and composition today, and you'll be designing professional-level, great-looking web pages tomorrow!
Delphi For PHP 2007
Title: Delphi for PHP 2007 Reviewer: Manuel Lemos Category: Development tools Publisher: Borland, CodeGear Summary: For a first version of this PHP IDE, I think Borland/CodeGear did very well, but there is plenty of room for improvement. If you have been a big fan of Delphi for Windows desktop applications, you will certainly love Delphi for PHP.
Build A Photo Gallery Using CakePHP And Flickr
Is the Flickr interface doing justice to your stunning snaps? It's time to consider customization! Jonathan shows us the ropes in his hands-on tutorial, as he uses CakePHP and the Flickr API to build an attractive, fully customized gallery that displays Flickr photos to their best advantage.
Anurag Agarwal's Reflections
The result is a big collection of web application security resources. He has posted a reflection on me this week. It reminds me how behind I am on posting articles and hopefully gives me the kick I need to catch up.