The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
grep unix.com with google



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

Reply
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-24-2009
Registered User
 

Join Date: Nov 2009
Posts: 2
"Connection closed by remote host" while doing ssh to a solaris box

Hi All,

When i try to do ssh from a linux to solaris box its throughing "Connection closed by remote host". Please not that this error is not occuring every time i do ssh, it occurs at random timing( Mostly ssh is successful) - unfortunately my script which is doing ssh is falling at this time slot when ssh is not working. Please suggest me some solution for this....
  #2 (permalink)  
Old 11-24-2009
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 6,006
Not enough information for us to give a good answer. For example, are trying to connect as root? Does your connect fail at the same time? Can you make other connections during the time when the script has problems? Did you check the network, sshd on the remote box?
  #3 (permalink)  
Old 11-24-2009
chakrapani's Avatar
Registered User
 

Join Date: Sep 2009
Location: Asia
Posts: 87
can you change the script to have more debug info so that when it fails you can get why it failed.


Incase you are not interested in solving network issue and just want the script to work ... then try this ...


Code:
RR=22 # non zero
until [ "$RR" = "0" ]
do
  echo " trying "
  ssh user@BADhost "ls" 
  RR=$?
  sleep 50 # Just so that next try is done after some time. 
done

This could be a temp fix ... but it is always advised to check with n/w and solve the problem.
  #4 (permalink)  
Old 11-24-2009
Registered User
 

Join Date: Nov 2009
Posts: 2
Thanks for replying...
1. I am not trying this as root but ssh key for my account all in place.
2. Connection fail timwe is varying.. for example one day my script is working fine and the other day it couldnt as it throw" connection closed by remote host" error whe it runs.
3. Other connections are fine... problem occurs when we try to connect one solaris box alone

Network connection all everything is fine..... by 6:35 AM we are having problem and by 6:40 the problem is getting solved. And like this its repeating on various timing
  #5 (permalink)  
Old 11-25-2009
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 6,006
There is something wrong on the one system. You need to have the sysadmin turn on
a lot more logging - i.e., change the syslog.conf and sshd_conf (LogLevel settings) files for that one server.

Intermittent problems like this are painful to resolve sometimes. This is really a sysdmin issue, if things are as you describe. I doubt that you can do much to resolve it.
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ssh_exchange_identification: Connection closed by remote host Connection closed jeevan_fimare UNIX for Dummies Questions & Answers 1 02-05-2009 01:43 AM
ssh_ exchange-identification: Connection closed by remote host vguleria Linux 3 11-20-2008 05:31 AM
ssh_exchange_identification: Connection closed by remote host Satyak Shell Programming and Scripting 1 08-18-2008 10:27 AM
"421 service not available, remote server has closed connection."? vishaldsh Security 1 09-19-2007 12:12 AM
FTP - Connection Closed By Remote Host mouglybean IP Networking 1 10-26-2004 10:15 AM



All times are GMT -4. The time now is 01:24 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0