zoukankan      html  css  js  c++  java
  • tomcat提示警告: An attempt was made to authenticate the locked user"tomcat"

    启动tomcat7之后,运行正常,但是运行一段时间就会提示以下警告:

    十二月 04, 2013 5:10:15 下午 org.apache.catalina.realm.LockOutRealm authenticate
    WARNING: An attempt was made to authenticate the locked user "tomcat"

    虽然不影响程序的运行,但是后台控制台一直提示,所以上网搜索找出现这个现象的原因。 

    处理这个问题最有效的办法是把tomcat的webappsx下,自带的文件夹全删除之后,问题解决。 

    也可以按一下方法解决: 
    原因: 
       由于tomcat-users.xml配置有误导致的。 
       注:只是部分内容: 
     

     <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"/>
      <role rolename="manager-script"/>
      <role rolename="manager-jmx"/>
      <role rolename="manager-status"/>
     <user username="zhuo" password="zhuo" roles="manager-gui,manager-script,manager-jmx,manager-status"/>

    我把空行前半部分给注释掉了。 

     <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"/>

    解决办法如下: 
      把空行注释掉的配置放开后,如上的警告消失。

     原因介绍

    你的应用加了身份认证,有人(或者你自己,呵呵)试图用manager用户登陆你的应用,密码输入错误5次或者5次以上(缺省是5次),就会在日志中记录警告信息,并锁定并禁止该用户的进一步登陆。以提醒你可能有人恶意猜测你的管理员密码。是tomcat为了阻止brute-force攻击(基于密码加密的暴力破解法)的安全策略。 

     配图

    登陆用户名和密码在conf/tomcat-users.xml中配置 

    server.xml中的配置如下: 

    <!-- 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>
    
    
    <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>
  • 相关阅读:
    Linux中连接mysql执行sql文件
    各种编码转化
    PHP 创建缩略图
    erlang入门之编译和运行
    mac下的virtualbox启动失败处理
    golang回调函数的例子
    cocos2d-x的popScene的动画效果
    ssdb的golang驱动的同步问题
    贴一段demo代码,演示channel之间的同步
    golang的指针到string,string到指针的转换
  • 原文地址:https://www.cnblogs.com/hwaggLee/p/5457262.html
Copyright © 2011-2022 走看看