当前位置: 首页 > article >正文

Promethues 添加访问密码

问题: promethues默认设置安全验证,可能造成安全问题

#1,安装软件生成http访问密码		  
[root@test1 prometheus-3.2.1.linux-arm64]# yum -y install httpd-tools	  
[root@test1 prometheus-3.2.1.linux-arm64]# htpasswd -nBbC 12 admin pass123
#htpasswd -nb[mBdps] [-C cost] username password
# -n  Don't update file; display results on stdout.
# -B  Force bcrypt encryption of the password (very secure).
# -b  Use the password from the command line rather than prompting for it.
# -C  Set the computing time used for the bcrypt algorithm (higher is more secure but slower, default: 5, valid: 4 to 17).
admin:$2y$12$Hytvc26EHNEavtPZ4LrYf.Aj2SBvnlQG.RGGH8vzvaicrIdHUoE6W

#2,设置并验证账号密码文件
[root@test1 prometheus-3.2.1.linux-arm64]# vim web-auth.yml
basic_auth_users:
  admin: $2y$12$Hytvc26EHNEavtPZ4LrYf.Aj2SBvnlQG.RGGH8vzvaicrIdHUoE6W

[root@test1 prometheus-3.2.1.linux-arm64]# ./promtool check web-config web-auth.yml
web-auth.yml SUCCESS

#3,重启promethues: 登录页面 IP:9090 ,用户名密码:admin pass123
[root@test1 prometheus-3.2.1.linux-arm64]# ./prometheus  --web.config.file=web-auth.yml

在这里插入图片描述


http://www.kler.cn/a/593869.html

相关文章:

  • 数据结构与算法的学习路线
  • Redis设置开机自启报错start-limit-hit
  • MySQL配置主从复制教程(MySQL8)
  • 【C++语言】继承和多态常见的面试问题
  • 深入理解DFS:从迷宫探险到动态剪枝的征服之路(C++实现)
  • @maptalks/gl-layers中的VectorTileLayer的setStyle属性的全部line配置
  • Linux应用:进程间通信
  • 集成学习(Ensemble Learning)基础知识2
  • sqli-labs学习记录5
  • 游戏引擎学习第166天
  • 如何实现一个分布式单例对象?什么场景需要分布式单例?
  • 如何在 WordPress 中重新生成永久链接?
  • VSCode创建VUE项目(四)增加用户Session管理
  • 深度测评|杰和科技云终端VT813详细介绍+实测数据!
  • Java File 类与文件操作
  • Linux安装Elasticsearch集群-----docker安装es集群
  • 上线后bug常见问题及解决建议
  • 区块链(Blockchain)
  • 基于HTML5的连连看游戏开发实践
  • 鸿蒙NEXT开发实战教程—小红书app