Can't ssh into server, connection refused

32,050

Solution 1

In the past I've had this problem and solved it by using a LAN IP to connect to the server, instead of the domain name or hostname.

Solution 2

I'm not sure about MobaXterm, but I know PuTTY stores known server SSH fingerprints in the registry, and some versions made it quite difficult to connect to a server if its fingerprint had changed (and weren't very verbose in their diagnostic output).

Could it be that the fingerprint for your server has changed and your terminal program is protecting you from bad things?

Share:
32,050

Related videos on Youtube

ksnortum
Author by

ksnortum

Updated on September 18, 2022

Comments

  • ksnortum
    ksnortum over 1 year

    I can't ssh into my server. The server is on a private network administrated by me. Ubuntu is version 14.04. This started when I changed to a wired ethernet card. The client is MobaXTerm (latest) on Windows 7. This is what I have done:

    • The client can ping the server
    • The server can ping the client
    • I can ssh localhost on the server with no problems
    • ufw status shows port 22 open
    • netstat -l shows port 22 listening

    I did a iptable --list but honestly I'm not sure of what I'm seeing. Here are the lines that have ssh in them:

    ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
    ACCEPT udp -- anywhere anywhere udp dpt:ssh
    

    I'd post the whole output except that I have no good way to get it off the server.

    All suggestions are welcome.

    • Sean
      Sean almost 10 years
      Perhaps the server settings is the issue. I'd review /etc/ssh/sshd_config on the server. You want, at least to start, to allow password authentication with "PasswordAuthentication yes" (that's the default setting).
    • ksnortum
      ksnortum almost 10 years
      sshd_config has PasswordAuthentication set to yes.
    • Sean
      Sean almost 10 years
      If possible I'd try your ssh client on a Linux machine to eliminate any question of the issue being with the Windows program. I use Cygwin ssh on Windows to connect to Ubuntu ssh servers but have no experience with MobaXTerm.
    • Panther
      Panther almost 10 years
      Cygwin is a bit of overkill =) , I suggest you use PuTTy, it is freely available and portable - chiark.greenend.org.uk/~sgtatham/putty/download.html
    • ksnortum
      ksnortum almost 10 years
      I've tried PuTTy, same message.
  • user285808
    user285808 almost 10 years
    Yes, but had you used putty to connect to the server before you changed to a wired connection? If so it could be refusing to let you access because it doesn't match the one stored in the registry.
  • a different ben
    a different ben about 8 years
    Keys seem to be shared amongst Cygwin, PuTTy, and WinSCP... all of these were refusing my attempts to connect to a server that had changed. Using the IP worked, but I haven't tried to find how to remove the hostname/domain-based key yet.