I have Jenkins installed in Linux and I want to run the build(s) under a user.
Not just a simple user, but one that belongs to the list of user that access the linux
Yes, it is necessary to set JENKINS_USER variable, but in another file.
Look here http://blog.manula.org/2013/03/running-jenkins-under-different-user-in.html
Have a look at the Started-By Environment Variable plugin.
https://wiki.jenkins-ci.org/display/JENKINS/Started-By+Environment+Variable+Plugin
EDIT:
If you are just asking how to set up Jenkins to run under a different user in Linux it depends on how you installed it. I never set up Jenkins on Linux yet (but I can use google). Have a look at https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins for different setup options. I had a look at Installing Jenkins as a Unix daemon and at step 7 you need to setup a configuration file. Change the last line in that file (RUN_AS_USER=jenkins
) to contain the user of your choice.
There is nothing only the root user could do that you cant do in a proper way, by creating a dedicated user for your task with proper rights on the concerned files or binaries. Give example of the task you want to do as root if you need more accurate example.