Jenkins 通过 ssh 发布成功连接服务器但放置文件失败

Cuz*_*uzi 5 ubuntu ssh nginx amazon-web-services jenkins

我有一个问题,当我构建我的工作时,它无法将我的文件放在控制台输出中的服务器目录上,我收到消息“错误:发布时出现异常,异常消息[权限被拒绝]”

我有以下日志输出:

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
Run Code Online (Sandbox Code Playgroud)

对于目标服务器,我使用 AWS EC2 上的 ubuntu 服务器,并使用 nginx。

有人知道如何解决这个问题吗?我在网络上没有找到任何线索。谢谢!

小智 1

权限被拒绝时put dev-xx-xx.tgz。因此检查文件的权限设置:/home/Ubuntu/deploy/dev-xx-xx.tgz