[local]ASR5000-2# copy /flash/test sftp://root:cisco123@10.201.251.13:22/localdisk/test Failure: "FAILED because unable to write destination",[an error occurred while processing this directive]
copy /flash/test sftp://root:cisco123@10.201.251.13:22/localdisk/test
The setting in /etc /ssh/sshd_config file:
# Change to yes to enable tunnelled clear text passwords PasswordAuthentication no[an error occurred while processing this directive]
If you use FTP protocol, the transfer is successful.
Solution
Out of the two Linux servers in the lab, it was possible to reproduce the issue on one server but not the other. Only difference was the IP address of the server in the test.
[local]ASR5000-2# copy /flash/test sftp://root:cisco123@10.201.251.5:22/localdisk/test ******************************************************************************** Transferred 22789 bytes in 0.002 seconds (11127.4 KB/sec) [local]ASR5000-2# [local]ASR5000-2# [local]ASR5000-2# copy /flash/test sftp://root:cisco123@10.201.251.13:22/localdisk/test Failure: "FAILED because unable to write destination",[an error occurred while processing this directive]
copy /flash/test sftp://root:cisco123@10.201.251.13:22/localdisk/test [local]ASR5000-2#
While the server settings are reviewed, it was noticed that there was a difference between the setting of two servers in /etc /ssh/sshd_config file. The working server had this setting:
# Change to yes to enable tunnelled clear text passwords PasswordAuthentication yes[an error occurred while processing this directive]
When this parameter is modified to yes and the service is restarted with the /etc/init.d/ssh restart command, you can successfully transfer a file using SFTP.
[local]ASR5000-1# copy /flash/test2.cfg sftp://root:cisco123@10.201.251.13/localdisk/test2.cfg Tuesday January 19 08:11:47 PST 2016 Are you sure? [Yes|No]: yes Tuesday January 19 08:12:15 PST 2016 ******************************************************************************** Transferred 33316 bytes in 0.001 seconds (32535.2 KB/sec) [local]ASR5000-1# copy /flash/test2.cfg sftp://root:cisco123@10.201.251.5/localdisk/test2.cfg Tuesday January 19 08:13:09 PST 2016 Are you sure? [Yes|No]: yes Tuesday January 19 08:13:18 PST 2016 ******************************************************************************** Transferred 33316 bytes in 0.001 seconds (32535.2 KB/sec)[an error occurred while processing this directive]