Hackernoon logossh proxying through many hosts by@mikefettis

ssh proxying through many hosts

mike fettis Hacker Noon profile picture

@mikefettismike fettis

“the hacker is bouncing all over the globe, we can’t trace him.”

There is an awesome flag that can be set for ssh. This is the idea of using ssh as a proxy, or specifically in our case forcing a tty allocation from one host to another and further on down the line.

The command I am talking about is, ssh -tt

man ssh: 
-t Force pseudo-terminal allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty.

This is pretty straight forward and easy to do, lets just dive right in.

ssh -tt [email protected] -p 22 ssh -tt [email protected] -p 4422 ssh -tt [email protected] -p 22 ssh -tt [email protected] -p 7722

In the above example I am using different ssh ports on different hosts because why not have ssh on non standard ports, it makes life more fun that way. This is pretty useful when you have a single entry point to a vlan and then burrow further through the layers of the network. Also if you just want to see how many computer you can connect to and through for giggles. if there is not an ssh key setup it will prompt you for username and password every connection and then retain the interactive session throughout.

Congratulations you are now hackerman jumping all over the globe.

Tags

Join Hacker Noon

Create your free account to unlock your custom reading experience.