2

I try to upload localDir to remote server i follow this guide SFTP Guide

but when upload the localDir and go inside i see blankDir I did the following

sftp> lls
404.html  crm nginx-logo.png  test.php

sftp> ls
 crm
     
sftp> put -r crm /usr/share/nginx/html
      Uploading crm/ to /usr/share/nginx/html/crm
      Entering crm/

I created crm dir according to the following note in SFTP Guide

Note

There is currently a bug in the versions of OpenSSH shipped with current >Ubuntu releases (at least 14.04 to 15.10) that prevents the above command >from operating correctly. Upon issuing the command above to transfer content >to a server using the buggy version of OpenSSH, the following error will be >given: Couldn't canonicalise: No such file or directory.

To work around this issue, create the destination directory on the remote >end first by typing mkdir localDirectory. Afterwards, the above command >should complete without error.

but upload file working well.

Any Suggestions ?

9
  • yeah i know the help guide for SFTP by help or ? i will update my que
    – Just User
    Commented Jan 12, 2016 at 19:04
  • I have all permissions , i uploaded file to this dir to check worked well
    – Just User
    Commented Jan 12, 2016 at 19:19
  • The same result sftp> put -r crm Uploading crm/ to /usr/share/nginx/html/crm Entering crm/ After mkdir crm2 and ls i see crm2
    – Just User
    Commented Jan 12, 2016 at 19:29
  • 1
    Yes, I see where it shows put -r localDirectory with the localDirectory in your case will be /crm but the location where you are uploading it to on the server (/usr/share/nginx/html/) the /crm is already there. If you're in /usr/share/nginx/html/ then run rmdir crm and then do the put -r crm to see if it shows what you're expecting. I think the /crm is already where you are trying to upload it to, or I'm totally lost which is absolutely possible... put I do FTP stuff all the time... Perhaps the error isn't clear to me. Commented Jan 12, 2016 at 19:42
  • 1
    I noticed where it said the workaround to that issue you added to your answer is to make the directory first and then upload it. So you'd run mkdir crm and then run put -r crm. Commented Jan 12, 2016 at 19:47

1 Answer 1

2

Your Error

enter image description here

To resolve your error per your comment, just run mkdir crm and then run put -r crm.

The same flags that work with "get" apply to "put". So to copy an entire local directory, you can issue:

put -r localDirectory

Note

There is currently a bug in the versions of OpenSSH shipped with current Ubuntu releases (at least 14.04 to 15.10) that prevents the above command from operating correctly. Upon issuing the command above to transfer content to a server using the buggy version of OpenSSH, the following error will be given: Couldn't canonicalise: No such file or directory.

To work around this issue, create the destination directory on the remote end first by typing mkdir localDirectory. Afterwards, the above command should complete without error.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .