Skip to content

Instantly share code, notes, and snippets.

@PatelUtkarsh
Created October 11, 2021 06:15
Show Gist options
  • Save PatelUtkarsh/e1c134cb652732b1b58fb4a0c84ba1a7 to your computer and use it in GitHub Desktop.
Save PatelUtkarsh/e1c134cb652732b1b58fb4a0c84ba1a7 to your computer and use it in GitHub Desktop.
ssh config to foward remote port over ssh - create new or append on .ssh/config
Host dockerServer
Hostname server-host-or-ip
User ssh-remote-user
LocalForward 8088 localhost:8088
LocalForward 3306 localhost:3306
ServerAliveInterval 10
@PatelUtkarsh
Copy link
Author

PatelUtkarsh commented Oct 11, 2021

To connect docker client to remote:

export DOCKER_HOST=ssh://user@server-ip

Test with:

docker run hello-world

To open tunnel:

ssh dockerServer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment