3

My company has a linux server (CentOS 6 VM) behind a corporate firewall, I have full root control of the VM, but I have no control over the firewall. There's an ssh server running on it, and I can ssh to it within the company network.

I would like to ssh to this VM when I'm outside of the company network. How do I achieve this?

This linux VM is running on a Mac host machine, which I can use logmein to connect, and then access the linux VM. I'd like to ssh directly to the linux VM.

I'm guessing there has to be some sort of handshake initiated by the linux VM to the outside machine for this to work?

2
  • Are you sure your company doesn't have a VPN setup for external access already?
    – crasic
    Commented Aug 12, 2011 at 4:38
  • 1
    Did you mean to post the same question, at the same time, to serverfault.com/questions/300380 ?
    – mlp
    Commented Aug 12, 2011 at 6:36

3 Answers 3

-1

Use Hamachi. No opening of ports required for secure VPN tunnels. Use SSH through the VPN.

LogMeIn Hamachi is a hosted VPN service that lets you securely extend LAN-like networks to distributed teams, mobile workers and your gamer friends alike. In minutes.

2
  • I tried hamachi actually, but was hit with an error: hamachi: /lib/libc.so.6: version 'GLIBC_2.7' not found (required by hamachi)
    – KoKo
    Commented Aug 12, 2011 at 4:30
  • make sure that you have installed build-essential and lsb
    – kobaltz
    Commented Mar 11, 2012 at 23:01
7

The very best solution is to contact your network administrator and ask them to either open a TCP port for you in the firewall, or get a VPN connection to the network.

If you use any method that circumvents security (there are many out there, some of which are advertised on television in a way that makes it sound like a perfectly innocent thing to do), you could be at risk of losing your job, so make sure you go through the proper channels within the company to first obtain permission.

Maintaining internal network security is very important because companies have a legal responsibility to protect privacy.

1
  • +1... if you don't control the firewall, then someone else does, and they should be aware that you are doing this.
    – trpt4him
    Commented Jul 20, 2015 at 20:56
4

You can create a ssh tunnel from behindvpn to outsidevpn host.

behindvpn$ ssh -R 1234:localhost:22 outsidevpn

This will open port 1234 on outsidevpn host which will forward connections to port 22 on the behindvpn host.

Now you can connect to behindvpn host with:

$ ssh outsidevpn -p 1234

Note: You may need to make sure that your connection will not break for example due to inactivity or shell timeout.

You must log in to answer this question.

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