Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 
New Member

Secure file transfer with SCP

I know this is not a putty forum, but I thought that some of you may be using this. I am trying to use Putty pscp to transfer files to and from my routers. I can pull files from the router with no problem. When I try to push a file to the router, it will accept my credentials and I can look in the flash on the router and it shows the file as there, but after a minute the scp connection says "Fatal: Server unexpectedly closed network connection" and when I look in the flash on the router the file is gone. I have looked at the traffic on the ACL's and do not see anything hitting a deny statement. Any ideas why this is failing?

Here is a debug ip scp log when trying to push a file:

*May 30 16:00:20.968: SCP: [22 ->] send <OK>

*May 30 16:00:21.000: SCP: [22 <-] recv C0644 7284 ch203.cfg

*May 30 16:00:21.004: SCP: [22 ->] send <OK>

*May 30 16:00:21.388: SCP: [22 <-] recv 7284 bytes

*May 30 16:00:21.388: SCP: [22 <-] recv <OK>

*May 30 16:00:21.388: SCP: [22 ->] send <OK>

I appreciate any help. Thanks!


Re: Secure file transfer with SCP

The Secure Copy (SCP) feature provides a secure and authenticated method for copying router configuration or router image files. SCP relies on Secure Shell (SSH), an application and a protocol that provide a secure replacement for the Berkeley r-tools.Check the configuration of SCP using the guide in the URL.

Rfer the following url for more information on scp config and usage with SSH:

New Member

Re: Secure file transfer with SCP

I went by this document to set it up, and it is working for pulling files from the router, but when I try to push a file to the router it acts like it is working then just fails. As mentioned earlier there are no traces of failure in the debug logs....still no solution

Re: Secure file transfer with SCP

Experiencing the same issue (able to read from IOS file systems, but unable to write to these same file systems) with Putty's PSCP.

Copying From the IOS device (Works)


> pscp username@ios-device:startup-config .

> pscp username@ios-device:nvram:startup-config .

> pscp username@ios-device:flash:crashinfo_20081104-163509 .

Note: The period "." at the end of each cmd line specifies the current local directory on the PC as the target.

Copying To the IOS device (Does not work)


> pscp c:\x-Backup.txt username@ios-device:x-backup.txt

> pscp c:\x-Backup.txt username@ios-device:nvram:x-backup.txt

> pscp c:\x-Backup.txt username@ios-device:flash:x-backup.txt

Note: Each results in the following error message conveyed by PSCP:

"Fatal: Server unexpectedly closed network connection"

Note: The file I attempted to write has a status of "[deleted]".

ios-device#sh flash

System flash directory:

File Length Name/status

1 12908840 image-file-name.bin

2 242285 attack-drop.sdf

3 308489 crashinfo_20081104-163509

4 1059 x-backup.txt [deleted]

[13460936 bytes used, 3054132 available, 16515068 total]

16384K bytes of processor board System flash (Read/Write)

Anyone successfully writing to IOS file systems with PSCP?

CreatePlease to create content