Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im in the middle of trying to set up a tomcat environment on my development machine. Im having trouble running applications, and it looks like its down to file permissions. The directory containing the application is inside my home directory. How can i find out:

  • what account tomcat runs as
  • how to create a new group for tomcat
  • how to add tomcat to that group

in order that i can add application specific permissions to my home directory.

share|improve this question

Finding the user running tomcat

If you currently have tomcat running, then you can run ps and see what user a program is running as.

ps auxw | grep tomcat

This should list the processes that have the name tomcat (and the grep process, but ignore that). The first column of data is the user under which the command is run. For example, finding apache on my machine:

user@hostname ~$ ps auxw|grep apache
root       <numbers> ?        Ss   Nov10   0:03 /usr/sbin/apache2 -k start
www-data   <numbers> ?        S    Nov10   0:00 /usr/sbin/apache2 -k start
www-data   <numbers> ?        Sl   Nov10   0:00 /usr/sbin/apache2 -k start
www-data   <numbers> ?        Sl   Nov10   0:00 /usr/sbin/apache2 -k start
user       <numbers> pts/2    S+   11:22   0:00 grep --color=auto apache

Thus here user that you would be interested in is www-data

Creating a new tomcat group

The program you want for this is addgroup

addgroup tomcat_group_name

Adding user that runs tomcat to group

For this step we will use usermod. The username will be what we got from the first step (in my example www-data). For this part I will just call it tomcatuser

usermod -a -G tomcat_group_name tomcatuser
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.