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

Is there any way to use socks5 instead of port forward #772

Closed
oneengineer opened this issue Jun 22, 2019 · 8 comments
Closed

Is there any way to use socks5 instead of port forward #772

oneengineer opened this issue Jun 22, 2019 · 8 comments
Labels
feature-request Request for new features or functionality ssh Issue in vscode-remote SSH

Comments

@oneengineer
Copy link

In my environment, I can use ssh -D $portA remote_server , but ssh -L $portX:localhost:$portY remote_server would fail.
Is there any to use make vscode remote use dynamic tunneling (I guess it is same as socks5) instead of TCP forward?

@roblourens roblourens added feature-request Request for new features or functionality ssh Issue in vscode-remote SSH labels Jul 1, 2019
@caffeineaddiction
Copy link

see also: #161

@caffeineaddiction
Copy link

as a work around I have done the following:

Desktop ~/.ssh/config

...

Host *
  RemoteForward 54321

...

Remote: ~/bin/wget in which ~/bin is added to PATH via .bashrc

#!/bin/bash
export LD_LIBRARY_PATH=$HOME/opt/lib/tsocks/
export TSOCKS_CONF_FILE=$HOME/opt/tsocks/tsocks.conf
$HOME/bin/tsocks /usr/bin/wget $@

Remote: ~/opt/tsocks/tsocks.conf

server = 127.0.0.1
server_port = 54321
server_type = 5

note tsocks binary has been scp-ed to ~/bin/tsocks and ~/opt/tsocks/ has been created with libtsocks.so which is normally stored in /usr/lib64/libtsocks.so

This is a work around that allows me to have wget functionality with out messing with anything outside my profile to get it to work (eg: no root required ... even though I have it).

@cameronbraid
Copy link

Just edit your ssh config file and add

DynamicForward 54321

And this will setup a SOCKS5 proxy on port 54321

@caffeineaddiction
Copy link

Just edit your ssh config file and add

DynamicForward 54321

And this will setup a SOCKS5 proxy on port 54321

wget does not support socks5 by default

@cameronbraid
Copy link

Sure, but my answer was in regards to the question :

Is there any way to use socks5 instead of port forward?

In my environment, I can use ssh -D $portA remote_server , but ssh -L $portX:localhost:$portY remote_server would fail.
Is there any to use make vscode remote use dynamic tunneling (I guess it is same as socks5) instead of TCP forward?

Since you can do the same thing as -D using DynamicForward in ssh config

This allows you to setup socks5 instead of port forwarding.

@caffeineaddiction
Copy link

caffeineaddiction commented Aug 20, 2019

https://www.openssh.com/txt/release-7.6

ssh(1): add support for reverse dynamic forwarding. In this mode,
ssh will act as a SOCKS4/5 proxy and forward connections
to destinations requested by the remote SOCKS client. This mode
is requested using extended syntax for the -R and RemoteForward
options and, because it is implemented solely at the client,
does not require the server be updated to be supported.

-R (or RemoteForward in config) allows for doing a reverse -D (or DynamicForward in config) ... thus -R is using socks5

@cameronbraid
Copy link

Aah, so you can do it in reverse too.. sweet

@roblourens
Copy link
Member

Dynamic forwarding is now used

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality ssh Issue in vscode-remote SSH
Projects
None yet
Development

No branches or pull requests

4 participants