title: How to start Jenkins with a different user?
body: <p>I am working with Jenkins and I want to start a script with <a href="https://www.npmjs.com/package/forever" rel="nofollow noreferrer">forever</a> using Jenkins with a different user named <code>aroot</code>.</p>
  
  <p>So my build configuration I write this command:</p>
  
  <pre><code>sudo -u aroot forever start -a --uid 'server' bin/www
  </code></pre>
  
  <p>It works fine but <code>forever</code> still tries to access the <code>jenkins</code> user and when I try to see the scripts running under forever by using the command:</p>
  
  <pre><code>forever list
  </code></pre>
  
  <p>I see nothing. Why does this happen? I have changed the user to <code>aroot</code> but it still tries to start the script under <code>jenkins</code> user. What should I do here?</p>
  
  <p>I even tried changing the default <code>jenkins</code> user to <code>aroot</code> but after this, the Jenkins just does not restart.</p>