Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Conection Refused on linux ssh error (how i fixed this)
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Conection Refused on linux ssh error (how i fixed this)

I was not able to connect to my linux Debian flavor server via ssh,
i get this error: Connect Refused

How i fixed it:

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

1. You must Log into VPS through console and follow the below 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. You might get this warning: REMOTE HOST IDENTIFICATION HAS CHANGED",
You must then rename the known_hosts from .ssh/ in your local machine and try the commands again.

solved.

Comments

  • @simdia said:
    2. You might get this warning: REMOTE HOST IDENTIFICATION HAS CHANGED",
    You must then rename the known_hosts from .ssh/ in your local machine and try the commands again.

    This is probably not a good idea. It's far better to simply remove the line in question from the file since people might have many machines they connect to whose hashes are stored here. The whole point of this file is to ensure the remote machine is actually the one it's supposed to be.

  • @JustAMacUser said:

    @simdia said:
    2. You might get this warning: REMOTE HOST IDENTIFICATION HAS CHANGED",
    You must then rename the known_hosts from .ssh/ in your local machine and try the commands again.

    This is probably not a good idea. It's far better to simply remove the line in question from the file since people might have many machines they connect to whose hashes are stored here. The whole point of this file is to ensure the remote machine is actually the one it's supposed to be.

    full ack

  • This is very common in KVM installs ..you can install OpenSSH in the first install process. That's all.

  • @JustAMacUser said:

    @simdia said:
    2. You might get this warning: REMOTE HOST IDENTIFICATION HAS CHANGED",
    You must then rename the known_hosts from .ssh/ in your local machine and try the commands again.

    This is probably not a good idea. It's far better to simply remove the line in question from the file since people might have many machines they connect to whose hashes are stored here. The whole point of this file is to ensure the remote machine is actually the one it's supposed to be.

    +1

    You said

    There were unknown changes made in /etc/ssh/ssh_configfile

    Who made those changes?

    If you don't know who made those changes ...you have a compromised box...

    And if you made those changes ...always make a backup of config files...

    Thid way you could always restore the backup using serial console provided by almost every provider

    Just my 2 cents

  • noaman said: And if you made those changes ...always make a backup of config files...

    This is a really good point. Whenever I make changes to really important config files, I make a backup first, then diff the two files when I'm all done (before restarting the service). Helps avoid PEBKAC errors, etc.

Sign In or Register to comment.