1
0
mirror of https://github.com/tiyn/wiki.git synced 2025-10-09 09:27:53 +02:00

linux/ssh: added guide to kill port tunnel

This commit is contained in:
tiyn 2025-09-22 01:52:54 +02:00
parent 7361fd9330
commit aa3bc74f1d

View File

@ -137,5 +137,20 @@ it is running at.
ssh -f -N -L <local port>:<local address>:<port of service> <address of server> ssh -f -N -L <local port>:<local address>:<port of service> <address of server>
``` ```
After running the command the tunnel will stay established until the process is killed.
This can be done by running a command identical or similar to the following which is used to find
the process.
```sh
ps aux | grep "ssh -f -N -L <local port>"
```
Afterwards it can be killed by running the follwing command where `<process-id>` is the id of the
process found with the previous command.
```sh
kill <process-id>
```
Files that are based on a remote server can be mounted as described in Files that are based on a remote server can be mounted as described in
[the corresponding section](#mount-directory-with-sshfs) to setup complete remote development. [the corresponding section](#mount-directory-with-sshfs) to setup complete remote development.