Operating System - HP-UX
1834140 Members
2961 Online
110064 Solutions
New Discussion

Transferring file via SSH

 
Alex_145
Occasional Contributor

Transferring file via SSH

People, HI!
Thanks for previous advices and help me please again!

Basic data and sequence of operations:
1. Have SSH client with program interface (can call get and send methods).
2. Connect to the HP-UX (standard SSH Server).
3. Send next commands:
stty -echo
cat >file1 2>/dev/null
... here I open file on the client machine, read buffers (or) strings and send them to the server
" pSSHControl->send(pBuff);"
... when reach end of the file I send
\x04\x04
stty echo
... and close connection.
THE PROBLEM: the transferred file on the server is corrupted - some packets what I sent from client are missed. SSH client sends packets right (checked by tracing).
Single known solution at this moment - send small bits (packets with small size or single source file line) and wait (call sleep ~ 1...1000 ms) after every bit sending. But in this case the sending time is very long...
Seems that SSH Server or tty, cat.. , don't know who well on the server side, can't process incoming packages so quickly as client sends and loses them.
May be anybody have any idea about this issue?
May be somebody had similar problem.
In other words - welcome any suggestion!
Thanks.
4 REPLIES 4
Bill Hassell
Honored Contributor

Re: Transferring file via SSH

Sounds like there is no handshake protocol going on. Make sure the port has ixon and ixoff enabled as part of the initialization for the port. ixon and ixoff are particularly important for LAN connections like telnet. Without ixoff, pasting large amounts of data into a character-processing program like vi will see missing records and characters due to overrun.


Bill Hassell, sysadmin
twang
Honored Contributor

Re: Transferring file via SSH

Steven E. Protter
Exalted Contributor

Re: Transferring file via SSH

My approach to the problem would be to use scp and trasnfer the file with public keys already exchanged.

Chris Vail's fantastic doc attached.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jimmy Rogers
Frequent Advisor

Re: Transferring file via SSH

We are having this same problem. We are using OpenSSH_3.4p1. Could anyone be more specific about setting ixon/ixoff on ports?