LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Connect to Debian from Win with ssh/putty - Error: "connection timed out" (https://www.linuxquestions.org/questions/linux-server-73/connect-to-debian-from-win-with-ssh-putty-error-connection-timed-out-4175488269/)

WildBoy_from_ITALY 12-17-2013 04:24 AM

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?

berndbausch 12-17-2013 04:46 AM

Quote:

Originally Posted by WildBoy_from_ITALY (Post 5082156)
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?

WildBoy_from_ITALY 12-17-2013 05:04 AM

this is the result of the ping to 95.170.82.133
http://oi43.tinypic.com/23ma9p4.jpg

I think linux answer back correctly

berndbausch 12-17-2013 05:22 AM

Quote:

Originally Posted by WildBoy_from_ITALY (Post 5082179)
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.

berndbausch 12-17-2013 05:25 AM

Quote:

Originally Posted by berndbausch (Post 5082189)
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:


WildBoy_from_ITALY 12-17-2013 05:31 AM

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! ;)

WildBoy_from_ITALY 12-17-2013 05:36 AM

Quote:

Originally Posted by berndbausch (Post 5082194)
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!

WildBoy_from_ITALY 12-17-2013 05:45 AM

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.

berndbausch 12-17-2013 06:27 AM

Quote:

Originally Posted by WildBoy_from_ITALY (Post 5082205)
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.

WildBoy_from_ITALY 12-17-2013 06:50 AM

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


All times are GMT -5. The time now is 04:15 AM.