In this tutorial you will learn how to set up the Tomcat default administrator password
Tomcat users are defined in the file – $TOMCAT_HOME/conf/tomcat-users.xml, by default, there is NO user, it means no one can access the Tomcat manager page.
To enable users to access the Tomcat manager page, you need to add a user as the role manager-gui.
$TOMCAT_HOME/conf/tomcat-users.xml (Original file content)
<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>
$TOMCAT_HOME/conf/tomcat-users.xml (Updated File content)
<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″/>
–>
<role rolename=”manager-gui”/>
<user username=”admin” password=”admin” roles=”manager-gui”/>
</tomcat-users>
Save teh file and restart Tomcat, now you should able to access the default manager page (http://localhost:8080/manager) with user = “admin” and password = “admin”