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

How to set Automate Tasks on a Linux VPS Using Cron?

One of our Linux VPS customers faced an issue wherein his Virtual Machine’s system clock was...

How to Disable SSH Login for the Root User in Linux?

Please refer to the following article to disable root login using SSH in Linux.  Login to your...

How to configure Automatic Updates with yum-cron on CentOS 7?

It is very essential to update your Centos system for the security perspective. Your system may...

How to set up a cron to take MySQL Database Backup daily and remove the older backup files that are older than 10 days?

Login to your Linux server using ssh. Open your crontab using the below command Crontab -e...

How to Disable SELinux on CentOS?

SELinux called Security-Enhanced Linux is a security module of Linux kernel which provides...

  • 0 Users Found This Useful

Was this answer helpful?