f



PSCP does not copy file - "Cannot create file"

Trying to backup config file from network box, but have no luck:

--------------------------------------------------------------
C:\>pscp.exe -scp -pw password -2 -v login@hostname:/tmp/system.cfg "E:\backup\krabky\configs\"
Looking up host "hostname"
Connecting to IP_address port 22
We claim version: SSH-2.0-PuTTY_Release_0.63
Server version: SSH-2.0-dropbear_0.51
Using SSH protocol version 2
Using Diffie-Hellman with standard group "group1"
Doing Diffie-Hellman key exchange with hash SHA-1
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 1040 c4:cd:93:ba:33:9c:97:49:39:54:0d:9a:a4:52:e6:7e
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n) n
Host key fingerprint is:
ssh-rsa 1040 c4:cd:93:ba:33:9c:97:49:39:54:0d:9a:a4:52:e6:7e
Initialised AES-256 CBC client->server encryption
Initialised HMAC-SHA1 client->server MAC algorithm
Initialised AES-256 CBC server->client encryption
Initialised HMAC-SHA1 server->client MAC algorithm
Using username "login".
Sent password
Access granted
Opening session as main channel
Opened main channel
Started a shell/command
Using SCP1
Connected to hostname
Sending file modes: C0644 6297 system.cfg
pscp: E:\backup\krabky\configs": Cannot create file

Fatal: Received unexpected end-of-file from server

---------------------------------------------------------------

Thinking about insuficient access rights to destination location, but "echo AAA > 
E:\backup\krabky\configs\file.txt" performed from same console window work fine. Where the problem 
could be?

L.
0
Petr
11/22/2014 9:43:26 PM
comp.security.ssh 4228 articles. 0 followers. terra1024 (490) is leader. Post Follow

5 Replies
3366 Views

Similar Articles

[PageSpeed] 25

Petr Laznovsky  <nobody@nowhere.com> wrote:
> Trying to backup config file from network box, but have no luck:
> --------------------------------------------------------------
> C:\>pscp.exe -scp -pw password -2 -v login@hostname:/tmp/system.cfg
> "E:\backup\krabky\configs\"
[...]
> pscp: E:\backup\krabky\configs": Cannot create file

My first thought about that error message is that the " at the end of
the filename is suspicious - it's not matched by one at the start of
the filename, which is a clue that perhaps it's not part of the format
of the error message but has instead found its way into the actual
filename string. That would certainly explain an error like that, if
the SSH server were trying to create a file whose name was a single "
character.

And in fact, having had that thought, it seems clear what's happened.
Your command line ends in \", which Windows's quoting rules probably
take to mean a literal " character (as opposed to one which terminates
a double-quoted string). So by the time PSCP even receives your
command line, it's already not saying what you wanted it to say.

Try taking those double quotes out of your command and see if that
helps.
-- 
import hashlib; print (lambda p,q,g,y,r,s,m: m if (lambda w:(pow(g,int(hashlib.
 sha1(m).hexdigest(),16)*w%q,p)*pow(y,r*w%q,p)%p)%q)(pow(s,q-2,q))==r else "!"
 )(0xb80b5dacabab6145, 0xf70027d345023, 0x7643bc4018957897, 0x11c2e5d9951130c9,
 0xa54d9cbe4e8ab, 0x746c50eaa1910, "Simon Tatham <anakin@pobox.com>")
0
Simon
11/22/2014 11:45:31 PM
Dne 23.11.2014 0:45, Simon Tatham napsal(a):
> Petr Laznovsky  <nobody@nowhere.com> wrote:
>> Trying to backup config file from network box, but have no luck:
>> --------------------------------------------------------------
>> C:\>pscp.exe -scp -pw password -2 -v login@hostname:/tmp/system.cfg
>> "E:\backup\krabky\configs\"
> [...]
>> pscp: E:\backup\krabky\configs": Cannot create file
>
> My first thought about that error message is that the " at the end of
> the filename is suspicious - it's not matched by one at the start of
> the filename, which is a clue that perhaps it's not part of the format
> of the error message but has instead found its way into the actual
> filename string. That would certainly explain an error like that, if
> the SSH server were trying to create a file whose name was a single "
> character.
>
> And in fact, having had that thought, it seems clear what's happened.
> Your command line ends in \", which Windows's quoting rules probably
> take to mean a literal " character (as opposed to one which terminates
> a double-quoted string). So by the time PSCP even receives your
> command line, it's already not saying what you wanted it to say.
>
> Try taking those double quotes out of your command and see if that
> helps.
>

You are right, deleting last backslash fix the problem with "Cannot create file" and file is 
successfully copied now. But the errormessage "Fatal: Received unexpected end-of-file from server" 
remains even if I remowe doublequotes at all (my current path does not contain any space).

Notice that this message was not present with 0.62 version but arise after upgrade to 0.63 version.

L.

0
Petr
11/23/2014 10:07:16 AM
Petr Laznovsky <nobody@nowhere.com> writes:
>But the errormessage "Fatal: Received unexpected end-of-file from
>server" remains even if I remowe doublequotes at all (my current path
>does not contain any space).
>
>Notice that this message was not present with 0.62 version but arise
>after upgrade to 0.63 version.

That's probably due to a known bug in 0.63; it'll happen whenever you
download a file using the old-style SCP protocol (which you've forced
with the '-scp' option).
0
Jacob
11/23/2014 1:05:45 PM
Dne 23.11.2014 14:05, Jacob Nevins napsal(a):
> Petr Laznovsky <nobody@nowhere.com> writes:
>> But the errormessage "Fatal: Received unexpected end-of-file from
>> server" remains even if I remowe doublequotes at all (my current path
>> does not contain any space).
>>
>> Notice that this message was not present with 0.62 version but arise
>> after upgrade to 0.63 version.
>
> That's probably due to a known bug in 0.63; it'll happen whenever you
> download a file using the old-style SCP protocol (which you've forced
> with the '-scp' option).
>

Oh I see, with Pre-release 0.64:2014-11-23.8c09f85 looks fine.

Thank you, P.L.
0
Petr
11/23/2014 8:21:31 PM
On Saturday, November 22, 2014 at 4:43:30 PM UTC-5, Petr Laznovsky wrote:
> Trying to backup config file from network box, but have no luck:
> 
> --------------------------------------------------------------
> C:\>pscp.exe -scp -pw password -2 -v login@hostname:/tmp/system.cfg "E:\backup\krabky\configs\"
> Looking up host "hostname"
> Connecting to IP_address port 22
> We claim version: SSH-2.0-PuTTY_Release_0.63
> Server version: SSH-2.0-dropbear_0.51
> Using SSH protocol version 2
> Using Diffie-Hellman with standard group "group1"
> Doing Diffie-Hellman key exchange with hash SHA-1
> The server's host key is not cached in the registry. You
> have no guarantee that the server is the computer you
> think it is.
> The server's rsa2 key fingerprint is:
> ssh-rsa 1040 c4:cd:93:ba:33:9c:97:49:39:54:0d:9a:a4:52:e6:7e
> If you trust this host, enter "y" to add the key to
> PuTTY's cache and carry on connecting.
> If you want to carry on connecting just once, without
> adding the key to the cache, enter "n".
> If you do not trust this host, press Return to abandon the
> connection.
> Store key in cache? (y/n) n
> Host key fingerprint is:
> ssh-rsa 1040 c4:cd:93:ba:33:9c:97:49:39:54:0d:9a:a4:52:e6:7e
> Initialised AES-256 CBC client->server encryption
> Initialised HMAC-SHA1 client->server MAC algorithm
> Initialised AES-256 CBC server->client encryption
> Initialised HMAC-SHA1 server->client MAC algorithm
> Using username "login".
> Sent password
> Access granted
> Opening session as main channel
> Opened main channel
> Started a shell/command
> Using SCP1
> Connected to hostname
> Sending file modes: C0644 6297 system.cfg
> pscp: E:\backup\krabky\configs": Cannot create file
> 
> Fatal: Received unexpected end-of-file from server
> 
> ---------------------------------------------------------------
> 
> Thinking about insuficient access rights to destination location, but "echo AAA > 
> E:\backup\krabky\configs\file.txt" performed from same console window work fine. Where the problem 
> could be?
> 
> L.

Hi Simon - I have a similar question. I'm trying to copy a file from a remote server into my computer. This is the command i use: 

pscp monfared@YYY:/home/monfared/XX.txt C:\Users\monfared\Xx.txt\.

The same line works when i use it to transfer files to my desktop computer but it gives me the "cannot create file" message when i use it to copy a file into my laptop. Any help/suggestions would be much appreciated. 
0
siavashmonfared
2/1/2015 9:49:13 PM
Reply:

Similar Artilces:

How to copy a file to a file with a prefixed file name
I'm trying to write a program that will archive selected files to an archive directory. The files in the archive directory will have a prefix in the format yyyymmdd-hhmmss-filename.ext. So, if the file is called "somefile.dat", then the filename in the archive directory should be "20090522-164325-somefile.dat". I'm using Clipper's COPY FILE command to do the copy. I can't figure out how to get the prefix in front of the file name. Creating the prefix string is no problem, but I can't figure out how to tack that onto the front of the filename. If I...

File::Copy::copy With File Handles
The documentation for File::Copy warns against using file handles as arguments: Note that passing in files as handles instead of names may lead to loss of information on some operating systems; it is recommended that you use file names whenever possible. Does this refer to handles created with the older FileHandle module (which is used in the module's synopsis), IO::Handle subclasses, or both? In either case what's the issue with handles that may lead to data loss? Quoth MaggotChild <hsomob1999@yahoo.com>: > The documentation for File::Copy warns agai...

I create .nsf files but .id files are not created
Hi Guys, I 'm a complete noob .. but have experience with Active Directory... like I said .. I look at the data file no .id files but I can see the .nsf files.. odd... I can use my web mail .. not .. LAN. Thanx, ver. 6.5 Al mroscarhernandez@gmail.com wrote: > Hi Guys, > I 'm a complete noob .. but have experience with Active Directory... > like I said .. I look at the data file no .id files > but I can see the .nsf files.. odd... I can use my web mail .. not .. > LAN. > > Thanx, ver. 6.5 > > Al > You might have chosen to put...

Write to text file. Append to existing file. Create file if file doesn't exist.
Hi folks, &nbsp; up to LabVIEW 7 there was a wonderful "Write to Text&nbsp;File" vi which allowed the option "Append to File". Now, in LabVIEW 8, this old vi is not longer supported anymore. Instead, I am suggested to use a new "Write to Text File" vi. This vi does not offer the option "Append to File" anymore. Rather it is proposed in the online help that one should use the "Set File Position" in order to append text to the file. This much less straightforward than the old solution. Furthermore, I miss an option which would create the ...

file.exe file generation from file.m file
How to generate application (*.exe) file from *.m file, which has lots of graphics. Program was written for image watermarking by using image processing toolbox. I want to send this program some where else but with out sowing the program codes. By this *.exe no need to use matlab6.5 platform. Also tell me How to generate *.p file from *.m file Which is hide the code to user but for run this program need matlab6.5 Please give me some idea about it. it is very urgent for me. I will be very great full to you "Biswajit Kar" <hibiswajitkar@rediffmail.com> wrote in message ne...

File, Find References, Copy Files: Truncating Long File Names
Hello All- I just experienced this behavior this morning. It was repeatable. Has anyone else seen this? The file Name was cut off after 57 characters. XP Pro SP2 2006 SP0 Office XP 2003 Pro Best Regards, Devon T. Sowell www.3-ddesignsolutions.com How long was the path name in total? Total including the file extension (.SLDASM) = 174. The file Extension was retained, just the Name was chopped off. These are my customer's files. Best Regards, Devon T. Sowell www.3-ddesignsolutions.com "TOP" <kellnerp@cbd.net> wrote in message news:1128364278.638472.150320@f14g2000...

Create Files/ Upload Files
Hi Can anyone explain by example how to create a new file on server and then upload some files to that newly created folder? But before we create the file check that an existing file does not already exist and then upload the files to the newly created directory. Thanks Baka On Jun 26, 7:49 am, abhm <bak...@gmail.com> wrote: > Hi > > Can anyone explain by example how to create a new file on server and > then upload some files to that newly created folder? > > But before we create the file check that an existing file does not > already exist and then upload the f...

Copying a file to another file
Hi, I wrote the following C program to copy a file to another file. #include <stdio.h> #include <stdlib.h> static FILE *open_file ( char *file, char *mode ) { FILE *fp = fopen ( file, mode ); if ( fp == NULL ) { perror ( "Unable to open file" ); exit ( EXIT_FAILURE ); } return fp; } int main ( int argc, char *argv[] ) { /* int ch;*/ FILE *from; FILE *to; char *buffer; long lSize; if ( argc != 3 ) { fprintf ( stderr, "Usage: %s <readfile1> <writefile2>\n", argv[0] ); exit (1);/* E...

Copy files with a .vbs file
Hi Im a complete newbe at this and would like som help. Im sure this is very easy to do but i dont have any idea as where to start. I would like to have a .vbs file that i can click on to open e message box where I can specify a file. That file should then be copied 5 times and different text should be added infront of the original file name, like this: Org: 12324.txt Result: text1_1234.txt text2_1234.txt text3_1234.txt text4_1234.txt text5_1234.txt Anyone who can help me with this or point me in the right direction? Best regards Daniel -- ------------------------...

File IO/Copy A File
I am stumped on this one... Any easy way to copy a file from a button event in RB 5.2? I basically want the button to copy DB.rdb to DB.bak. THis way is someone hozes the file, we have a backup. Thanks in advance, SJ > I am stumped on this one... > > Any easy way to copy a file from a button event in RB 5.2? I > basically want the button to copy DB.rdb to DB.bak. THis way is > someone hozes the file, we have a backup. > > Thanks in advance, > > SJ Maybe I am missing what you are trying to do - but wouldn't FolderItem.CopyFileTo d...

http://LongPathTool.com
http://LongPathTool.com - unlock files in-use by other applications + Delete and Copy Path Too Long Files The application solves the problem with inability to copy and delete files and folders with long paths or locked by some application. They could be created by virus/adware/different OS/other software. Normally one can't access such files under Windows and therefore can't delete them either. Please check other Features for more details. Also you can download the latest evaluation version on our download page. Long Path Tool uses a variety of methods to delete the pers...

copy txt file - only copies 1/3 of the file
File.open('oldFile.txt', 'r') do |f1| #file contains XML type data m = f1.gets File.open('newFile.txt','w') do |f2| #newFile to separate data in oldFile f2.puts m.split("<") end end Hello All. There is something that I did that was weird here. I say this because when I open the new file that it creates its 1/3 the size of the original. It seems to just completely cut off. I took off the .split and it still did this, so I know it has nothing to do with split. What do you think is going on? oldFile.txt contains XML formatted data. ...

file extention from file file location
Hi, I am new to perl (only working on this one problem) but I program in other languages. We have an upload script written in cgi. Can anyone tell me how to get the file extension from the variable $File1 (actual file location on uploader's computer) then find out if it is equal to "txt" Thanks in advance for not telling me to read the manual. Ron -- PLEASE NOTE: comp.infosystems.www.authoring.cgi is a SELF-MODERATED newsgroup. aa.net and boutell.com are NOT the originators of the articles and are NOT responsible for their content. HOW TO POST to co...

http://LongPathTool.com
http://LongPathTool.com - copy and delete path too long files Windows tool to copy or delete files and folders with path too long or filename too long error. Just browse to the file and press a button to copy or detele it, thats it! The application solves the problem with inability to copy and delete files and folders with long paths in Explorer. They could be created by virus/adware/Mac OS/other software. Normally one can't access such files under Windows and therefore can't copy or delete them either. Clean up files. Alows to copy and delete files that has path longer the...

How to create PC File Description File(.FDF) for Client Access file transfer utility?
Hello Friends, I want to know how can i create PC File Description file (.FDF) that we give in File Transfer Utility of Client Access, while transfering any file from PC to AS400. What are the parameters of .FDF file and how can i create one to describe my PC file that is to be transfered? I would be grateful if you can guide me to some manual in which i can get this. Thanks in Advance for yr help in this regard. kind regards, Umer Assuming the file exists on the as400, use CA to download the file first and select create FDF option. If not, download any file and select FDF and loo...

Web resources about - PSCP does not copy file - "Cannot create file" - comp.security.ssh

Resources last updated: 1/26/2016 7:14:08 AM