Score:2

bring the internet through an ssh tunnel using a tinyproxy

gt flag

Hy everyone, I ask you for help in order to achieve the following (sorry for my English). I have ssh connection from a VM1 to another VM2 (using openBSD), I have internet connection in VM1 and I want to bring internet from VM1 to VM2 using a tinyproxy in order to install some stuff in VM2. I am really lost.

The idea is install tinyproxy (an edit the configuration) in VM1 but at that point ,how I use it through a ssh tunnel for provide internet to vm2

David avatar
cn flag
Are you using any version of Ubuntu?
Mr_sadness_face avatar
gt flag
Yes I am using for VM1(ubuntu server 20.04.3 LTS) and VM2 (OPENBSD 7.0)
Score:1
cn flag
raj

More information about your network setup would be needed to answer this fully, so I will be making a few assumptions here. You need to adjust the answer to your case.

First question is: you say you have a ssh connection from VM1 to VM2. Do you have only the ssh connection, or do you have regular, full network connection between VM1 and VM2? If you do have a full connection, you don't need to use a ssh tunnel for the proxy, it just overcomplicates things.

Assume for the moment you have a full connection and your VM1 IP address is 192.168.1.100 and your VM2 IP address is 192.168.1.200. You should configure a proxy on VM1 to listen for example on port 3128 (that's usually a common port number used for proxy, although you can use any unused port number), and configure VM2 to use proxy 192.168.1.100:3128. That's basically all.

If you have only the ssh connection (for example there is a firewall between the two VMs that passes only the ssh traffic), you need to forward ports over ssh connection. Assume you are still running proxy on VM1 on port 3128, and you are connecting via ssh from VM1 to VM2 (as you wrote in your question). In that case, you need to use the following command on VM1 to connect to VM2:

ssh -R 3128:localhost:3128 192.168.1.200

After you establish the connection, you can set VM2 to use proxy at localhost:3128.

You can also connect the other way, ie. from VM2 to VM1, using the command (on VM2):

ssh -L 3128:localhost:3128 192.168.1.100

Similarly, after the connection is established, set VM2 to use proxy at localhost:3128.

Mr_sadness_face avatar
gt flag
Thank you very much !!! , Yes I only ssh connection,when you say set Vm2 to use proxy at localhost:port , you are saying do from Vm2 ssh -p port localhost ??. Thank you for help me I apreciate it too much
raj avatar
cn flag
raj
No, you have to configure your system to use proxy the way it's done in your system. I don't know how it's done in OpenBSD, but for most command line tools (like `curl` or `wget`) you need to set the environment variables `http_proxy` and/or `https_proxy` to `http://localhost:3128`.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.