随笔 - 110  文章 - 1  评论 - 0  阅读 - 77445

tomcat配置用户角色权限

tomcat用户角色权限配置文件为:tomcat/conf/tomcat-user.xml

默认未开启用户配置如下:

复制代码
<tomcat-users>
<!--
  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>
复制代码

配置用户要打开role及user节点

如配置为以下内容:

复制代码
<tomcat-users>
      <role rolename="tomcat"/>
      <role rolename="role1"/>
      <role rolename="manager-script"/>
      <role rolename="manager-gui"/>
      <role rolename="manager-status"/>
      <role rolename="admin-gui"/>
      <role rolename="admin-script"/>
      <user username="tomcat" password="tomcat" roles="manager-gui,manager-script,tomcat,admin-gui,admin-script"/>
</tomcat-users>
复制代码

角色权限说明如下:

权限说明
admin-gui     — 可访问 "host管理" 页面,但"APP管理" 和 "服务器状态" 页面无查看权限
manager-gui     — 无 "host管理" 页面访问权限,有"APP管理" 和 "服务器状态" 页面查看权限
manager-status     — 只有"服务器状态" 页面查看权限
manager-script     — 有脚本方式管理接口访问权限和"服务器状态" 页面查看权限
manager-jmx     — JMX 代理接口访问权限和"服务器状态" 页面查看权限
admin-script     — 只有host-manager脚本方式管理接口访问权限

 

posted on   骑着母猪去打猎  阅读(499)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示