If you’re doing some development on a remote server that you access via a bastion host (e.g., an EC2 instance), and you want a seamless way to work from a Chromebook, you can set up an SSH tunnel through the bastion host to access your development server.
This guide outlines how to configure a secure and efficient development workflow using Docker, SSH tunnels, and a Chromebook.
Your Chromebook is a great development environment, but truth be told, the cloud is better. Why? Because you can leverage a bucket load of functionality, resources and infrastructure that is powerful yet inexpensive. Did I mention backups? My Chromebook running a version of debian rocks, but in general I use it as a conduit to the cloud.
So here’s the best of both worlds. I can use a kick-butt terminal
(terminator
) on my Chromie and use its networking mojo to access my
web servers running in the cloud.
In this setup:
Here’s what it looks like in ASCII art…
+--------------+ +--------------+ +--------------+
| Chromebook | | Bastion Host | | EC2 |
| | 22 | | 22 | |
| Local SSH |----| Jump Box |----| Development |
| Tunnel:8080 | 80 | (Accessible) | 80 | Server |
+--------------+ +--------------+ +--------------+
To create an SSH tunnel through the bastion host:
bash
ssh -N -L 8080:EC2_PRIVATE_IP:80 user@bastion-host
-N
: Do not execute remote commands, just forward ports.-L 8080:EC2_PRIVATE_IP:80
: Forwards local port 8080 to port 80 on the development server (EC2 instance).user@bastion-host
: SSH into the bastion host as user
.Once connected, any request to localhost:8080
on the Chromebook will
be forwarded to port 80 on the EC2 instance.
To maintain the tunnel connection automatically:
~/.ssh/config
):Host bastion
HostName bastion-host
User your-user
IdentityFile ~/.ssh/id_rsa
LocalForward 8080 EC2_PRIVATE_IP:80
ServerAliveInterval 60
ServerAliveCountMax 3
ssh -fN bastion
curl -I http://localhost:8080
You should see a response from your EC2 instance’s web server.
If your EC2 instance runs a Dockerized web application, expose port 80 from the container:
docker run -d -p 80:80 my-web-app
Now, accessing http://localhost:8080
on your Chromebook browser will
open the web app running inside the Docker container on EC2.
This setup allows you to securely access a remote development environment from a Chromebook, leveraging SSH tunneling through a bastion host.
localhost:8080
) to a remote web app.Now you can develop on remote servers with a Chromebook, as if they were local!
Next post: How to Fix Apache 2.4 Broken Directory Requests
Previous post: OrePAN2: :S3 Release Announcement