SSH Reverse Tunnel using DTMF

I had a need to get command line access. But was having trouble with the host and the free internet I has given. Here is a write up on how to setup a SSH Reverse Tunnel and starting it with a DTMF command. If anyone knows how to start a SSH with a pid. That would be great. Please let me know if we can add anything to the howto.

David
KE6UPI

DTMF SSH Reverse Tunnel - Google Docs.pdf (43.5 KB)

David,
There are a few other ways that might be of interest to you to do this as well:

-ngrok (https://ngrok.com/)
-tmate (https://tmate.io/)
-Gravitational Teleconsole (https://www.teleconsole.com/)

Or you could just setup Gravitational Teleport and make it act as a gateway to your node.

And there is always socat with certificates: http://www.dest-unreach.org/socat/doc/socat-openssltunnel.html

Or you can get really really fancy and use the /dev/tcp filesystem found in bash:

This will open a file descriptor and point it at the virtual file of /dev/tcp//. This results in connecting the file descriptor to the remote tcp port and destination specified and creates a read and write file descriptor:

exec 4<>/dev/tcp//

The file descriptor here is 4 and is read and write

Now to send an GET over in HTTP 1.0 format (you can send whatever you want):
echo -e “GET / HTTP/1.0\r\n\r\n” > &4

And you can read the results with:
cat <&4

Although your mileage may vary with this last one.

-Stacy
KG7QIN

Thanks Stacy,

If you want to write something up. I’m sure other would appreciate it.

David

···


Thanks, David

“Laws that forbid the carrying of arms…disarm only those who are neither inclined nor determined to commit crimes. Such laws make things worse for the assaulted and better for the assailants; they serve rather to encourage than prevent homicides, for an unarmed man may be attacked with greater confidence than an armed one.”

Thomas Jefferson

Dave,
At some point I’ll probably put something about it on the Wiki.

If you get a chance, please also post this to the wiki too.

Thanks.

-Stacy

Autossh would be useful on this as well.

You can reset a tunnel from the server side, if ever needed. As well as keep a tunnel open for long periods.

Use this on several of my nodes to connect back to my primary server for access when needed.