tomerfiliba / plumbum

Plumbum: Shell Combinators
https://plumbum.readthedocs.io
MIT License
2.8k stars 182 forks source link

Add convenience flag for reverse ssh tunnels #562

Closed oakreid closed 2 years ago

oakreid commented 2 years ago

SSH supports the creation of reverse tunnels using a very similar syntax to normal tunnels. From the man pages:

     -R [bind_address:]port:host:hostport
     -R [bind_address:]port:local_socket
     -R remote_socket:host:hostport
     -R remote_socket:local_socket
     -R [bind_address:]port

This PR adds a flag to the .tunnel() method of SshMachine that allows for easy creation of a reversed SSH tunnel

henryiii commented 2 years ago

Thanks! Didn't format or catch that time_ns was included, but doing that in #566.