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.

  • 0 Users Found This Useful

Was this answer helpful?

Related Articles

How to install Litespeed Web Server on CentOS 7.x with cPanel?

LiteSpeed is the famous popular web server and drop-in replacement of Apache webserver. It...

How to install Mongodb in CentOS?

MongoDB is a Free and open-source cross-platform document-oriented database program. Classified...

R1Soft : An error occurred while loading the hcpdriver module

R1soft CDP backup allows for full server backup and you can use it to perform the bare metal...

DOS AND DON'TS FOR Linux VPS

Dos and Don'ts for Linux Classic VPS, SSD VPS, and Linux Private Cloud VPS : Please allow...

How To Install Docker on Ubuntu 18.04?

Docker is a container-based tool used to create, deploy, and run the applications by using...