Add SSH port forwarding
This commit is contained in:
parent
c7c9080553
commit
fd1c6f3f01
2 changed files with 25 additions and 1 deletions
23
docs/Miscellaneous/ssh-port-forwarding.md
Normal file
23
docs/Miscellaneous/ssh-port-forwarding.md
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# SSH Port Forwarding
|
||||||
|
|
||||||
|
## Local port forwarding
|
||||||
|
|
||||||
|
This sends the traffic to the host you're SSHing into, e.g. accessing a service on a remote server.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ssh -L <local-port>:localhost:<remote-port> <user>@<server>
|
||||||
|
```
|
||||||
|
|
||||||
|
Or to forward that port to a different host *through* the SSH server:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ssh -L localhost:<local-port>:<different-host>:<remote-port> <user>@<server>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Remote port forwarding
|
||||||
|
|
||||||
|
This send the traffic from the SSH server to your local machine, e.g. running a web server on your local machine and making it accessible from the server.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ssh -R <remote-port>:localhost:<local-port> <user>@<server>
|
||||||
|
```
|
|
@ -8,3 +8,4 @@
|
||||||
*[Jellyfin]: A FOSS media server software
|
*[Jellyfin]: A FOSS media server software
|
||||||
*[Docker]: A popular containerization platform
|
*[Docker]: A popular containerization platform
|
||||||
*[Podman]: A FOSS drop-in replacement for Docker
|
*[Podman]: A FOSS drop-in replacement for Docker
|
||||||
|
*[SSH]: Secure Shell - a protocol for secure remote shell access
|
Loading…
Reference in a new issue