cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
12615
Views
45
Helpful
6
Replies

Secure file transfer with SCP

holt0202
Level 1
Level 1

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 -> 10.3.3.242:1353] send <OK>

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

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

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

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

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

I appreciate any help. Thanks!

6 Replies 6

smahbub
Level 6
Level 6

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:

http://www.cisco.com/en/US/docs/ios/12_2t/12_2t2/feature/guide/ftscp.html

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

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?

I know this is years later but maybe this will show up in someone's google search:

 

1) Enable scp per the cisco documentation on target cisco device

2) Using pscp on a windows box this is the string I used to connect to a C9800-80

 

         pscp -scp -v path_to_your_file  user@ip_address:bootflash:/dest_file_name

 

Depending on device you may have to change bootflash:/ to flash:/ or flash0:/ etc

add another year and a half. 

 

This is exactly what i was looking for

Thanks Much!

 

tyoung008
Level 1
Level 1

Hi @Bucky ,

Three years later thank you!

Tom

Review Cisco Networking for a $25 gift card