Tomcat的默认管理员密码是什么?
时间:2020-02-23 14:33:13 来源:igfitidea点击:
如果要将应用程序部署到Tomcat服务器时,我们可以使用管理UI进行操作,但我们如何访问它?
我们知道默认的管理员密码吗?
实际上Tomcat不提供任何默认密码。
我们需要将用户添加到$tomcathome/conf/tomcat-users.xml,并为manager-gui(for tomcat 7和8)和Manager(tomcat 6)提供角色。
默认tomcat-users.xml
<tomcat-users xmlns="http://tomcat.apache.org/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd" version="1.0"> <!- NOTE: By default, no user is included in the "manager-gui" role required to operate the "/manager/html" web application. If you wish to use this app, you must define such a user - the username and password are arbitrary. It is strongly recommended that you do NOT use one of the users in the commented out section below since they are intended for use with the examples web application. --> <!- NOTE: The sample user and role entries below are intended for use with the examples web application. They are wrapped in a comment and thus are ignored when reading this file. If you wish to configure these users for use with the examples web application, do not forget to remove the <!.. ..> that surrounds them. You will also need to set the passwords to something appropriate. --> <!- <role rolename="tomcat" <role rolename="role1" <user username="tomcat" password="<must-be-changed>" roles="tomcat" <user username="both" password="<must-be-changed>" roles="tomcat,role1" <user username="role1" password="<must-be-changed>" roles="role1" --> </tomcat-users>
如我们所见,在上面的XML中没有用户定义。
我们可以简单地添加用户如下:
Tomcat-Users.xml.
<tomcat-users xmlns="http://tomcat.apache.org/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd" version="1.0"> <!- NOTE: By default, no user is included in the "manager-gui" role required to operate the "/manager/html" web application. If you wish to use this app, you must define such a user - the username and password are arbitrary. It is strongly recommended that you do NOT use one of the users in the commented out section below since they are intended for use with the examples web application. --> <!- NOTE: The sample user and role entries below are intended for use with the examples web application. They are wrapped in a comment and thus are ignored when reading this file. If you wish to configure these users for use with the examples web application, do not forget to remove the <!.. ..> that surrounds them. You will also need to set the passwords to something appropriate. --> <!- <role rolename="tomcat" <role rolename="role1" <user username="tomcat" password="<must-be-changed>" roles="tomcat" <user username="both" password="<must-be-changed>" roles="tomcat,role1" <user username="role1" password="<must-be-changed>" roles="role1" --> <role rolename="manager-gui" <user username="igi" password="igi" roles="manager-gui" </tomcat-users>