Executing a remote command with ssh sometimes hangs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have a strange problem, where ssh _sometimes_ hangs when executing a command on a remote machine. I have a shell script, which deletes some files on remote machines. The executed command is something like:

   ssh host "rm /path/to/file </dev/null 2>/dev/null 1>/dev/null"

Normally this work just fine and returns immediately. But about 5-10% of the calls hang and never return - so my script hangs too, waiting for ssh to terminate :-( I'm using "OpenSSH_2.9p2" and the server I'm conneting to runs "OpenSSH_3.9p1". Unfortunately it's not possible to update those installations. I discovered the problem disappears when using SSH version 1. Using the following command I was able to delete thousands of files without any problems:

   ssh -1 host "rm /path/to/file </dev/null 2>/dev/null 1>/dev/null"

Any ideas what could cause this problem are greatly appreciated!

Regards,
Christian Koch

[Index of Archives]     [Open SSH Unix Development]     [Fedora Users]     [Fedora Desktop]     [Yosemite Backpacking]     [KDE Users]     [Gnome Users]

  Powered by Linux