Steelflax
Steelflax

Reputation: 69

upload file to sftp from jenkins

My task is automate uploading file to sftp server by using Jenkins CI. My permissions is very limited and I have no access to sftp server via ssh. I have tried to use sftp bash command but have a problem with automation input password (expect can not be installed) Curl also have problems :

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

Can you help me to find another way or resolve my problem? Thank you.

Upvotes: 0

Views: 3187

Answers (1)

Michael Ryan Soileau
Michael Ryan Soileau

Reputation: 1833

'My permissions is very limited and I have no access to sftp server via ssh.'

If you can't access the server via SSH, any SSH based authentication system isn't going to work. Your public key can't be opened, so check that it's the correct file path to the public key and that it's the right type of key. Should start with "-----BEGIN RSA PRIVATE KEY-----" and end with the same comment.

Upvotes: 1

Related Questions