Unable to connect to server using Putty

2

1

I am using Windows 8 for connecting to the Linux server. It would connect fine few days back but now I can not connect to it using my computer. I can connect to that server with any other computer.

I have checked the ports those are not blocking in routers way or server hasn't block any port regarding ssh or telnet (22 port is wide open).

  • can ping the system from my computer
  • can access the system using any other computer
  • port 22 is open on that system
  • ssh or telnet both are not working from my system but I can ping that system

I do not know what I have done or installed, but its not working. How do I track down the problem ?

Waqas

Posted 2014-05-01T05:30:22.953

Reputation: 133

Start by checking firewall – hjpotter92 – 2014-05-01T05:41:59.337

i even disabled the firewall still its does the same thing – Waqas – 2014-05-01T05:50:49.840

1Knowing some more details would be useful. Is the Linux box on your local network? Can you connect to that server using another computer on your local network? Can you ping that server using your computer? In other words, do two things: 1) draw out the connection that should exist between your computer and the Linux box, and pinpoint where it is that it isn't working, and 2) see if SSH is the only connection that's failing. – Pockets – 2014-05-01T08:45:03.767

@SamuelLijin check the question now i have added the bullets – Waqas – 2014-05-01T21:53:29.307

Same network? Same Switch? Any NAT between? Where are the pcs that are able to connect? – davidbaumann – 2014-05-02T05:52:42.713

You still haven't specified whether these machines are on the same network and under what conditions you can use other machines to access the Linux box; are these other machines on the same subnet? Are you using the wifi at your local Starbucks? These are all variables you need to consider. If it's not on your local network, the problem could very well be out of your control (if you're trying to access a Linux box at home from a Win8 machine at work, maybe it's a company firewall!). You need to pinpoint exactly what the symptoms of your problem are, not just a broad description. – Pockets – 2014-05-02T08:13:15.627

Answers

2

My first attempt to solve this problem would be to

  • open PuTTY
  • select Session > Logging
  • enable logging of SSH output to a file
  • try to connect
  • review the logfile

What does the logfile say? Anything that points you into a specific direction? It could me messages ranging from "Connection timed out" to "Access denied".

Connection timed out:

Make sure you really have the correct IP address and TCP port given in PuTTY's session options. If you are using a hostname instead of the IP address, make sure that the hostname resolves to the correct IP address. Eventually also check c:\system32\drivers\etc\hosts.  

If you have configured UFW firewall, but omitted to allow ssh connections, run sudo ufw allow ssh on your server. Before this, you can test if this is the problem (isolate it) by temporary disabling the firewall on your server sudo ufw disable and check if the issue is there. To re-enable run sudo ufw enable.

Do you administer the SSH server? If so, make sure that SSH really listens on port 22; if not, either change /etc/ssh/sshd_config on the server or adjust the port in PuTTY. Also check that iptables will let your client's IP address pass through.

If you do not administer the SSH server, get in touch with the administrator.

I personally like to install knockd on my SSH servers, so that I can only connect to them after knocking certain ports. Ask the administrator whether you have to do something like that.

Access Denied:

If you try to login as root, chances are, that this is forbidden in /etc/ssh/sshd_config on the server. Login with another / your username.

If you are using public key authentication, make sure that your private key

  • is in PuTTY's .ppk format
  • is entered in PuTTY's Connection > SSH > Auth section.

Also check whether the corresponding public key is in /home/yourusername/.ssh/authorized_keys. Make sure that there are no line breaks (I am using nano for that, and it sometimes adds linebreaks if I copy the key into it). A correct line should read like that, for instance for RSA: ssh-rsa ALOTOFCHARACTERS yourusername@hostname.

So. First step: enable logging and post the output here. ;)

stueja

Posted 2014-05-01T05:30:22.953

Reputation: 556

That question was 2 years ago and I don't have the same environment now. But your answer seems helpful – Waqas – 2016-06-09T06:14:31.530

Yeah, I saw the date a tenth of a second after I pushed the button. Thanks for accepting. Thanks for still being here on superuser! :) – stueja – 2016-06-09T06:32:16.253

Managed to solve 'Connection timed out' by running sudo ufw allow ssh. At some point when I configured the firewall on the server I have omitted this and had to log in via provider's console. – Cezar Cobuz – 2020-02-07T22:59:15.940

0

I faced the similar issue. Reinstalling the putty and launching the putty session to the server was successful. Unsure about the Root cause of the issue.

Hope this helps for anyone who is facing the same issue.

Pavan

Posted 2014-05-01T05:30:22.953

Reputation: 1

0

I was having a similar problem to yours recently. I found that this can be caused by a whole host of problems so I'll do my best to break it down.

Since you can connect via other computers, I am going to assume you have port forwarded correctly.

If you are trying to connect with your external IP from the same wifi as the server, I found that doesn't really work. Try connecting to it via someone else's wifi, or even the server's internal IP to see if that works.

Overall, try and think what is different between this computer and the others you've connected on. Best of luck.

Alex

Posted 2014-05-01T05:30:22.953

Reputation: 27