I have opened an ssh tunnel with lucas-MacBook-Pro:~ donbeo$ ssh -D 8080 -f -C -q -N donbeo@149.157.140.64
How can I close it now?
Find the ssh tunnel's process id running on a specific port:
ps aux | grep <port number>
and kill the process:
kill -9 <process id>
You can kill the ssh process like others with
kill -9 $PID
You can find ssh session process ID with
pgrep ssh
You have to type
~.
to exit/close the ssh connection. I think
exit
also works.