i use ssh2_scp_send() function to send files from a server to another one via ssh way. The test script and the real application run just fine on my Ubuntu workstation, between it and a distant server, and between my Windows PC and a development CentOS 5.0 Linux server at my office. In my customer place, the ssh2_scp_send() stop, return false, and the sent file is truncated (2MB for a 6.5MB). The sender and the receiver server use both CentOS 5.5, and are virtual servers on a VmWare Vsphere hypervisor. There is a virtual local network between the two. Smaller files are not truncated. There is plenty of disk space on each server.
Here is the test script :
$source = '/sourcefile.dat';
$dest = '/destfile.dat';
$serveur = 'sshserver';
$login = 'login';
$sPub = 'public_key';
$sPriv = 'private_key';
$passphrase = 'pass';
$aSSHMethods = array(
'kex' => 'diffie-hellman-group1-sha1',
'client_to_server' => array(
'crypt' => '3des-cbc,aes256-cbc,aes192-cbc,aes128-cbc',
'comp' => 'none'),
'server_to_client' => array(
'crypt' => '3des-cbc,aes256-cbc,aes192-cbc,aes128-cbc',
'comp' => 'none'),
);
$rSSH = ssh2_connect($serveur, 22, $aSSHMethods);
ssh2_auth_pubkey_file($rSSH, $login, $sPub, $sPriv, $passphrase);
ssh2_scp_send($rSSH, $source, $dest);
I tried to replace ssh2_scp_send() by a ssh2_sftp/fopen/fwrite/fclose, but it run the same way, and is slower.
How can I understand why the transfert hang? The sshd logs on destination server just show connection and deconnection.
Thanks