Unable to SSH into machine - ssh_exchange_identification: Connection closed by remote host | Unix Linux Forums | Red Hat

  Go Back    


Red Hat Red Hat is the world's leading open source technology solutions provider with offerings including Red Hat Enterprise Linux (RHEL), Fedora, open source applications, security and systems management, virtualization, and Services Oriented Architecture (SOA) solutions.

Unable to SSH into machine - ssh_exchange_identification: Connection closed by remote host

Red Hat


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 09-24-2010
jaapar jaapar is offline
Registered User
 
Join Date: Jul 2010
Last Activity: 28 February 2012, 2:31 PM EST
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Unable to SSH into machine - ssh_exchange_identification: Connection closed by remote host

For a few days now I have been experiencing issues when trying to SSH into 1 of my machine. I get the following output when running 'ssh -vvv':


Code:
server1:/home/mymadq> ssh -l root -vvv server2
OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to server2 [138.54.45.50] port 22.
debug1: Connection established.
debug1: identity file /home/user1/.ssh/identity type -1
debug3: Not a RSA1 key file /home/user1/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'Proc-Type:'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'DEK-Info:'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /home/user1/.ssh/id_rsa type 1
debug1: identity file /home/user1/.ssh/id_dsa type -1
ssh_exchange_identification: Connection closed by remote host
server1:/home/user1>

Sponsored Links
    #2  
Old 09-24-2010
citaylor's Avatar
citaylor citaylor is offline
Registered User
 
Join Date: Jul 2010
Last Activity: 9 August 2011, 2:12 AM EDT
Location: Somerset, UK
Posts: 405
Thanks: 0
Thanked 72 Times in 70 Posts
I would say user1's private key file is corrupt for some reason (/home/user1/.ssh/id_rsa).
If view the file and compare it to another private key file (you can generate an example keyfile using something like: "ssh-keygen -t rsa -f foobar")
Sponsored Links
    #3  
Old 09-26-2010
julian.ijere julian.ijere is offline
Registered User
 
Join Date: Sep 2010
Last Activity: 29 October 2010, 1:41 AM EDT
Location: Nigeria
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
If you don't have another private key to compare with, then you'll need to re-generate you key pairs, but first, delete the .ssh folder in your ~. And probably generate a dsa keytype which supports ssh version 2 better

server2:/home/user1>ssh-keygen -t dsa

---------- Post updated at 09:54 AM ---------- Previous update was at 09:54 AM ----------

If you don't have another private key to compare with, then you'll need to re-generate you key pairs, but first, delete the .ssh folder in your ~. And probably generate a dsa keytype which supports ssh version 2 better

server2:/home/user1>ssh-keygen -t dsa
    #4  
Old 09-26-2010
citaylor's Avatar
citaylor citaylor is offline
Registered User
 
Join Date: Jul 2010
Last Activity: 9 August 2011, 2:12 AM EDT
Location: Somerset, UK
Posts: 405
Thanks: 0
Thanked 72 Times in 70 Posts
Personally, I wouldnt recommend deleting the .ssh dir in your home directory. It may contain other files that you use (known host keys, other personal trusted keys, etc).
If you delete files, within .ssh, begining with "id_*" you should be fine.

Judging from your original post you were using "rsa" keys, so you will need "-t rsa" as opposed to "-t dsa".

I hope this helps...
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
"Connection closed by remote host" while doing ssh to a solaris box pkumar7 UNIX for Advanced & Expert Users 4 11-25-2009 10:42 AM
ssh_exchange_identification: Connection closed by remote host Connection closed jeevan_fimare UNIX for Dummies Questions & Answers 1 02-05-2009 12:43 AM
ssh_ exchange-identification: Connection closed by remote host vguleria Linux 3 11-20-2008 04:31 AM
ssh_exchange_identification: Connection closed by remote host Satyak Shell Programming and Scripting 1 08-18-2008 09:27 AM
FTP - Connection Closed By Remote Host mouglybean IP Networking 1 10-26-2004 09:15 AM



All times are GMT -4. The time now is 07:37 PM.