I'm new to Linux and I have created a RedHat6 VM using Oracle VirtualBox. For testing purpose, I have set it up so that I can connect to it from my local/host Windows machine (and those of my friends who are connected to home WiFi) using PuTTY.

What would I need to do if I would like to be able to connect to this RedHat VM from private network of my office which uses Windows there.

Goal: I want to be able to login to my VM from just about anywhere in the world!


If the people can connect to your VM using putty, your work on the server side is done. You, now, need to modify your router's settings to create a virtual server port. By virtual server. I mean, if someone comes to the port 22 of your public IP address, the router should be able to hand that request off to the Internal IP address of your RedHat server on port 22. Since routers come in different brands, models and firmware levels, it is hard to say how to configure this on your particular brand and model number of it. But if you Google your router brand and model followed by words "create virtual server port" I am pretty sure you will find one of few very well written document, explaining how to do this step by step. As you can guess, you are not the only one doing this.

Word of Caution

When you do that, you are opening yourself up to a world of hurt. Most script kiddies scan the internet for open ports and port 22 is a common attack vector. Once they see it open, they start mounting variety of exploits, hoping to find a machine which they can compromise. Even if your machine is rock solid as far as patches and vulnerabilities go, the amount of traffic you will get from these people will hinder your network performance. And they DO NOT stop or give up. You can change the port 22 to a random port number, lets say 6142, then you need to connect to the public IP address of your router with a command like ssh -p 6142 w.x.y.z where the w.x.y.z is your public IP address. Even in this case, some network scanners will be able to find the port and you will find yourself on the same boat, with a little bit of time gained on the front end. Once your IP address and port number is discovered, it is a losing battle. Just a heads up. Know what you are getting into

  • Thank you so much! Also, I'll look into the VPN thing :) – runlevel3 Mar 10 '16 at 19: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.