I have a bitnami Jenkins VM, how do I tell what user Jenkins is running as? I suspect it is Tomcat.
Asked
Active
Viewed 2.4k times
5 Answers
12
If you have access to the gui, you can go to "manage jenkins" > "system information" and look for "user.name".

jehon
- 1,404
- 15
- 21
5
I would use ps
to get the uid of the process, and grep for that in /etc/passwd

Jon Carter
- 2,836
- 1
- 20
- 26
-
That seems to return PID – Zach Jul 18 '13 at 22:27
-
2used ps -u returned user names – Zach Jul 18 '13 at 22:31
3
You could also create a Jenkins job containing a shell script box with the "whoami" command.

EricP
- 980
- 5
- 8
2
Use this command to see under which process your Jenkins server works on:
ps axufwwww | grep 'jenkins\|java' -
To interpret the results, look for:
jenkins 1087 0.0 0.0 18740 396 ? S 08:00 0:00 /usr/bin/daemon --name=jenkins
jenkins 1088 1.6 20.7 3600900 840116 ? Sl 08:00 2:12 \_ /usr/bin/java
1087 and 1088 are the PIDs. They might differ for you.
1
ps aux | grep '/usr/bin/daemon' | grep 'jenkins' | awk {'print $1'}
The command will show running processes, then grep for a process running as a daemon that includes the string 'jenkins'. Finally, get the first row of the piped output which is the user that is running Jenkins.

Sebastian Smolorz
- 497
- 7
- 20