Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tunnel forward from local network device to VPS #278

Open
EugeneRymarev opened this issue May 23, 2023 · 1 comment
Open

Tunnel forward from local network device to VPS #278

EugeneRymarev opened this issue May 23, 2023 · 1 comment

Comments

@EugeneRymarev
Copy link

EugeneRymarev commented May 23, 2023

How to forward a tunnel from a device from the local network to the VPS?

with sshtunnel.open_tunnel(
    ssh_address_or_host=('VPS_IP', VPS_PORT),
    ssh_pkey='./id_rsa',
    ssh_username='user',
    remote_bind_address=('127.0.0.1', 60080),
    local_bind_address=(
            input('IP: ') or '192.168.88.1',
            int(input('Port [80]: ') or '80')
    )
) as server2:
    server2.start()
    print(server2)
    while True:
        time.sleep(1)

i receive next error

Problem setting SSH Forwarder up: Couldn't open tunnel 192.168.88.1:80 <> 127.0.0.1:60080 might be in use or destination not reachable
...
sshtunnel.HandlerSSHTunnelForwarderError: An error occurred while opening tunnels.

Command
ssh -p VPS_PORT -N -R 127.0.0.1:60080:192.168.88.1:80 user@VPS_IP
works fine for me.

@rlkandela
Copy link

I am also having this issue, I have tried all kinds of combinations, but reading the documentations seems that all of those parameters get translated to -L xxxx:yyyy:zzzz and not to -R xxxx:yyyyy:zzzz

-R IP:PORT [IP:PORT ...]
...
Equivalent to ssh -Lxxxx:IP_ADDRESS:PORT

And

-L [IP:PORT ...]
Equivalent to ssh -LPORT:xxxxxxxxx:xxxx, being the local IP address optional.

I guess there is no support and therefore no way of doing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants