TCP Port Forwarding for VS Code Remote SSH on Hugging Face Space

Hello Hugging Face Support Team,

I am attempting to connect to my Hugging Face Space using VS Code Remote SSH. While the VS Code Server starts successfully on the remote Space, I encounter errors when establishing the required TCP port forwarding. The relevant part of the logs is as follows:

[16:31:49.324] Remote server is listening on port 40741

[16:31:49.329] Starting forwarding server. local port 52006 → socksPort 58939 → remotePort 40741

[16:31:49.638] Failed to set up socket for dynamic port forward to remote port 40741: Socket closed

[16:31:49.656] channel 3: open failed: administratively prohibited: Rejected

[16:31:49.656] Error: The remote host seems to have TCP port forwarding disabled. Ensure sshd_config has `AllowTcpForwarding yes`.

From my understanding, the SSH configuration on the Space currently does not allow TCP forwarding, which prevents VS Code Remote SSH from establishing the local tunnel to the remote server.

Could you please advise if it is possible to enable `AllowTcpForwarding yes` on my Space, or alternatively, provide the recommended way to use VS Code Remote SSH with Hugging Face Spaces?

Thank you very much for your support.

1 Like

(post deleted by author)