CURL 操作失败

CURL 操作失败

我想将此上传到我的服务器:

curl -u ****:**** -T - sftp://*****.com:22/apps/jboss-5.1.0/server/fab_server/deploy -v -k

问题是我收到此错误:

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* About to connect() to ****.com port 22 (#0)
*   Trying ****...
* Connected to ****.com (****) port 22 (#0)
* SSH MD5 fingerprint: ****
* SSH authentication methods available: publickey,password,keyboard-interactive
* Using ssh public key file /home/****/.ssh/id_dsa.pub
* Using ssh private key file /home/****/.ssh/id_dsa
* SSH public key authentication failed: Unable to open public key file
* Initialized password authentication
* Authentication complete
* Upload failed: Operation failed (4/-31)
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Connection #0 to host ****.com left intact
curl: (79) Upload failed: Operation failed (4/-31)

有谁知道如何修理它?

答案1

我解决了问题;我必须指定目标文件名。

答案2

我通过在目标目录路径中添加“/”字符解决了同样类型的问题,如下所示:

curl --insecure --user ****:**** -T ./sourcefile.txt sftp://DestinationIP/directory/

相关内容