<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>

CC BY-SA 3.0
2018-03-28T05:50:07.020Z
You mean the [Publish Over SSH Plugin](https://wiki.jenkins.io/display/JENKINS/Publish+Over+SSH+Plugin)?
Dan Cornilescu
CC BY-SA 3.0
2018-03-30T14:50:37.763Z
Yes, you can execute commands on remote server too
user7155093
CC BY-SA 3.0
2018-03-28T02:12:44.717Z
2018-03-28T02:12:44.717Z
user7155093
<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>

CC BY-SA 3.0
2018-03-27T19:46:26.640Z
Have you tried running the command as another user? (sudo -u)
Preston Martin
CC BY-SA 3.0
2018-03-27T19:59:19.883Z
Where am I given a chance to issue a command? the SSH is a plug-in to Jenkins, is it not?
JasonGenX
CC BY-SA 3.0
2018-03-27T20:01:22.717Z
I did not know that you were using the Jenkins SSH plugin.
Preston Martin
<jenkins><jenkins-pipeline><jenkins-plugins>
Jenkins, Jenkins SSH Plug-In, EC2, "ubuntu" user and "www-data"
JasonGenX
# 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  

---

