Re: SCPing a file from UNIX to Windows - scp : Invalid argument



This is just a guess but, it might have something to do with
/shared/home/mrsop/.ssh/clotest_rsa /tmp/TESTCLO.TXT being an empty
file. Or at least scp seems to think it's an empty file judging from
this line, "Sending file modes: C0664 0 TESTCLO.TXT"

Knowing what ssh server you are running on the windows machine might
be helpful too.


On 6/18/07, Hariram, Sankarlal
<Sankarlal.Hariram@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Hi

My UNIX SSH Version - OpenSSH_3.8.1p1, OpenSSL 0.9.7d 17 Mar 2004.

When I try to scp a file from my unix machine to a windows box, I am not
able to scp the file, and I am getting the error - scp : Invalid
argument. However, when I use the same command to scp the file to a
different windows box, I am able to scp the file successfully.

The SSH Tectia version is different in both the windows box. I am not
sure if this is causing any problem. Can someone, share their expertise
on this and help me ? I have provided the command and the verbose log
of the same. Thanks.

========================================================================
===============

The SSH Tectia version at the destination is 4.4.2.3 SSH Secure Shell

scp -P 51722 -i/shared/home/mrsop/.ssh/clotest_rsa /tmp/TESTCLO.TXT
clogmkdl@WindowsBox:/F:/apps/clo/hk/equinox/TMP.20989.TESTCLO.TXT

And attached is the verbose log.

OpenSSH_3.8.1p1, OpenSSL 0.9.7d 17 Mar 2004
debug1: Reading configuration data /usr/local/openssh/etc/ssh_config^M
debug1: Connecting to WindowsBox [WindowsBox ip] port 51722.^M
debug1: Connection established.^M
debug1: identity file /shared/home/mrsop/.ssh/clotest_rsa type 1^M
debug1: Remote protocol version 2.0, remote software version 4.4.2.3 SSH
Secure Shell Windows NT Server^M
debug1: no match: 4.4.2.3 SSH Secure Shell Windows NT Server^M
debug1: Enabling compatibility mode for protocol 2.0^M
debug1: Local version string SSH-2.0-OpenSSH_3.8.1p1^M
debug1: SSH2_MSG_KEXINIT sent^M
debug1: SSH2_MSG_KEXINIT received^M
debug1: kex: server->client aes128-cbc hmac-md5 none^M
debug1: kex: client->server aes128-cbc hmac-md5 none^M
debug1: sending SSH2_MSG_KEXDH_INIT^M
debug1: expecting SSH2_MSG_KEXDH_REPLY^M
debug1: Host 'WindowsBox ip' is known and matches the DSA host key.^M
debug1: Found key in /mrs/home/mrsop/.ssh/known_hosts:11^M
debug1: ssh_dss_verify: signature correct^M
debug1: SSH2_MSG_NEWKEYS sent^M
debug1: expecting SSH2_MSG_NEWKEYS^M
debug1: SSH2_MSG_NEWKEYS received^M
debug1: SSH2_MSG_SERVICE_REQUEST sent^M
debug1: SSH2_MSG_SERVICE_ACCEPT received^M
debug1: Authentications that can continue:
gssapi-with-mic,publickey,password^M
debug1: Next authentication method: publickey^M
debug1: Offering public key: /shared/home/mrsop/.ssh/clotest_rsa^M
debug1: Server accepts key: pkalg ssh-rsa blen 149^M
debug1: read PEM private key done: type RSA^M
debug1: Authentication succeeded (publickey).^M
debug1: channel 0: new [client-session]^M
debug1: Entering interactive session.^M
debug1: Sending command: scp -v -t
F:/apps/clo/hk/equinox/TMP.20989.TESTCLO.TXT^M
Sending file modes: C0664 0 TESTCLO.TXT
scp: Invalid argument
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0^M
debug1: channel 0: free: client-session, nchannels 1^M
debug1: fd 0 clearing O_NONBLOCK^M
debug1: fd 1 clearing O_NONBLOCK^M
debug1: fd 2 clearing O_NONBLOCK^M
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.8 seconds^M
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0^M
debug1: Exit status 1^M

========================================================================
===============


However, When I use the same command to send to another windows machine,
I am able to scp the file successfully. Attached is the command and the
verbose log for the same.

========================================================================
===============

scp -P 51722 -i/shared/home/mrsop/.ssh/testid_rsa /tmp/sb24.so
ssh@anotherWindowsBox:/C:/ssh/TMP.25171.sb24.so

OpenSSH_3.8.1p1, OpenSSL 0.9.7d 17 Mar 2004
debug1: Reading configuration data /usr/local/openssh/etc/ssh_config^M
debug1: Connecting to anotherWindowsBox [anotherWindowsBox ip] port
51722.^M
debug1: Connection established.^M
debug1: identity file /shared/home/mrsop/.ssh/zmis_rsa type 1^M
debug1: Remote protocol version 2.0, remote software version 5.1.3.8 SSH
Tectia Server^M
debug1: no match: 5.1.3.8 SSH Tectia Server^M
debug1: Enabling compatibility mode for protocol 2.0^M
debug1: Local version string SSH-2.0-OpenSSH_3.8.1p1^M
debug1: SSH2_MSG_KEXINIT sent^M
debug1: SSH2_MSG_KEXINIT received^M
debug1: kex: server->client aes128-cbc hmac-md5 none^M
debug1: kex: client->server aes128-cbc hmac-md5 none^M
debug1: sending SSH2_MSG_KEXDH_INIT^M
debug1: expecting SSH2_MSG_KEXDH_REPLY^M
debug1: Host 'anotherWindowsBox ip' is known and matches the RSA host
key.^M
debug1: Found key in /mrs/home/mrsop/.ssh/known_hosts:8^M
debug1: ssh_rsa_verify: signature correct^M
debug1: SSH2_MSG_NEWKEYS sent^M
debug1: expecting SSH2_MSG_NEWKEYS^M
debug1: SSH2_MSG_NEWKEYS received^M
debug1: SSH2_MSG_SERVICE_REQUEST sent^M
debug1: SSH2_MSG_SERVICE_ACCEPT received^M
debug1: Authentications that can continue:
gssapi-with-mic,password,publickey,keyboard-interactive^M
debug1: Next authentication method: publickey^M
debug1: Offering public key: /shared/home/mrsop/.ssh/zmis_rsa^M
debug1: Server accepts key: pkalg ssh-rsa blen 149^M
debug1: read PEM private key done: type RSA^M
debug1: Authentication succeeded (publickey).^M
debug1: channel 0: new [client-session]^M
debug1: Entering interactive session.^M
debug1: Sending command: scp -v -t /C:/ssh/TMP.25171.sb24.so^M
Sending file modes: C0664 330 sb24.so
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0^M
debug1: channel 0: free: client-session, nchannels 1^M
debug1: fd 0 clearing O_NONBLOCK^M
debug1: fd 1 clearing O_NONBLOCK^M
debug1: fd 2 clearing O_NONBLOCK^M
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 1.4 seconds^M
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0^M
debug1: Exit status 0^M

========================================================================
===============

Regards
Sankar.
This email is confidential. If you are not the addressee tell the sender immediately and destroy this email without using, sending or storing it. Emails are not secure and may suffer errors, viruses, delay, interception and amendment. Standard Chartered PLC and subsidiaries ("SCGroup") do not accept liability for damage caused by this email and may monitor email traffic.





Relevant Pages

  • Re: scp problem
    ... I run ssh and scp, i've changed the config file to only accept ... > I recently upgraded openssh to 3.7.1p2 and lost scp capability. ... > debug1: Entering interactive session. ...
    (SSH)
  • Win32 SCP problems
    ... exchange with no problem to run commands or scp to or from, ... I have written an equivalent script in perl, restrict.pl, and this ... This is running allowed commands ok, ... debug1: Remote: Pty allocation disabled. ...
    (comp.security.ssh)
  • scp "connection" error
    ... reduced file system. ... I want to use scp as a client in the box. ... scp and ssh in /home/bin/. ... debug1: Seeding random number generator ...
    (SSH)
  • Re: how to turn on scp1 compatibility mode in RH9 ?
    ... Your OpenSSH install is somewhat outdated; ... The -t option is not valid for the scp I'm using here; ... debug1: Doing password authentication. ...
    (comp.os.linux.misc)
  • RE: ssh works, scp stalls
    ... FreeBSD server to my home FreeBSD box over RoadRunner. ... I can no longer scp to my remote sites with either ... debug1: fd 4 setting O_NONBLOCK ... debug1: channel 0: new ...
    (SSH)