Jenkins publish over ssh success to connect the server but failed put file

12,466

Permission denied when put dev-xx-xx.tgz. So check the file's permission setup: /home/Ubuntu/deploy/dev-xx-xx.tgz

Share:
12,466

Related videos on Youtube

Cuzi
Author by

Cuzi

Updated on September 18, 2022

Comments

  • Cuzi
    Cuzi almost 2 years

    I have a problem that when I do build to my job, its cannot put my file on the server directory in console output i get the message "ERROR: Exception when publishing, exception message [Permission denied]"

    i have the following log output:

    SSH: Connecting from host [rp_ci]
    SSH: Connecting with configuration [web-dev] ...
    SSH: Creating session: username [ubuntu], hostname [xx.xx.xx.xxx], port [22]
    SSH: Connecting session ...
    SSH: Connected
    SSH: Opening SFTP channel ...
    SSH: SFTP channel open
    SSH: Connecting SFTP channel ...
    SSH: Connected
    SSH: Remote root is not absolute, getting absolute directory from PWD
    SSH: cd [/home/ubuntu]
    SSH: OK
    SSH: cd [deploy/]
    SSH: OK
    SSH: put [dev-xx-xx.tgz]
    SSH: Disconnecting configuration [web-dev] ...
    ERROR: Exception when publishing, exception message [Permission denied]
    Build step 'Send build artifacts over SSH' changed build result to UNSTABLE
    Finished: UNSTABLE
    

    For the target server Im using ubuntu server on AWS EC2 using nginx.

    Someone know how to fix that's issue? I not found any clue for it around the web. Thanks!

    • TheFiddlerWins
      TheFiddlerWins over 9 years
      What happens if you run the script manually as the Jenkins user? Any reason you're not using SCP instead of SFTP?
    • Cuzi
      Cuzi over 9 years
      it is work in all my other servers, while Im using SCP I prompt an error:" Host key verification failed."