Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know there are many questions asked on this issue, but I am still not certain on how to solve my issue. I am at a location where my guess is the SSH connection is blocked. Using the same Macbook (OSX Mountain Lion) from home gives me access without any issues.. But when I do verbose output of a connection I do not see the data to prove that:

ssh -vvv
OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /Users/me/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to [] port 22.
debug1: connect to address port 22: Connection refused
ssh: connect to host port 22: Connection refused

I know port 22 is open at the remote Dreamhost server. I connect from the office or home everyday. So why would it be refused from this location? It must be a firewall issues. So is there a way to circumvent this?

share|improve this question
up vote 2 down vote accepted

A connection refused message means that a TCP RST (reset) packet was sent in response to the connection attempt to port 22. This is sent when the port being connected to is not open on the server. Here we know that is not the case as you can connect from other locations.

So this is not the ssh service rejecting the connection, but at the TCP layer. The RST packet could be coming from the server itself (perhaps from a firewall) or any of the intervening devices.

You will see this exact behaviour if an ISP chooses to block certain ports, and I would guess that this is what is happening here. It could also be a local firewall at the location.

Lastly, it could be that the IP address you are coming from at that specific location has been identified as a source of malicious activity, and so has been blocked at Dreamhost.

You cannot identify the real source of the RST packet by looking at it, as it will have the source IP of the server you are connecting to, regardless of where it actually originated. You only option is to check with the local network administrator, local ISP and Dreamhost themselves to see where it is getting blocked.

share|improve this answer
Well, I do think SSH via 22 is blocked here as I am at a Uni campus. On the other Uni campus I can connect just fine. Why they block it here I do not know. More students here and maybe they had more issues. Would be great to get the connection going another way if possible.. – rhand Aug 8 '12 at 3:09
@rhand Many hosting providers will allow you to specify an alternative ssh port - or have one already defined. However, it is likely that outgoing access from campus is limited to a defined subset of ports and so you may not find one that you can use. – Paul Aug 8 '12 at 3:13
If I wanted to change the outgoing port do I have to use -D or is it -L? Still pretty green in this field. -p seems to be for the port I am connecting to and Dreamhost allows only 22 as far as I know and that is not the issue here anyways.. – rhand Aug 8 '12 at 3:16
No, -D and -L are for port forwarding. -p is the one you need to change, but you'd need Dreamhost to support an alternate port. If they don't you are out of direct connection options. An ssh, VPN or RDP session to an external device and then ssh from there is a possibility. – Paul Aug 8 '12 at 3:20
OK. Thanks. Will have to move to the other campus or another location again it seems. – rhand Aug 8 '12 at 8:35

You must log in to answer this question.

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