首页 技术 正文
技术 2022年11月16日
0 收藏 645 点赞 3,420 浏览 1971 个字

启动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攻击(基于密码加密的暴力破解法)的安全策略。 

配图tomcat提示警告: An attempt was made to authenticate the locked user"tomcat"

登陆用户名和密码在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>
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,082
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,556
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,406
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,179
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,815
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,898