SSH Tunnel: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== Objective == Create an SSH tunnel on a local machine which redirects MySQL requests to another machine on the LAN. == Establish SSH Tunnel == <ref>[https://www.studytoni...") |
No edit summary |
||
| Line 6: | Line 6: | ||
<ref>[https://www.studytonight.com/post/how-to-setup-ssh-tunneling-in-mac-os-or-ubuntu How to Setup SSH Tunneling in Mac OS or Ubuntu]</ref> | <ref>[https://www.studytonight.com/post/how-to-setup-ssh-tunneling-in-mac-os-or-ubuntu How to Setup SSH Tunneling in Mac OS or Ubuntu]</ref> | ||
== Troubleshooting == | |||
=== View SSH tunnels === | |||
<pre> | |||
$ lsof -i tcp | grep ^ssh | |||
ssh 18250 damien 3u IPv4 0xf863dcf7cc3dd6d5 0t0 TCP 192.168.123.105:56935->ds920:21098 (ESTABLISHED) | |||
ssh 18250 damien 5u IPv6 0xf863dcf7ce5b1e1d 0t0 TCP localhost:ddi-tcp-1 (LISTEN) | |||
ssh 18250 damien 6u IPv4 0xf863dcf7c661454d 0t0 TCP localhost:ddi-tcp-1 (LISTEN) | |||
</pre> | |||
=== Destroy an SSH tunnel === | |||
<pre> | |||
$ps aux | grep [LOCAL_PORT_NUMBER] | |||
</pre> | |||
== See Also == | == See Also == | ||
=== Reference === | === Reference === | ||
<references /> | <references /> | ||
Revision as of 17:09, 28 August 2021
Objective
Create an SSH tunnel on a local machine which redirects MySQL requests to another machine on the LAN.
Establish SSH Tunnel
Troubleshooting
View SSH tunnels
$ lsof -i tcp | grep ^ssh ssh 18250 damien 3u IPv4 0xf863dcf7cc3dd6d5 0t0 TCP 192.168.123.105:56935->ds920:21098 (ESTABLISHED) ssh 18250 damien 5u IPv6 0xf863dcf7ce5b1e1d 0t0 TCP localhost:ddi-tcp-1 (LISTEN) ssh 18250 damien 6u IPv4 0xf863dcf7c661454d 0t0 TCP localhost:ddi-tcp-1 (LISTEN)
Destroy an SSH tunnel
$ps aux | grep [LOCAL_PORT_NUMBER]