From 3c98a362270f7bbed47d735c181774e962f5a027 Mon Sep 17 00:00:00 2001 From: Akemi Izuko Date: Sat, 23 Dec 2023 20:13:56 -0700 Subject: [PATCH] Update ssh port forwarding notes --- notes/shell/ssh_port_forwarding.md | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/notes/shell/ssh_port_forwarding.md b/notes/shell/ssh_port_forwarding.md index b88c47e..2881b8f 100644 --- a/notes/shell/ssh_port_forwarding.md +++ b/notes/shell/ssh_port_forwarding.md @@ -1,5 +1,26 @@ # SSH port forwarding +Local port forwarding allows ssh to connect one of your ports to the +destination's port. This is particularly useful for localhosted websites, which +you can run on the host and access on your machine + +Some key terms: +``` + = Port on the machine you're using to ssh. Ex: laptop + = Port on the machine running sshd + = URL of machine running the sshd, which you're logging onto + = Name relative to the host machine who's port the host forwards +``` + +The opens an ssh tunnel without obstructing the current terminal: +```bash ssh -p10011 -NL 7000:localhost:8080 emiliko@localhost & -Opens an ssh tunnel without obstructing the current terminal. Syntax for the -tunnel looks like: - : + ssh -NL :: @ & +``` + +# In config file +The syntax in the config is quite similar + +```ssh + LocalForward 8001 localhost:7000 + LocalForward : +```