5 ms·
Yes, just set up a localforward in your .ssh/config like this: Host dev HostName <ip_of_dev_box> User <my_username> ForwardAgent ye
by tbrock 6y ago
Yes, just set up a localforward in your .ssh/config like this:
Host dev
HostName <ip_of_dev_box>
User <my_username>
ForwardAgent yes
AddKeysToAgent yes
IdentityFile ~/.ssh/id_m1_air
LocalForward 8443 localhost:8443
LocalForward 8080 localhost:8080
LocalForward 8065 localhost:8065
LocalForward 3000 localhost:3000
...
Those line's effectively mean forward my local port 8443 to the remote host's 8443. The local port + remote port (and even the remote host) don't need to be the same.
Since it’s forwarding a TCP port your aren’t limited to forwarding just the web traffic either. I forward:
- Database ports (run mysql or psql locally for example)
- Docker socket
- Backend api ports
- Redis port
- Webserver port
And more...
Then you just use local clients as if those things were all running on your local machine
- tga 6y agoJust one more step missing for a fully remote docker setup: have you ever tried combining this with a sshfs mount so you can also develop an app running in a remote container?
- tbrock 6y agoMaybe I'll try that
- jokethrowaway 6y agoVisual Studio has [this](https://code.visualstudio.com/docs/remote/ssh https://code.visualstudio.com/docs/remote/ssh) which is quite painless to use
- ataylor32 6y agoThanks! This sounds like a great setup.