所以我知道这个问题之前有人问过here ,但答案对我不起作用。我正在使用 SFTP 连接到我的服务器:
curl -k -v sftp://<username>:<password>@12.34.56.78/subdomains/cdn/mynewdir --ftp-create-dirs
输出:
*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
我知道身份验证没有问题,因为我可以看到我的文件和其他目录,但我似乎无法使用 --ftp-create-dirs
创建新目录。
感谢任何一点帮助。
最佳答案
我通过执行以下操作自行修复了它:
curl -k -v "sftp://<username>:<password>@12.34.56.78/subdomains/cdn/"
-Q "-MKDIR /subdomains/cdn/mynewdir" --ftp-create-dirs
关于cURL 使用 --ftp-create-dir 创建新目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49286269/