I have a sshfs/fuse mounted folder and 2 local port forwarding in the background.
From this post:
How to clear local ssh port for forwarding to remote?
With this command i see only my mounted sshfs/fuse folder not the local port forwarding connection.
ps -af |grep [s]sh
See the local port forwarding connection process with:
ps -x |grep "[s]sh -fN"
or from this post:
Finding the process that is using a certain port in Linux
lsof -i tcp:[PORT]
I can kill 1 of the process for the local port forwarding connection with:
kill <id>
When i try to close/kill the process with:
ssh -O cancel -L [PORT]:[IP]:[PORT] [IP]
I receive error a msg like:
No ControlPath specified for "-O" command
From this post:
How do I remove an SSH forwarded port
This commands won't work too:
pkill -f "ssh -f -N [REMOTE_IP]"
and
ssh -O exit [REMOTE_IP]
From this post:
How to delete local ssh tunnel
and
ssh -o ControlPath=$socket -O check
i receive
command-line line 0: Missing argument.
From post:
How to tell if an ssh ControlMaster connection is in use
I wanna close/kill a given connection with a port and not all, if i got as an example 3 connections on a host with diff ports, with a ssh command not with kill process like:
ssh -O cancel -L ....
or an other ssh command.
How can i fit this and where is my error with?
ssh -O cancel -L [PORT]:[IP]:[PORT] [IP]