1

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?

2

You can kill the ssh process like others with

kill -9 $PID

You can find ssh session process ID with

pgrep ssh
2

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>

0

You have to type

~.

to exit/close the ssh connection. I think

exit

also works.

2
  • can you post the full command? The connection is working in background – Donbeo Oct 15 '15 at 14:36
  • Ah sorry, background process... So you have to check for the pid and use 'kill -9 id'. – matthias Oct 15 '15 at 14:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .