[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 689
  • Last Modified:

SSH Connection refused 5 minutes after last session was established

I'm running Linux RedHat 5.
Have a problem connecting to the server via SSH .
To solve it , I'm opening SSH session locally from this server to some other host .
The I'm trying to open SSH to that server remotely again and it works.
5 minutes after then , the session disconnecting and I receiveing again the Connection Refused message.
1 Solution
first try to see more output wehn you run ssh

ssh -vvv remote@host

this gives you idea what is going wrong..
aquaswAuthor Commented:
This is the output :

OpenSSH_4.3p2, OpenSSL 0.9.8b 04 May 2006
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to remotehost [remotehost] port 22.
debug1: connect to address remotehost port 22: Connection refused
ssh: connect to host remotehost port 22: Connection refused

Can you check if you have another server / equipment connected to the network with duplicate IP address?

It could be that you have another system with the same IP address.

Can you check the arp table when you get the connection and after it get refused and compare the MAC addresses (if both servers are on the same subnet)?

arp -a
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

"Connection refused" messages are generally due to firewall blocking the request.  Do you have a firewall between the two servers or running on the server with ssh?
I would bet on conflicting IP address. Had similar cases which looked quite the same.
hi, please look at the syslog file(ex: messages) on the server and determine the cause of the ssh crash. maybe your ssh server went down unexpectidly, you may have a sshd update.
aquaswAuthor Commented:
Thanks, the problem was in the duplicate IP ...

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now