

Now the commands can be executed as: $ sudo proxychains apt update $ proxychains git pull $ proxychains wget google.Hello how can i create a working Reverse ssh tunnel like this commend should do: ssh -fN -R 12345:localhost:22 create the process on the intermediary computer.
REVERSE SSH SHELL INSTALL
Proxychains can be installed via apt, so you may want to run: $ sudo apt -o Acquire::http::proxy="socks5h://localhost:6666" -o \ Acquire::https::proxy="socks5h://localhost:9000" update $ sudo apt -o Acquire::http::proxy="socks5h://localhost:6666" -o \ Acquire::https::proxy="socks5h://localhost:9000" install proxychains For example, the command you saw in the previous section: $ sudo apt -o Acquire::http::proxy="socks5h://localhost:9000" -o \ Acquire::https::proxy="socks5h://localhost:9000" updateĬan be done by $ sudo proxychains apt update It allows you to use the proxy by adding “proxychains” prior to the commands which you want to run. To make it simple you can use another tool to specify the proxy. It is annoying that you need to add lengthy proxy options all the time. When you stop it, find the process and kill.

Useful when you need only port forwarding. The details can be found here, it is a great explanation for the commands. If you want to make it persistent, you can run this instead: $ git config -global http.proxy socks5h://localhost:9000 $ git config -global https.proxy socks5h://localhost:9000 The above command is for the temporary use of the proxy. git pull) $ git -c http.proxy=socks5h://localhost:9000 -c \ https.proxy=socks5h://localhost:9000 pull You can even set variables as: export http_proxy=localhost:9000 export https_proxy=localhost:9000ģ. It can be enabled via /etc/wgetrc use_proxy=on http_proxy=localhost:9000 https_proxy=localhost:9000 wget command $ wget -e use_proxy=on -e http_proxy=localhost:9000 There is a great conversation in the StackExchange.Ģ. o and -option can be used multiple times to set different options.Īlternatively, you can configure /etc/apt/apt.conf /etc/apt/apt.conf Acquire::http::proxy="socks5h://localhost:9000" Acquire::https::proxy="socks5h://localhost:9000" The Manpage of apt: -o, -option Set a Configuration Option This will set an arbitrary configuration option.

Please note that the address of the proxy could be “socks5://”, however, DNS name resolution will not be done with the proxy. $ sudo apt -o Acquire::http::proxy="socks5h://localhost:9000" -o \ Acquire::https::proxy="socks5h://localhost:9000" update It is important to note that the remote machine needs to connect the Internet via socks5 proxy, and the proxy option needs to be enabled for each command. This machine is able to connect the Internet via this port. For example, $ ssh -R 9000 remote machine has now socks5 proxy at port 9000. It simply creates SOCKS proxy using -R option. 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.

In this mode, ssh will act as a SOCKS4/5 proxy and forward connections to destinations requested by the remote SOCKS client. OpenSSH7.6 New Feature * ssh(1): add support for reverse dynamic forwarding. OpenSSH7.6 or later has a feature to enable the tricks for reverse tunneling. This is actually out of the scope of this post, so I would not go into detail. If it is the case, the commands below need to be replaced with the -D option. This concept is also useful when your network has content filtering, and you want to bypass it. Without the Internet connection, these are just impossible. You want to install tools from GitHub or using pip, or update the machine via yum/apt. The network is restricted to access the Internet. Photo by Markus Spiske on Unsplash When is it useful?
