2016-03-17 29 views
1

Tomcat的(8.0.27)的server.xml文件包含在全局命名資源節中的默認用戶數據庫定義:刪除默認的用戶數據庫資源

<GlobalNamingResources> 
    <!-- Editable user database that can also be used by 
     UserDatabaseRealm to authenticate users 
    --> 
    <Resource name="UserDatabase" auth="Container" 
       type="org.apache.catalina.UserDatabase" 
       description="User database that can be updated and saved" 
       factory="org.apache.catalina.users.MemoryUserDatabaseFactory" 
       pathname="conf/tomcat-users.xml" /> 
    </GlobalNamingResources> 

發現了一些掃描即tomcat-users.xml文件包含純文本密碼。我想知道這個資源是否可以刪除?我不打算在我的引擎定義下使用這個領域,也不使用Tomcat管理器應用程序。

我在Tomcat文檔部分找不到任何答案。

回答

1

是的,你可以,如果你也使用該資源刪除境界:

<!-- Use the LockOutRealm to prevent attempts to guess user passwords 
via a brute-force attack --> 
<Realm className="org.apache.catalina.realm.LockOutRealm"> 
<!-- This Realm uses the UserDatabase configured in the global JNDI 
resources under the key "UserDatabase". Any edits 
that are performed against this UserDatabase are immediately 
available for use by the Realm. --> 
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" 
resourceName="UserDatabase"/> 
</Realm> 

要知道,這樣做,你將需要進一步的配置,用戶管理器應用。