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

Question about forward_remote #2289

Open
analog-cbarber opened this issue Nov 16, 2023 · 1 comment
Open

Question about forward_remote #2289

analog-cbarber opened this issue Nov 16, 2023 · 1 comment

Comments

@analog-cbarber
Copy link

I can use ssh -R to get access to an enterprise server, e.g.

ssh -R 8443:<remote-server>:443 ...

I hoped that the same thing would work using the connect_remote method:

    conn = Connection(
        host,
        user=user,
        forward_agent=True,
        connect_kwargs=dict(password=password),
        config=config,
    )

    with conn.forward_remote(
        remote_port=443,
        local_port=8443,
        remote_host="<remote-server>",
    ):
        pass

But this results in

paramiko.ssh_exception.SSHException: TCP forwarding request denied

What am I missing or failing to understand?

@avin-madhu
Copy link

avin-madhu commented Dec 25, 2023

Try :

AllowTcpForwarding yes

The error indicates that the SSH server has not allowed TCP forwarding for the specified ports. This restriction is often controlled by the SSH server's configuration, specifically the AllowTcpForwarding option. So I hope this helps

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

No branches or pull requests

2 participants