Created
November 18, 2023 20:32
-
-
Save szydan/c176be43cd5a1caaf069a229f82b94a9 to your computer and use it in GitHub Desktop.
Forward port
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To connect to a service on a remote server that does not have its port exposed to the network. | |
For example, to connect to an elasticsearch back end to an investigate demo, incant the following: | |
ssh -L 9200:localhost:9200 -Nf username@remote.host | |
You can then connect to localhost:9200 and it will be forwarded to localhost:9200 on the remote machine. | |
In general, the argument to -L is of the form: | |
local-port:hostname:remote-port | |
Note that the hostname is resolved from the remote machine's point of view, and so is usually localhost. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment