ssh-keyscan has no output

I had the same issue (no output being given) and it was because the default timeout (5 seconds) was too short. I resolved this by using the -T flag which allows me to set my own custom timeout (in seconds). Illustrative example with 240 second timeout and random IP address:

ssh-keyscan -T 240 52.213.86.118

This does sound like a network problem to me.

The first thing that I would do is try telnetting to various SSH servers on port 22, something like the following:

$ telnet local-git-server 22

followed by:

$ telnet github.com 22

When you run this, you should see similar output to the following:

Escape character is '^]'. SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u2

This is a good indication that ssh is permitted without any firewall restrictions.

  • What was the end result from ssh-keyscan?
  • What did it print, if anything?
  • Does the telnet hang for several seconds? Do you get a connection refused or connection rejected response?
  • If you run netstat -an --tcp do you see several TCP entries that are in SYN_SENT state? If so, this would indicate there is something blocking at the network layer

Try running ssh-keyscan -p <PORT> <IP> if your ssh server is not running on default port

Tags:

Ssh

Openssh