Fix :: Linux SSH error "connection refused"

Problem Statement


Can't connect to a Linux server(Debian Flavour) via SSH.

Error Message


Connection refused

Solution


There were unknown changes made in  /etc/ssh/ssh_configfile. To fix this issue, we had installed OpenSSH server following below mentioned steps:

  1. Logged into VPS through console and fired following commands:

    sudo apt-get purge openssh-server
    mv /etc/ssh /etc/ssh_old
    created new ssh directory in /etc
    sudo apt-get install openssh-server​
  2. Try ssh after performing above steps. If you get "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED", rename the known_hosts from .ssh/ in your local machine and try again.

Related Articles

What is IP forwarding in Linux? How to enable IP forwarding?

IP forwarding helps you to set up the OS to work as a router. You can set IP forwarding when you...

How to Setup NTP Server in CentOS?

NTP enables the automatically sync your system time with a remote server. With the help of NTP...

How to Install and Configure Fail2ban on Ubuntu?

You require to protect your server from a Brute force attack from the internet. You can do it...

How to install IonCube Loader on CentOS 7 Manually?

Ioncube is a PHP module which protects the PHP application's source code from being viewed from...

How you can change the ip address of the domain in Webmin control panel?

Following are the steps to change the IP Address of the domain in Webmin control panel. Login...

  • 0 Users Found This Useful

Was this answer helpful?