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?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.
Sign up to join this communityI 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?
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.