从jenkins上传文件到sftp

时间:2014-06-05 11:02:10

标签: bash jenkins sftp

我的任务是使用Jenkins CI自动将文件上传到sftp服务器。 我的权限非常有限,我无法通过ssh访问sftp服务器。 我试过使用sftp bash命令但是自动输入密码有问题(期望无法安装) 卷曲也有问题:

curl --insecure  -vvv -T filename.xml -u user:password sftp://server.com:XXXX
* About to connect() to server.com port XXXX (#0)
*   Trying xxx.xxx.xxx.xxx... connected
* Connected to server.com (xxx.xxx.xxx.xxx) port XXXX (#0)
* SSH authentication methods available: publickey,password
* Using ssh public key file /home1/user/.ssh/id_dsa.pub
* Using ssh private key file /home1/user/.ssh/id_dsa
* SSH public key authentication failed: Unable to open public key file
* Initialized password authentication
* Authentication complete
* Upload failed: Permission denied (3/-31)

Connection #0 to host server.com left intact

curl: (9) Upload failed: Permission denied (3/-31)
* Closing connection #0

你能帮助我找到另一种方法或解决我的问题吗? 谢谢。

1 个答案:

答案 0 :(得分:1)

  

'我的权限非常有限,我无法访问sftp服务器   通过ssh。'

如果您无法通过SSH访问服务器,则任何基于SSH的身份验证系统都无法运行。您的公钥无法打开,因此请检查它是否是公钥的正确文件路径,并且它是正确的密钥类型。应以“----- BEGIN RSA PRIVATE KEY -----”开头,并以相同的评论结束。

相关问题