Answers: <p>The ssh plugin gives you both options, 
  Either send build artifacts to remote server or run a command on the remote server. 
  The name of the plugin is "send build artifacts over ssh".. use that</p>
  
Answers: CC BY-SA 3.0
Answers: 2018-03-28T05:50:07.020Z
Answers: You mean the [Publish Over SSH Plugin](https://wiki.jenkins.io/display/JENKINS/Publish+Over+SSH+Plugin)?
Answers: Dan Cornilescu
Answers: CC BY-SA 3.0
Answers: 2018-03-30T14:50:37.763Z
Answers: Yes, you can execute commands on remote server too
Answers: user7155093
Answers: CC BY-SA 3.0
Answers: 2018-03-28T02:12:44.717Z
Answers: 2018-03-28T02:12:44.717Z
Answers: user7155093
Body: <p>I am trying to install Jenkins to achieve a Github -> EC2 instance folder pipeline. So far everything works well when I target an empty folder... however,  when I target my production folder owned by <code>www-data</code> the SSH copy of the files fail for permission, as Jenkins uses the <code>ubuntu</code> user, the only one I have an SSH login for. </p>
  
  <p>How do I solve this issue? </p>
  
Comments: CC BY-SA 3.0
Comments: 2018-03-27T19:46:26.640Z
Comments: Have you tried running the command as another user? (sudo -u)
Comments: Preston Martin
Comments: CC BY-SA 3.0
Comments: 2018-03-27T19:59:19.883Z
Comments: Where am I given a chance to issue a command? the SSH is a plug-in to Jenkins, is it not?
Comments: JasonGenX
Comments: CC BY-SA 3.0
Comments: 2018-03-27T20:01:22.717Z
Comments: I did not know that you were using the Jenkins SSH plugin.
Comments: Preston Martin
Tags: <jenkins><jenkins-pipeline><jenkins-plugins>
Title: Jenkins, Jenkins SSH Plug-In, EC2, "ubuntu" user and "www-data"
UserDisplayName: JasonGenX
ThreadText: # Jenkins, Jenkins SSH Plug-In, EC2, "ubuntu" user and "www-data"
  
  (Asked by: username_0 on 2018-03-27)
  
  I am trying to install Jenkins to achieve a Github -> EC2 instance folder pipeline. So far everything works well when I target an empty folder... however, when I target my production folder owned by `www-data` the SSH copy of the files fail for permission, as Jenkins uses the `ubuntu` user, the only one I have an SSH login for.
  
  How do I solve this issue?
  
  **Tags:** jenkins, jenkins-pipeline, jenkins-plugins
  
  > **Comments:**
  > **username_1**: Have you tried running the command as another user? (sudo -u)  
  > **username_0**: Where am I given a chance to issue a command? the SSH is a plug-in to Jenkins, is it not?  
  > **username_1**: I did not know that you were using the Jenkins SSH plugin.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-03-28. Score: 0 | Accepted answer
  
  The ssh plugin gives you both options,
  Either send build artifacts to remote server or run a command on the remote server.
  The name of the plugin is "send build artifacts over ssh".. use that
  
  > **Comments:**
  > **username_3**: You mean the [Publish Over SSH Plugin](https://wiki.jenkins.io/display/JENKINS/Publish+Over+SSH+Plugin)?  
  > **username_2**: Yes, you can execute commands on remote server too  
  
  ---
  
  