4

I have opened an ssh tunnel with lucas-MacBook-Pro:~ donbeo$ ssh -D 8080 -f -C -q -N [email protected]

How can I close it now?

Donbeo
  • 221

3 Answers3

8

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>

jaume
  • 15,010
2

You can kill the ssh process like others with

kill -9 $PID

You can find ssh session process ID with

pgrep ssh
Quanlong
  • 1,861
0

You have to type

~.

to exit/close the ssh connection. I think

exit

also works.

matthias
  • 264