3

So I know this question has been asked before here, but the answer doesn't work for me. I'm connecting to my server using SFTP:

curl -k -v sftp://<username>:<password>@12.34.56.78/subdomains/cdn/mynewdir --ftp-create-dirs

Output:

*Trying 12.34.56.78
*TCP_NODELAY set
*Connected to 12.34.56.78 (12.34.56.78) port 22 (#0)
*SSH MD5 fingerprints: ab12cd34ef56gh78lm98
*SSH authentication methods available: password
*Initialized password authentication
*Authentication complete
*Could not open remote file for reading: no such file or directory
*Connection #0 to host 12.34.56.78 left intact
curl: (78) Could not open remote file for reading: No such file or directory

I know there's nothing wrong with the authentication, because I can see my files and other directories, but I just can't seem to create new directories using --ftp-create-dirs.

Any bit of help is appreciated.

YTZ
  • 876
  • 11
  • 26

1 Answers1

3

I fixed it myself by doing the following:

curl -k -v "sftp://<username>:<password>@12.34.56.78/subdomains/cdn/"
     -Q "-MKDIR /subdomains/cdn/mynewdir" --ftp-create-dirs
YTZ
  • 876
  • 11
  • 26
  • 1
    Did you figure out if there was a way to give relative paths to create based on the curl url? or do they always need to be from root – Prodigle Nov 30 '18 at 11:03