Forked from mshafiee/Give an access to Internet to a server reachable by SSH but where Internet is blocked
Created
October 12, 2018 03:36
-
-
Save toklok/b27f41215df2d002924951a8ed814188 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Something like this: | |
+----------+ +-----------+ | |
| |+----SSH+-->| | | |
| A | | B | | |
|+--------+| | | | |
Internet <-++-+PROXY<++<SSH Tunnel--+ | | |
|+--------+| | | | |
+----------+ +-----------+ | |
On Local Machine: | |
sudo apt install dante-server | |
sudo vi /etc/danted.conf | |
Change This: | |
------------------- | |
internal: 0.0.0.0 port = 1080 | |
external: eno1 | |
socksmethod: none | |
clientmethod: none | |
user.privileged: root | |
user.unprivileged: nobody | |
user.libwrap: nobody | |
client pass { | |
from: 0.0.0.0/0 to: 0.0.0.0/0 | |
log: connect disconnect error | |
} | |
socks pass { | |
from: 0.0.0.0/0 to: 0.0.0.0/0 | |
log: connect disconnect error | |
} | |
------------------- | |
ssh -R 1080:127.0.0.1:1080 mohammad@172.25.25.32 | |
On Remote Machine: | |
sudo netstat -nlpt | |
curl -v -x socks5://localhost:1080 http://www.google.com/ | |
sudo apt install tsocks | |
sudo dpkg --install ./tsocks_1.8beta5-9.3_amd64.deb | |
sudo vi /etc/tsocks.conf | |
Change This: | |
------------------- | |
local = 172.25.25.0/255.255.255.0 | |
path { | |
reaches = 0.0.0.0/0.0.0.0 | |
server = 127.0.0.1 | |
server_port = 1080 | |
server_type = 5 | |
} | |
server = 127.0.0.1 | |
server_type = 5 | |
server_port = 1080 | |
------------------- | |
sudo tsocks apt install nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment