Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to open port 22 on my local machine (Windows 7 32 bit). I'm using a web tool to check if my port is open. It says that port 22 is closed. So I disabled firewall to see if it causes port to be blocked. Even with firewall disabled port 22 is still closed.

I'm connecting straight to my cable without a wireless router. What could be the issue?

update I'm trying to connect to a server(Linux - CentOS release 4.5) using SSH. I'm using Putty client on my machine (Windows 7). When I try to connect, the connection times out. I ran command telnet mysite.com 22 to find out if I can connect via port 22 and I get 'Connection timed out.' message.

update 2 figured it out. Besides firewall on my local computer, there was also a firewall on server which only opened up port 22 to certain IPs. So even though port 22 was open, it wasn't open to my IP.

share|improve this question

closed as off topic by squillman, Sirex, Ward, John Gardeniers, Wesley Feb 22 '12 at 0:39

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Do you have the same issues for another port? What are the first 3 parts of your IP? –  Bart De Vos Feb 20 '12 at 13:49
3  
Have you confirmed that something is definitely listening on port 22? –  Decado Feb 20 '12 at 13:54
2  
Does your ISP block port 22? –  tombull89 Feb 20 '12 at 13:55
    
There are three states of ports: OPEN, CLOSED, and STEALTH. OPEN means that something is listening on it and there is a path to it from your web tool; nothing is blocking it. The only difference between that and CLOSED is that nothing is listening on it. STEALTH means that something is blocking the path to it from your web tool, usually a firewall, regardless if it would be otherwise OPEN or CLOSED. –  Kevin M Feb 20 '12 at 16:51
    
Why do you need it to be open? –  Kevin M Feb 20 '12 at 16:52

3 Answers 3

You need an application listening on port 22 in addition to the firewall rule in order for this to work. Port 22 is generally used for an SSH server. Do you have one of these running on your Win 7 box?

Running netstat -ab | find ":22" will verify whether or not anything is listening.

If you don't have anything listening on that port, services that check for port availability won't be able to connect to them, which will give you the result that you see. I suggest you take a few minutes to collect some books on entry-level networking concepts and give them a read.


Edit to address your comment:

When you initiate a SSH connection from your machine, it does not have a source port of 22, it has a destination port of 22. By default, Windows Firewall does not block any outbound traffic. If you're trying to connect to an SSH server from your Win 7 computer, then you don't have to do anything with port 22, the person with the SSH server does.

That said, if they say that they've opened 22 and you still can't connect, there's probably something in the middle that's blocking the connection. Your ISP, a hardware firewall in the server's datacenter, or any number of other things could be the culprit.

You should be using the web tool to see if port 22 is open on the remote server, not your desktop. If it is, then you should try calling your ISP and see if they filter it.

share|improve this answer
    
I'm trying to connect to a server using SSH. I'm talking to the host support guys and they are saying that port 22 is blocked on my side. Telling me that I need to open port 22 up using firewall rule. Which I did and it still doesn't work. :-( –  dev.e.loper Feb 21 '12 at 2:14
    
See my edit. It sounds like someone is a bit confused. –  MDMarra Feb 21 '12 at 15:05
    
In addition to MDMarra's comment and to perhaps clarify what the support was saying.. They probably meant your ISP is possibly blocking outbound port 22 traffic. Even though you've disabled your firewall which effectively allows outbound traffic with destination port 22... it could make it all the way to your ISPs NOC only to be discarded because they have some sort of rule that blocks outbound port 22 traffic. Not likely... but that's probably what the host support was referring to. At least I would certainly hope that your host support would know the difference... –  Safado Feb 21 '12 at 15:29

Sounds like you have outbound filtering enabled on your firewall. Open the "Windows Firewall with Advanced Security", right click on the root node in the tree in the left pane, select properties. You'll see tabs for each of the Profiles, it's "normal" to set Outbound on each of these tabs to "Allow" (unless you're in a very high security environment).

If those are already set I would try connecting to another SSH server (eg shell.sourceforge.net). If you can connect, the problem isn't on your end.

share|improve this answer
    
figured it out. Besides firewall on my local computer, there was also a firewall on server which only opened up port 22 to certain IPs. So even though port 22 was open, it wasn't open to my IP. –  dev.e.loper Feb 22 '12 at 1:26

When one refers to a port being "closed," the vernacular is that they're referring to a listening port on a server. When you talk about trying to open port 22 on your Windows machine, you're implying that you want to run an ssh daemon on that machine.

You should start at a basic level and work your way up the stack. The first question is whether you can reach the server you're trying to connect to at all. Can you ping it or access another service that's there?

If you can reach the server, attempt to connect to ssh on another machine. Just to throw something out there, use login.toolserver.org -- it will instantly disconnect you because you don't have an authorized login key, but it will confirm whether you can send and receive traffic on tcp/22.

Do those steps, leave a comment telling me what worked and didn't, and we'll go from there.

share|improve this answer
    
figured it out. Besides firewall on my local computer, there was also a firewall on server which only opened up port 22 to certain IPs. So even though port 22 was open, it wasn't open to my IP. –  dev.e.loper Feb 22 '12 at 1:27

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