Hot answers tagged socks
7
It sounds to me like you need a socks client, or a ssh client that understand socks. -D is for ssh to be a socks server/proxy.
You could use ssh under tsocks, or another SOCKS wrapper. Or use ssh's ProxyCommand in conjunction with socat or nc -X:
ssh -o ProxyCommand='socat - socks:B:%h:21,socksport=1080' C
To have a HTTP proxy that uses the SOCKS server ...
4
So, if I understand correctly, you can ssh from machine 1 to machine 2 but not from your laptop (from which you can ssh to machine 1). So you'd like to have a socks server on machine 1 and use it from your laptop? So looks like all you need is port forward that 8080: run on your laptop:
ssh -nL 8080:localhost:8080 machine1 ssh -C2qnN -D 8080 ...
3
With:
socat tcp-listen:12345,reuseaddr,fork,bind=127.1 socks:218.62.97.105:11.11.11.11:3128,socksport=1080
you will have a socat waiting for TCP connections on port 12345 on the loopback interface, and forward them to 11.11.11.11:3128 by way of the socks server on 218.62.97.105:1080
You can then use that to connect to D:
ssh -o ProxyCommand='socat - ...
3
Do you know flossmanuals.net? They've got a great manual on How to Bypass Internet Censorship (also as epub and pdf for offline use -- and note the translations, among others in Farsi).
Among many tools and methods, they cover SOCKS proxies. But given a VPS somewhere, the other ways they mention should be considered, too. (For example how to use ssh to ...
3
SOCKS5 is a protocol (i.e. in the application layer of OSI), so plain network-routing (e.g. via iptables) alone won't do. (It's probably necessary, but not sufficient.)
What you need is a proxifier. Without having tried it, tun2socks, allowing you to "socksify TCP at the network layer", looks promising (as does proxychains, without iptables but prefixing ...
3
As pointed out by enzitib,tsocks can be used to use a SOCKS proxy with yum.
To be more detailed, one can use it like this:
$ export TSOCKS_CONF_FILE=$HOME/.tsocks.conf
$ cat .tsocks.conf
server = 127.0.0.1
server_port = 1080
$ tsocks yum ...
By default tsocks uses SOCKS version 4 - but you can configure 5 via the 'server_type' directive. For ...
3
You'll need to install and configure an actual SOCKS server on the server, such as Dante, SS5, Delegate or Srelay.
3
I am showing you a very basic way to do it. Here I am assuming that B is directly accessible from A. There may be variations according to various situations.
On A:
ssh -D socks_port B
This will open up the port socks_port on A as a SOCKS proxy.
On your system:
ssh -L local_port:localhost:socks_port A
This will forward local_port on your system to ...
2
How about using two different configuration files for tsocks?
According to this manpage, tsocks will read its configuration from the file specified in the TSOCKS_CONF_FILE environment variable. So you could split your tsocks.conf to tsocks.1081.conf and tsocks.1082.conf and then do something like this (bash syntax):
$ ...
2
I use tsocks for this purpose. It's a wrapper that catches all connects and forwards them according to your tsocks.conf file. For instance:
server = 127.0.0.1
server_type = 5
server_port = 1338
Where as you already have a ssh-proxy set on localhost port 1338. Using this method, you can nest connections since the next ssh session running in the tsocks ...
1
According to this ticket (and that one),you need to decide what to proxy: connections to the tracker or all connections (including the ones to peers):
Proxying tracker connections can be done using the patch mentioned here or using something like Polipo, mentioned here
Proxying everything can be done, as you already tried, using socksifiers like tsocks, ...
1
I get the same result, and looking at the strace output, it tries to connect to URL_HOST directly.
However if I use
curl -x socks5://SOCKS_SERVER:1080 "THE_URL_FROM_BROWSER"
It does work as expected (use socks4a or socks5h to have hostnames resolved by the proxy, if supported)
1
Below configuration will enforce authentication:
internal: eth0 port = 53200
internal: 127.0.0.1 port = 53200
external: eth0
method: username
user.privileged: root
client pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: error # connect disconnect
}
pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
protocol: tcp udp
log: error # connect disconnect
}
Only top voted, non community-wiki answers of a minimum length are eligible

