安装完elasticsearch之后会有一个默认的用户admin密码也为admin,该用户无法删除无法编辑修改密码,用于生产时安全性较差,需要修改默认密码或者删除该admin用户

  使用工具生产加密密码

/usr/share/elasticsearch/plugins/search-guard-6/tools
chmod +x hash.sh
./hash.sh -p qweasd123 $2y$12$y1ZrQrtL5fXbsNOfkLNpauQ/f82wiFgQmUk6fJBU7OazZlvt8Hs.6

  明文密码为qweasd123生成加密密码

  修改配置文件

/usr/share/elasticsearch/plugins/search-guard-6/sgconfig/sg_internal_users.yml

  设置生效

./sgadmin.sh -cacert root-ca.pem -cert CN=sgadmin.crtfull.pem -key CN=sgadmin.key.pem -keypass 3c67d14791c6ac933e9b -nhnv -icl -cd ../sgconfig/

  改命令可以在证书路径下的README.txt找到

/etc/elasticsearch/key/README.txt

  命令运行以下红色为本次生效部分

[root@dev-es-kinaba tools]# ./sgadmin.sh -cacert root-ca.pem -cert CN=sgadmin.crtfull.pem -key CN=sgadmin.key.pem -keypass 3c67d14791c6ac933e9b -nhnv -icl -cd ../sgconfig/
Search Guard Admin v6
Will connect to localhost:9300 ... done
Elasticsearch Version: 6.6.2
Search Guard Version: 6.6.2-24.2
Connected as CN=sgadmin
Contacting elasticsearch cluster 'elasticsearch' and wait for YELLOW clusterstate ...
Clustername: my-elk
Clusterstate: YELLOW
Number of nodes: 1
Number of data nodes: 1
searchguard index already exists, so we do not need to create one.
Populate config from /usr/share/elasticsearch/plugins/search-guard-6/sgconfig
Will update 'sg/config' with ../sgconfig/sg_config.yml
SUCC: Configuration for 'config' created or updated
Will update 'sg/roles' with ../sgconfig/sg_roles.yml
SUCC: Configuration for 'roles' created or updated
Will update 'sg/rolesmapping' with ../sgconfig/sg_roles_mapping.yml
SUCC: Configuration for 'rolesmapping' created or updated
Will update 'sg/internalusers' with ../sgconfig/sg_internal_users.yml
SUCC: Configuration for 'internalusers' created or updated
Will update 'sg/actiongroups' with ../sgconfig/sg_action_groups.yml
SUCC: Configuration for 'actiongroups' created or updated
Done with success

  PS:执行该操作会导致之前在kiban里面创建的用户删除掉

  重启elasticsearch即可使用新密码登录kibana

ELK之安装searchguard后默认管理员用户admin修改的更多相关文章

  1. 阿里云服务器ECS上ubuntu安装nginx后默认站点页面打开错误,显示无法访问此网站

    问题:在新买的阿里云服务器ECS上安装nginx后打开默认页面失败,如下图所示. 系统环境:Ubuntu 16.04.4 LTS64版本. 步骤回顾: root用户下运行命令 apt-get inst ...

  2. SQL Server安装完成后3个需要立即修改的配置选项(转载)

    你用安装向导安装了全新的SQL Server,最后你点击了完成按钮.哇噢~~~现在我们可以把我们的服务器进入生产了!抱歉,那并不是真的,因为你的全新SQL Server默认配置是错误的. 是的,你没看 ...

  3. Ubuntu Server忘记密码后,单用户模式修改密码进去不了桌面的无奈

    俗话说的好,好记性不如烂笔头.有时候脑子一热,就想不起来之前设置过的密码是什么了.我可怜地忘了我的Ubuntu Server的密码,回忆了n种组合都不行,于是只能进行单用户模式的修改密码了. 以下的操 ...

  4. Oracle忘记用户名和密码以及管理员用户新增修改删除用户

    Oracle忘记密码: 1.以管理员身份登录,打开dos窗口,输入 sqlplus / as sysdba 回车 2.查看当前用户和状态 select username, account_status ...

  5. KubeOperator安装好后默认会占用80端口,替换成其他端口

    使用KubeOperator安装好k8s后,然后修改如下的配置文件,最后重启应用即可 重启:koctl restart

  6. oracle安装完成后解锁scott用户

    需要以管理员的身份 进行 解锁scott alter user scott account unlock;

  7. 如何修改wordpress博客默认管理员用户名称

    打开你的WordPress数据库,点击结构后面的SQL,输入下面一段命令执行 UPDATE wp_users SET user_login = '新用户名', user_nicename = '新用户 ...

  8. linux添加超级管理员用户,修改,删除用户

    useradd一个用户后,去修改/etc/passwd文件中的这个用户这一行,把其中的uid改为0,gid改为0(其中****代表一个用户名)这样****就具有root权限了 如:root2:x:0: ...

  9. winmail安装完成后,SMTP/POP3/ADMIN/HTTP/IMAP/LDAP服务不能启动?

    问题原因: 1.特殊端口被占用,可以用命令netstat -ano 查看 2.阿帕奇网络服务 httpd 未开启 解决方案:开启服务后,登录管理工具,点注册,它会自动跳出"httpd通过防火 ...

随机推荐

  1. 下载网络文件HttpURLConnection.getContentLength()大小为 0

    HttpURLConnection conn = (HttpURLConnection)url.openConnection(); conn.setRequestProperty("Acce ...

  2. Deep Learning.ai学习笔记_第五门课_序列模型

    目录 第一周 循环序列模型 第二周 自然语言处理与词嵌入 第三周 序列模型和注意力机制 第一周 循环序列模型 在进行语音识别时,给定一个输入音频片段X,并要求输出对应的文字记录Y,这个例子中输入和输出 ...

  3. java 线程间的通信 (wait / notify / notifyAll)

    package waitnotifytest; import java.util.Collections; import java.util.List; import com.google.commo ...

  4. centos mysql密码忘记了如何修改

    # /etc/init.d/mysql stop# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &# mysq ...

  5. Shell脚本编程(三):shell参数传递

    我们可以在执行 Shell 脚本时,向脚本传递参数,脚本内获取参数的格式为:$n.n 代表一个数字,1 为执行脚本的第一个参数,2 为执行脚本的第二个参数,以此类推…… 实例 以下实例我们向脚本传递三 ...

  6. Win10 calc.exe 无法打开计算器的解决方法

    先将所有程序关闭,以管理员身份运行 Windows PowerShell,之后输入以下命令 Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage - ...

  7. Sublime Text3 运行 PHP 文件

    在 Zend Studio(12.5)下可以通过 Run(Ctrl + F11)把 PHP 程序的执行结果通过 Debug Output 显示在 IDE 中,这样比开启 Server,再打开浏览器执行 ...

  8. windows保存的文件传输到linux中格式转换

    直接从window传输到linux的脚本执行时,会出现以下错误. -bash: xxx: /bin/sh^M: bad interpreter: No such file or directory 解 ...

  9. python学习小记

    python HTTP请求示例: # coding=utf-8 # more materials: http://docs.python-requests.org/zh_CN/latest/user/ ...

  10. List分组

    IEnumerable<IGrouping<string, SysMap>> query = sysMapList.GroupBy(pet => pet.Mobile);