I'm on Ubuntu 14.04 and I installed Apache Tomcat 7 via
sudo apt-get install tomcat7
and without editing any configuration I can start and stop the service tomcat7
successfully (localhost:8080
shows me the "It works!" page).
The installation seems to have created a user tomcat7
under which Tomcat runs. I would like to log in as that user (rather, switch to it using su tomcat7
) but I don't know the password — yet I never configured one.
What is the password for user tomcat7
?
Best Answer
Firstly, there should be zero reason to login as the
tomcat7
user. There's no logical use case for this, so therefore I'm not sure why you'd try and use it.Having said this, it's likely that this is a System User Account and not an actual user; these users typically have no passwords associated with it, as it is designed to be used by system daemons and services, rather than users. Therefore, you cannot login as that user as it isn't designed to be logged into by users - to use the user, you have to use
su
to switch user to it, and you have to do so as superuser or root or withsudo
. Also note that there's the option of setting a password, but it's ill-advised to do so, for that user.Option 1 (Recommended, and the Proper Way to do this):
su
assudo
orroot
/superuserYou will need to have
sudo
power, or access to theroot
user to get this working with these instructions.With
sudo
:As
root
user:Option 2 (NOT RECOMMENDED, because it introduces security concerns and other issues): Set a password
You will need to have
sudo
power, or access to theroot
user to get this working with these instructions, and it is VERY likely you will break things by doing this. I HIGHLY RECOMMEND not doing this!Set a password.
With
sudo
:As
root
:Once the password is set, then you can just login to the user (either via SSH or the console directly).
Again, I strongly recommend that you do not do this method - this could break Tomcat7, and can actually put your system at risk because someone can now brute-force the password and have access to the tomcat instance as the tomcat user itself.
To reiterate though: there is no logical reason to need to login as the
tomcat7
user. Do so at your own risk as you can affect evilness on your system if you're not careful.