Search This Blog

Wednesday, November 14, 2018

Default username and password in Tomcat

By default, Tomcat does not enable admin or manager access. To enable it, you have to edit the “%TOMCAT_FOLDER%/conf/tomcat-users.xml” manually.
File : tomcat-users.xml (before update) , initially, Tomcat comments all users and roles like above.
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<!--
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
-->
</tomcat-users>
File : tomcat-users.xml (after updated)
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="manager"/>
  <role rolename="admin"/>
  <role rolename="manager-gui"/>
  <user username="admin" password="admin" roles="admin,manager,manager-gui"/>
</tomcat-users>