1

Forgive me if my terminology is not correct. I have the following situation:

When I work at the office, I access a remote machine (in other country)(let's call it MachineR) through its IP address (with ssh). I do my work there and then when I want to visualize the results I open a browser on that IP address with a particular port and I can see a visualization of my work. To access the remote machine I use a computer physically located at the office (let's call it WorkMachine)

Now, I want to do that from home. At home I have a VPN to access the office network. When I activate that VPN I can access my work computer WorkMachine

However, I can not access the remote machine (MachineR) in which I do my work.

How do I solve this? Well, I access with ssh my WorkMachine, and then inside of it, I access again with ssh MachineR. In that way I can do my work

My problem is that I cannot do that (or I haven't figure it out) with the visualization part.

As expected, from home I cannot just open a browser to the IP of MachineR.

So my question is, is there a way I can open MachineR from home to see the visualization of my work?

(I access MachineR through an IP address as I said, btw)

2
  • The only thing that comes to my mind is some kind of remote desktop WorkMachine from my windows machine at home... Jun 2, 2023 at 5:23
  • 1
    You could try enable Send All Traffic (use remote gateway in IPv4 settings) on your VPN so that everything is routed to the remote side. That effectively changes your WAN IP address to your work IP address, and everything you do on the internet is first send to that location.
    – LPChip
    Jun 2, 2023 at 7:23

2 Answers 2

0

A significant part of the equation that may not be obvious to you is the "-X" flag for SSH. "-X" enables X Forwarding, and is probably implied somewhere in your config/setup on your work desktop but not your home one.

I was able to see stuff on remote desktops of systems to hops away by using SSH -X in each instance, provided that I did not use sudo to change users (which seemed to interfere with authorization to use X display even when preserving environment)

A more useful variant my be to use the "-J" switch to use the work computer as a jump box. Rolling it altogether I was able to do something like

  ssh -X -J [email protected] [email protected]

Note that the above does assume that username is trusted to log in on the final box - if using key login the keys from your home computer would need to be in the ~username/.ssh/authorized_keys on final.box

You did not specify the OS used - I've used Linux all the way through. Hopefully this is an option - or if not it gives you enough to go on to roll your own solution. (If you use Windows I see cygwin in your future!

0

Since you have SSH access to both hosts and since the results are provided as a webpage instead of a native app, use ssh -D <port> to set up your client as a SOCKS proxy, which you can then configure in Firefox (maybe also other browsers) to have all traffic go through that SSH connection.

With an intermediate server there are two ways to do it:

  1. Chained forwarding:

    Home> ssh WorkPC -L 1080:localhost:1080
      WorkPC> ssh MachineR -D 1080
    
  2. Tunneling the whole SSH connection:

    Home> ssh MachineR -J WorkPC -D 1080
    
  3. Depending on situation, it might be enough to set up the forwarding directly via your work machine, without the second hop:

    Home> ssh WorkPC -D 1080
    

The same options exist in PuTTY (where the -D mode is called "dynamic forwarding") and in other SSH clients.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .