Skip to main content

Bypass blocked ports with Reverse SSH Tunneling

Most organisations have security rules that stop non-standard ports on external resources from being accessed from the corporate network.

One frequent scenario is when you are running a website on a non-standard port (e.g., 5000) on AWS EC2 (e.g., 52.131.143.12and you try to call it from your corporate network. In most cases, if you open your browser and try to access http://52.131.143.12:5000the site won't load despite having the port open on AWS EC2 Security Group.

To overcome this limitation you can use Reverse SSH Tunneling the following way:

  1. Open a terminal and navigate to the folder where you have your PEM key to connect to AWS EC2
  2. Type ssh -i your_key.pem -NL LOCAL_PORT:localhost:REMOTE_PORT ec2_user@xxx.xxx.xxx.xxx (e.g., ssh -i your_key.pem -NL 8080:localhost:5000 ec2-user@52.131.143.12).
  3. Leave the terminal open with the SSH command running. Open on your browser and type http://localhost:LOCAL_PORT (e.g., http://localhost:8080). The website will load.


Popular posts from this blog

How to jump to time offsets in HTML5 video

Let's say that you have a 30-minute WEBM video file, from which you just want to play the following video segments , jumping from one to the other automatically  without interruptions : [00:01:25.00 - 00:02:25.00] -> from second 85 to 145 [00:11:40.00 - 00:11:55.00] -> from second 700 to 715 [00:20:26.00 - 00:21:07.00] -> from second 1226 to 1267 [00:26:11.00 - 00:28:01.00] -> from second 1571 to 1681 To increase the complexity, let's think that you have these video segments in a PHP variable $arrayVideoSegments  (normally the case if they were retrieved from the database).   $arrayVideoSegments[0]->startTime = 85   $arrayVideoSegments[0]->endTime = 145   $arrayVideoSegments[1]->startTime = 700   $arrayVideoSegments[1]->endTime = 715   $arrayVideoSegments[2]->startTime = 1226   $arrayVideoSegments[2]->endTime = 1267   $arrayVideoSegments[3]->startTime = 1571   $arrayVideoSegments[3]->endTime = 1681 The

The Ethics Canvas

In 2008, Alexander Osterwalder presented an innovative tool called " Business Model Canvas " (BMC) that aimed to help entrepreneurs to capture the fundamental business knowledge about their project, and bring about pivots in order to make the business model more consistent and successful.  Since then, the BMC has helped over 5 million entrepreneurs increase the value that they provide to their users, and find a sustainable model. In 2015, a group of researchers from ADAPT Centre  started using a similar approach in order to detect at early stage all the ethical implications of a project, and help entrepreneurs and researchers pivot their idea in order to minimise these issues. If you think about new technologies such as biotech, AI, IoT, VR, biometrics, blockchain, 3D printing,... they all bring great advancements for humanity, but they have some potential ethical issues that could have a catastrophic impact. After some months of hard work and experiments, we h

El Lean Canvas, explicado paso a paso

Tengo el honor de ser profesor del curso Startup Innovation Lab , del Plan de Empleo para la Educación Superior , en el que jóvenes canarios en situación de desempleo descubren las principales técnicas de emprendimiento siguiendo la metodología Lean Startup . Dado que no hay muchos ejemplos prácticos y en español sobre cómo completar el Lean Canvas , he creado un vídeo de 14 minutos en el que se explica, paso a paso, cómo completar el canvas utilizando Spotify como producto de ejemplo. Éste es el canvas resultante. Espero que sea de utilidad al igual que lo está siendo para mis alumnos.