I have a client server under Debian Wheezy.

It can not connect to a server that has a special opened port for ssh (let us say 2222).

All other clients I use (from other sites) can connect to my server.

If I run:

#$ ssh -vvv -p 2222 user@x.x.x.eu
OpenSSH_6.0p1 Debian-4+deb7u2, OpenSSL 1.0.1e 11 Feb 2013
debug1: Reading configuration data /home/admpads/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to x.x.x.eu [x.x.x.x] port 2222.
debug1: connect to address x.x.x.x port 2222: Connection timed out
ssh: connect to host x.x.x.eu port 2222: Connection timed out

So I checked all iptables, hosts.deny/allow. Nothing. On both sides

Mystery gets darker with the following (after all firewall rules are disabled):

Port 10222

On server side, I run:

sudo /usr/sbin/sshd -Ddp 10222

On client side, I try:

ssh -vvv -p 10222 user@x.x.x.eu

Same problem: Connection timed out

Port 22

On server side, I run: sudo /usr/sbin/sshd -Ddp 22

On client side, I try:

ssh -vvv user@x.x.x.eu

Result: it works.

But I do not want to use port 22, so do someone has any clues, tools to debug and find where this problem comes from ?

  • First of all you need to ensure that sshd is really listening to port 10222. So after sudo /usr/sbin/sshd -Ddp 10222 run netstat -antep |grep 10222 – user1700494 Feb 5 '16 at 15:25
  • Yes, it is reachable by other clients through this port – lauhub Feb 5 '16 at 15:27
  • Something between you and the server is blocking your connections. – Iain Feb 5 '16 at 15:34
  • Run tcpdump on the server. Listen on the interface and filter for traffic on the port sshd is running on. e.g. 2222. Look for incoming connections. If you see no incoming connections from your client then you know something is preventing the flow of traffic between the client and server. – Mike Marseglia Feb 5 '16 at 15:50
  • That is the case: something is blocking the traffic. Actually, the network administrator of the client had added a firewall rule that blocked my traffic... without warning me. Thank you for you help. – lauhub Feb 5 '16 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.