"Connection closed by remote host" while doing ssh to a solaris box


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users "Connection closed by remote host" while doing ssh to a solaris box
# 1  
Old 11-24-2009
"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  
Old 11-24-2009
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  
Old 11-24-2009
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  
Old 11-24-2009
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  
Old 11-25-2009
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

What is the significance of sh -s in ssh -qtt ${user}@${host} "sh -s "${version}"" < test.sh?

Please can you help me understand the significance of providing arguments under sh -s in > ssh -qtt ${user}@${host} "sh -s "${version}"" < test.sh (4 Replies)
Discussion started by: Sree10
4 Replies

2. Solaris

"Connection closed by foreign host error" in Solaris 10

Version Details Solaris version : Oracle Solaris 10 8/11 s10x_u10wos_17b X86 $ uname -a SunOS tippy178 5.10 Generic_147441-01 i86pc i386 i86pcThe Issue +++++++++ I have two solaris 10 Virtual Machines created using Virtual Box. One of my applications running on Source was trying to connect... (9 Replies)
Discussion started by: kraljic
9 Replies

3. Red Hat

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': 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... (3 Replies)
Discussion started by: jaapar
3 Replies

4. Solaris

"Connection closed by" error

OS: Solaris 8 Sparc server1:userA:/home/userA# ssh userB@server1 Connection closed by < IP address> Problem: From being a userA, I am unable to connect/ssh to the same server as when trying to use a different account. (userB) Do you know where can i start checking? Here are some... (3 Replies)
Discussion started by: hrist
3 Replies

5. Shell Programming and Scripting

shell script/telnet - Remove/Control "Connection closed by foreign host"

How do I gain control of the "Connection closed by foreign host" message telnet yields when you connect to it in a shell script? I'm using the output: #!/usr/local/bin/bash count=$(ping -c 1 $1 | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }') if ; then echo "$1 PING "... (2 Replies)
Discussion started by: phpfreak
2 Replies

6. UNIX for Dummies Questions & Answers

ssh_exchange_identification: Connection closed by remote host Connection closed

Hi Everyone, Good day. Scenario: 2 unix servers -- A (SunOS) and B (AIX) I have an ftp script to sftp 30 files from A to B which happen almost instantaneously i.e 30 sftp's happen at the same time. Some of these sftp's fail with the following error: ssh_exchange_identification: Connection... (1 Reply)
Discussion started by: jeevan_fimare
1 Replies

7. Linux

ssh_ exchange-identification: Connection closed by remote host

Dear All, Recently our server has been giving the error: "ssh_ exchange-identification: Connection closed by remote host" The error causes the server to become in accessible via ssh and the services are stopped/hung. The server has to be restarted to make it working normal again. The... (3 Replies)
Discussion started by: vguleria
3 Replies

8. Shell Programming and Scripting

ssh_exchange_identification: Connection closed by remote host

hi i am trying to connect the frontend server using ssh i got the following error ssh_exchange_identification: Connection closed by remote host can anyone help please (1 Reply)
Discussion started by: Satyak
1 Replies

9. Cybersecurity

"421 service not available, remote server has closed connection."?

"421 service not available, remote server has closed connection." I tried to do ftp to one of the unix server . ftp hostname password It get connects when i do any command it throws error ftp> ls "421 service not available, remote server has closed connection." (1 Reply)
Discussion started by: vishaldsh
1 Replies

10. IP Networking

FTP - Connection Closed By Remote Host

Hi, I am having a problem with our AIX 4.3.3 Server accessing FTP. The error is " Connection Closed By Remote Host". Scenario: Since i put a default gateway on the server FTP connection is having a problem but when i remove the default gateway it will works fine.. Is there any way not... (1 Reply)
Discussion started by: mouglybean
1 Replies
Login or Register to Ask a Question