LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-15-2010, 01:15 PM   #1
kvarkki
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Rep: Reputation: 0
Unhappy Can't SSH to some remove hosts: Connection Closed by Remote Host


I get also the error message:
"ssh_exchange_identification: Connection closed by remote host"

Earlier I did not get it.

I have several servers and several clients. I get that message, but not for every client. I had possibility to remove all keys from one server and from the clients but the problem did not disappear. It seems that one server have started to reject some clients, but not all clients.

Some of the clients are identical embedded systems with identical settings. The only difference is the IP. When one embedded Linux was rejected, then also the other identical devices were rejected.

The rejected computers were my laptop and the embedded systems. Before this occasion I had changed the keys in my laptop and in the embedded systems and in the server. After this problem I removed all keys, but it did not fix the problem. After it a put new keys everywhere using a non-rejected computer, but the problem did not disappear.

So it seems when the host rejects some clients, the rejecting criteria is possible the computer name??? And it possible starts to reject the client when it first time detects false keys? (The keys were false for a while when I had changed the keys only to the other end.)

The only change what was made, was the keys.

What to do? (I have not root rights to the servers.)
 
Old 02-16-2010, 12:11 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
First check the permissions used for your home directory. It should not be world readable. Also check the permissions of your ~/.ssh/ directory and your private key. These will cause a login failure if the server has 'StrictModes Yes' in sshd_config.

If the server has 'UseDNS Yes' in sshd_config, you may have an entry in /etc/hosts that doesn't match. Also which appears first 'host' or 'host.domain' can cause a failure to log in, if it doesn't match an 'AllowUsers' entry.

I'm moving your post to its own thread in the Linux Server forum where it belongs. Please don't resurrect 3 month old posts. You can include a link to another thread as reference.

Last edited by jschiwal; 02-16-2010 at 12:24 PM.
 
Old 02-17-2010, 03:50 AM   #3
kvarkki
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jschiwal View Post
First check the permissions used for your home directory. It should not be world readable. Also check the permissions of your ~/.ssh/ directory and your private key. These will cause a login failure if the server has 'StrictModes Yes' in sshd_config.
Thank you of the hints. The problems started when I manipulated the keys. But like I said, I had a possibility to remove all the keys. I removed them and tried with password. The host gave still the message "ssh_exchange_identification: Connection closed by remote host"

So the rights of the keys can't be the problem, because there are no more keys.

The problems were at my job. Now I am home and have no possibility to check the embedded linux devices, but I can test the server with my laptop. I have no more problems with my laptop here at home. Has it possible something to do with the fact that now I use ssh via internet, at job I used local network?

Quote:
Originally Posted by jschiwal View Post
If the server has 'UseDNS Yes' in sshd_config, you may have an entry in /etc/hosts that doesn't match. Also which appears first 'host' or 'host.domain' can cause a failure to log in, if it doesn't match an 'AllowUsers' entry.
I have changed nothing in these lists.

Quote:
Originally Posted by jschiwal View Post
I'm moving your post to its own thread in the Linux Server forum where it belongs. Please don't resurrect 3 month old posts. You can include a link to another thread as reference.
My post was first post to this forum. I found the discussion by googling the error message. I see that this discussion subject has started already year 2004 and the last entry was only 3 months old. So I thought that this subject is still active. (In some other forums I have noticed that some subjects stay active for years.)
 
Old 02-17-2010, 05:49 AM   #4
andycol
Member
 
Registered: Jul 2009
Location: South Africa
Posts: 38

Rep: Reputation: 16
do rm /root/.ssh/known_hosts

or change root to ur profile whatever it is
 
Old 02-18-2010, 02:32 AM   #5
kvarkki
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by andycol View Post
do rm /root/.ssh/known_hosts
or change root to ur profile whatever it is
I have removed the .ssh directory complete from the host and from the client. I still get the message: "ssh_exchange_identification: Connection closed by remote host"
(It seems that nobody knows the answer, people are only quessing. Refer also to http://www.linuxquestions.org/questi...052/page1.html )
 
Old 02-18-2010, 06:44 AM   #6
kvarkki
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Original Poster
Rep: Reputation: 0
The problem has been solved. The problem was caused by the protection software "denyhosts" in the server. More than three logins with wrong keys/password puts you to blacklist.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't SSH to remote machine: Connection closed by remote host Avatar Linux - Networking 35 10-23-2017 12:21 AM
SSH Problem RHEL -> AIX Connection closed by remote host unixteam Linux - Networking 6 03-03-2010 11:29 PM
ssh_exchange_identification: Connection closed by remote host marafa Linux - Server 8 09-30-2008 05:06 AM
ssh_exchange_identification: Connection closed by remote host liguorir Linux - Software 3 09-18-2003 11:42 AM
ssh_exchange_identification: Connection closed by remote host ctav01 Linux - Networking 1 08-22-2003 07:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration