Skip to content

lbernardomaia/docker-ssh-tunnel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Docker SSH Tunnel

This docker image provides a simple SSH tunnelling to connect to a remote server and keep the connection alive while the image is running.

How to use

Mysql:

docker run -it --rm \
-e LOCAL_PORT=3306 \
-e DESTINATION_SERVER=dababase.rds.amazonaws.com \
-e DESTINATION_PORT=3306 \
-e SSH_USER=YOUR_USER \
-e SSH_BASTION_HOST=your.bastion.service.com \
-v ~/.ssh/id_rsa:/root/.ssh/id_rsa:ro  \
-p 3306:3306 ssh-tunnel

To connect : mysql --host=localhost --user=myname --password=password

Others:

Other databases should work similarly, changing just the ports to use the database correspondent port. For example:

  • PostgreSQL: 5432
  • MongoDB: 27017

Dockerhub:

https://hub.docker.com/r/lbernardomaia/ssh-tunnel

About

Simple Docker SSH tunnelling to connect to a remote server

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published