solr8加鉴权

1:拷贝security.json到目录webapps/solr_home/下,security.json的内容如下:

{

"authentication":{

"blockUnknown":true,

"class":"solr.BasicAuthPlugin",

"credentials":{

"solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="

},

"":{"v":0}},

"authorization":{

"class":"solr.RuleBasedAuthorizationPlugin",

"permissions":[{

"name":"security-edit",

"role":"admin"}],

"user-role":{"solr":"admin"}}}

###以上代表solr的用户名和密码为: solr/SolrRocks

2: 启动solr

3: 修改用户名密码(需要借助curl工具)

##修改solr登录密码

curl --user solr:SolrRocks http://192.168.1.176:9081/solr/admin/authentication -H "Content-type:application/json" -d "{\"set-user\": {\"king\" : \"123456\"}}"

##删除solr用户

curl --user solr:SolrRocks http://192.168.1.176:9081/solr/admin/authentication -H "Content-type:application/json" -d "{\"delete-user\": \\"solr\\"}"

##查看权限

http://192.168.1.176:9081/solr/admin/authentication

相关推荐
一条破秋裤17 小时前
【1115】【多线程】【笔记】
前端·chrome·笔记
stormsha19 小时前
我的抓取脚本凭什么从不抢你的鼠标
前端·chrome
梯度下降者21 小时前
解决Chrome路径错误问题
chrome·selenium·解决方案·webdriverexception·路径错误
aiotto资源分享2 天前
Python 写 JSON 文件,程序中途退出会留下什么?
java·python·json·jsondecodeerror
MyBili2 天前
Chrome开发者工具入门:从看懂页面到高效调试
前端·chrome·谷歌浏览器·开发工具·chrome devtools·网页调式·网络请求分析
Flynt3 天前
Chrome给AI编程助手塞了203篇前端规范,我拆包实测:检索0.77秒是真快,扫描器有点挑食
前端·chrome·ai编程
其实防守也摸鱼3 天前
用 Claude Code 重构遗留系统:从评估到落地的完整指南
前端·网络·人工智能·chrome·安全·重构
一起学安全技术3 天前
拆大模型 10|结构化输出:让模型返回数据,而不是一段话
人工智能·语言模型·json
MyBili3 天前
Chrome多配置文件实战:工作生活身份彻底隔离管理
chrome·谷歌浏览器·使用技巧·效率工具·账号隔离·多配置文件·多身份管理
用户298698530143 天前
在 Python 中把 Word 文档转换为 JSON 的三种实现方式
python·json·api