0

I am not sure what is the term for what I want to do, and how secure it will be, but here is the setup:

I have full root access to workpc only physically when at work. It is behind a firewall which I do not control. I can not access workpc when at home from homepc.

I also have a VPS machine vps, out there somewhere, which has a static IP and I have full control over that too.

homepc does not have a static ip and also it is not on 24/7, unlike vps which is on 24/7 and has static ip.

Ideally, could I establish a long-term connection from workpc to vps when I am at work. And then when I go home, I connect homepc to vps and somehow access workpc?

I have full root access to all machines and all are running latest linux.

4
  • 1
    zerotier would be the easiest option, and does not require a VPS. A ssh reverse tunnel between your workpc and the VPS would also work. Dec 7, 2022 at 11:04
  • 1
    Please make sure you're not creating shadow IT. Any VPN will work. ZeroTier will require the least setup and you won't need the VPS at all.
    – gronostaj
    Dec 7, 2022 at 11:10
  • To whom much is given (root access), much is expected (good infosec practices). Establishing a semi-permanent link to the outside world is risky. I would be certain you understand the risks completely and address them. Even better-talk to your admins or infosec people before proceeding. They could have a solution at hand.
    – uSlackr
    Dec 7, 2022 at 14:23
  • @uSlackr in the long term we are all powned but yes, thanks for the advise.
    – bliako
    Dec 14, 2022 at 16:48

1 Answer 1

1

You didn't mentioned what type of access do you want to have exactly, SSH, VNC, ... but there are several options.

  1. Remote access software like TeamViewer or similar that you install on your workpc and can then access it from anywhere in the world with corresponding remote client. There is possibility this is against your company policies and blocked by network firewall.

  2. VPN between your workpc and vps, you establish vpn connection from workpc to vps, and then you can connect from homepc to vps over vpn or ssh, and access workpc on its vpn address through vps. You would need to setup vps as vpn server running OpenVPN, WireGuard or some other type of VPN software.

  3. SSH tunneling, you establish a ssh connection from workpc to vps with reverse tunneling, and then establish a ssh connection from your homepc to vps with forward tunneling, and you can then connect with ssh from your homepc to workpc through those two tunnels.

example: ssh -R 8022:localhost:22 user@vps, this will establish a ssh connection from your workpc to vps, where you create a listener on port 8022 on vps, and every connection that comes to that port will be redirected through SSH to port 22 on your workpc.

You then create another ssh connection from your homepc to vps, like SSH -L 9022:localhost:8022 vps which will create a listener locally on your homepc on port 9022, and every connection to that port will be send over SSH to port 8022 on vps, which will then enter the ssh tunnel with workpc and go to ssh server on workpc.

You can then just do a ssh connection to localhost port 9022 and will be send to workpc port 22 to its ssh server. In this case ssh user@localhost -p 9022 will be the same as doing ssh user@workpc

You need to enable sshd service on your workpc in this case, as it needs to have ssh server running on it on port 22. In case you want to use some other port or service on your workpc to access, you replace port 22 in first reverse tunnel with the corresponding port you want to access on your workpc

1
  • Thank you @raiz, the purpose is plain command line access, as I would do if I could ssh. Your 2nd or 3rd suggestion is what I need, thank you.
    – bliako
    Dec 7, 2022 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.