0

I'm trying to SSH to Ubuntu server I have in another city. The IP address for that server is something like 129.123.x.xxx. I use windows and cmder to connect to Ubuntu. When I use my campus vpn which changes my ip address to 129.123.y.yyy, I have no problem and the command ssh [email protected] works in cmder. But when I disconnect the vpn and my ip changes to the ips here in another city to 208.234.z.zzz and I try the command ssh [email protected], it won't work and gives the error of connection timed out. What's wrong with this? If the port 22 is not open then it shouldn't also work with vpn. How come it only works with the vpn? and what is the solution?

ANSWER: both of the answers below are very informative. But I had to choose one.

2 Answers 2

0

Since you can connect to the server through a vpn but not over a standard network, this suggests some property of the network you're connecting to in your city now is preventing the connection. A way to test this would be to use some other vpn. If it works with a vpn other than the one you're using now, then it confirms that the networks around you are giving you trouble. In that case, the solution would just be to use the vpn, as it's out of your control.

1
  • I'll try other vpns. Right now I'm in Chicago and the ubuntu server is in Utah. I vaguely remember that I could access the ubuntu server in my office in utah from my home in utah. So do you think it has something to do with ISPs in Chicago? Oct 18, 2018 at 5:23
1

Do you know if the IP address of the Ubuntu device is publicly accessible?

VPN connection basically makes your device to be in the same network proximity and it will affect what you can / can't access. If you have devices that are meant to be accessible only by local network access, then VPN makes your device as if it is "local" to that network. Without VPN - you don't have access to those "local" resources.

Now to answer your question:
What's wrong with this?
Nothing wrong. Your Ubuntu Device may not be publicly accessible from internet.

If the port 22 is not open then it shouldn't also work with vpn.
Not quite. At YOUR end (your city) - you may have port 22 blocked. Once you connect over VPN, your connection over port 22 is tunneled through the VPN connectivity, therefore it is not blocked (as the VPN connection itself is not blocked).

How come it only works with the vpn? and what is the solution?
Depends on the actual problem (as we don't have enough information):

  • If port 22 is blocked at your end - then VPN allows a tunnel for connectivity over port 22.
  • If your Ubuntu device is ONLY accessible locally - then VPN is your only solution
2
  • How can I make my ubuntu be accessible over the internet (globally)? Oct 18, 2018 at 5:22
  • That is a different question and you probably need to make a new question - and a lot more details on how the Ubuntu PC is connected on the other side. In some cases you may not be able to - especially if your device is within your organisation and you don't have management over how the network works / configured. If it is your home PC, and simply behind a router - a lot of different question has addressed that question.
    – Darius
    Oct 18, 2018 at 5:28

You must log in to answer this question.

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