LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-17-2013, 04:24 AM   #1
WildBoy_from_ITALY
LQ Newbie
 
Registered: Dec 2013
Posts: 6

Rep: Reputation: Disabled
Connect to Debian from Win with ssh/putty - Error: "connection timed out"


I'm trying to ssh from my Win 8 machine using putty into a Linux Debian 6. But when I try in the last 3 day I get only: Error: connection timed out.


This is the output of netstat -ntlp | grep 22
Code:
root@95-170-82-133:/# netstat -ntlp|grep 22
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      6630/sshd       
tcp6       0      0 :::22                   :::*                    LISTEN      6630/sshd       
root@95-170-82-133:/#
Can anyone tell me how can I solve this error?
 
Old 12-17-2013, 04:46 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by WildBoy_from_ITALY View Post
I'm trying to ssh from my Win 8 machine using putty into a Linux Debian 6. But when I try in the last 3 day I get only: Error: connection timed out.


This is the output of netstat -ntlp | grep 22
Code:
root@95-170-82-133:/# netstat -ntlp|grep 22
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      6630/sshd       
tcp6       0      0 :::22                   :::*                    LISTEN      6630/sshd       
root@95-170-82-133:/#
Can anyone tell me how can I solve this error?
I don't know what kind of firewall Debian puts in place by default, but you might want to check if port 22 is open.

Also, can you ping to your Linux system?
And can you ping back from the Linux system to Windows?
 
Old 12-17-2013, 05:04 AM   #3
WildBoy_from_ITALY
LQ Newbie
 
Registered: Dec 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
this is the result of the ping to 95.170.82.133
http://oi43.tinypic.com/23ma9p4.jpg

I think linux answer back correctly
 
Old 12-17-2013, 05:22 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by WildBoy_from_ITALY View Post
this is the result of the ping to 95.170.82.133
http://oi43.tinypic.com/23ma9p4.jpg

I think linux answer back correctly
Yes.

To check the firewall, can you run the command iptables -S INPUT on the Linux system? You need to be root to do that.
 
Old 12-17-2013, 05:25 AM   #5
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by berndbausch View Post
Yes.

To check the firewall, can you run the command iptables -S INPUT on the Linux system? You need to be root to do that.
I just saw that you have a public IP address. I can ping 95.170.82.133 as well, and I can also connect to it with ssh. The problem must be your putty configuration.

Code:
[root@athlon64 pam_unix]# ping 95.170.82.133
PING 95.170.82.133 (95.170.82.133) 56(84) bytes of data.
64 bytes from 95.170.82.133: icmp_seq=1 ttl=49 time=288 ms
64 bytes from 95.170.82.133: icmp_seq=2 ttl=49 time=283 ms
^C
--- 95.170.82.133 ping statistics ---
3 packets transmitted, 2 received, 33% packet loss, time 2216ms
rtt min/avg/max/mdev = 283.666/286.327/288.989/2.714 ms
[root@athlon64 pam_unix]# ssh 95.170.82.133
The authenticity of host '95.170.82.133 (95.170.82.133)' can't be established.
RSA key fingerprint is 23:d6:f7:c3:54:68:60:e2:e7:41:f2:16:7a:3e:e1:24.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '95.170.82.133' (RSA) to the list of known hosts.
root@95.170.82.133's password:
 
Old 12-17-2013, 05:31 AM   #6
WildBoy_from_ITALY
LQ Newbie
 
Registered: Dec 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Here the output of firewall


Code:
root@95-170-82-133:/home/emanuel# iptables -S INPUT
-P INPUT DROP
-A INPUT -j ufw-before-logging-input 
-A INPUT -j ufw-before-input 
-A INPUT -j ufw-after-input 
-A INPUT -j ufw-after-logging-input 
-A INPUT -j ufw-reject-input 
-A INPUT -j ufw-track-input 
root@95-170-82-133:/home/emanuel#

PS: thank for your interest!
 
Old 12-17-2013, 05:36 AM   #7
WildBoy_from_ITALY
LQ Newbie
 
Registered: Dec 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by berndbausch View Post
I just saw that you have a public IP address. I can ping 95.170.82.133 as well, and I can also connect to it with ssh. The problem must be your putty configuration.

Mumble, with the same conf I can access via Putty to many other server, but from 3 day ago I can't connect to 95.170.82.133. I don't understand why!
 
Old 12-17-2013, 05:45 AM   #8
WildBoy_from_ITALY
LQ Newbie
 
Registered: Dec 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
I try to connect to 95.170.82.133 from another machine (Win 7) with a new installation of Putty but I still can't connect.
 
Old 12-17-2013, 06:27 AM   #9
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by WildBoy_from_ITALY View Post
Mumble, with the same conf I can access via Putty to many other server, but from 3 day ago I can't connect to 95.170.82.133. I don't understand why!
I can see that the Ubuntu firewall does things quite differently than my Centos firewall

Still, the fact is that I can connect to your system from thousands of kilometers away (if it is in Italy). Unfortunately I don't know enough about putty to help you.
You could find other SSH applications that run on Windows and test with them. Or boot your PC with a Linux LiveCD and see what happens. As I lean more towards UNIX, I use Cygwin and OpenSSH on my Windows PC.
 
Old 12-17-2013, 06:50 AM   #10
WildBoy_from_ITALY
LQ Newbie
 
Registered: Dec 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thank you so much berndbausch! You help me to debug my system.
In fact, with Aptana terminal that uses OpenSSH can connect to the remote server.

Greetings from Italy
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] problem with ssh/putty. Error: "connection timed out" nOrVow Linux - Server 8 07-15-2019 04:53 PM
SSH using putty throws "server unexpectedly closed connection" madhavanss Linux - Networking 4 03-16-2012 04:52 AM
Different SSH "Server unexpectedly closed network connection" (using Putty) mjwraw Linux - Networking 4 07-22-2009 07:23 AM
Error: "Could not connect data socket, Connection timed out." tigerflag Linux - Software 5 01-17-2006 01:26 AM
SSH PuTTy gives "connection refused" Sathington Linux - Networking 5 03-18-2004 05:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration