I have a following problem: I can't connect to a freshly deployed ubuntu-server 11.10 through SSH from a remote host. Error: Connection timeout.

Troubleshooting so far:

  1. Connect locally - Connecting through SSH on a local network works like a charm.
  2. Check the router - There are no rules that can impact ssh traffic.
  3. Check the distro - If I launch a Ubuntu-desktop liveCD on the same machine - everything works as it should.

So, the distro's default configuration seems to be the culprit.

Configuration details:
- OpenSSH has been installed through selecting a role during the installation. - Other than that everything is configured by default.

Verbose SSH output:
Here's the output, everything freezes after trying to estabilish a connection (Port 2102 is forwarded to port 22 on the server):

ssh -vvv -p 2102 myhost
OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to myhost [hostip] port 2102.
debug1: connect to address hostip port 2102: Operation timed out
ssh: connect to host myhost port 2102: Operation timed out

Can anyone tell me what could be the problem?

  • 1
    Well, the distro's "default configuration" is "no open ports by default", so openssh-server does not get installed automatically. But once you install it, there should be no problems connecting. Basically, I'm saying I don't know. (To me step 2 -- router configuration -- seems most likely, but in that case I can't explain why you can connect to a livecd running on the same machine. More details could be useful.) – Marius Gedminas Feb 19 '12 at 13:47
  • like @MariusGedminas says -"... More details could b useful." – maniat1k Feb 19 '12 at 14:39
  • I'm willing to provide them. What details do you require? – Temikus Feb 19 '12 at 15:22
  • Well, first, on the server, can you do `netstat -tnlvp|grep :22' and put the output in your question? That will tell us on what interface the ssh server is listening (ought to be, i.e. all of them). – Marius Gedminas Feb 19 '12 at 15:28
  • 1
    google "debug2: ssh_connect: needpriv 0" u will find the results – One Zero Feb 20 '12 at 8:22

I think my router screws up DNS retranslation.
Following options in the sshd_config fixed the issue, at least partially:

UseDNS no
GSSAPIAuthentication no
  • I'm surprised that you saw a timeout and not merely a delay of a few seconds, but switching these options off is indeed a good idea most of the time. – Gilles 'SO- stop being evil' Feb 20 '12 at 9:56

Your Answer

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

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