[elasticsearch@elasticsearch elasticsearch-6.0.0]$ ./bin/x-pack/setup-passwords interactive Initiating the setup of reserved user elastic,kibana,logstash_system passwords. You will be prompted to enter passwords as the process progresses. Please confirm that you would liketocontinue [y/N]y
Enter passwordfor [elastic]: Reenter passwordfor [elastic]: Enter passwordfor [kibana]: Reenter passwordfor [kibana]: Enter passwordfor [logstash_system]: Reenter passwordfor [logstash_system]: Changed passwordforuser [kibana] Changed passwordforuser [logstash_system] Changed passwordforuser [elastic] [elasticsearch@elasticsearch elasticsearch-6.0.0]$
[elasticsearch@elasticsearch elasticsearch-6.0.0]$ curl 'http://10.59.30.96:9200/_cat/indices?pretty' -u logstash_system:logstash_system { "error" : { "root_cause" : [ { "type" : "security_exception", "reason" : "action [indices:monitor/stats] is unauthorized for user [logstash_system]" } ], "type" : "security_exception", "reason" : "action [indices:monitor/stats] is unauthorized for user [logstash_system]" }, "status" : 403 } [elasticsearch@elasticsearch elasticsearch-6.0.0]$
使用kibana用户访问
1 2 3 4 5 6 7 8
[elasticsearch@elasticsearch elasticsearch-6.0.0]$ curl 'http://10.59.30.96:9200/_cat/indices?pretty' -u kibana:kibana yellow open .monitoring-es-6-2018.01.10 nND6-i_rR5iLEYVccBGj8w 11 yellow open .triggered_watches BtygGZisSDqiL3Y2TaQGqQ11 green open .security-6QVRL1mcFSAilryHGEhen7Q10 yellow open .watcher-history-6-2018.01.10SBGiHDAnTPiXFoHU65VY_g11 yellow open .watches kMzN4j5cQySZQQSDVPww8w 11 yellow open .monitoring-alerts-6VygY6VN9R3S0PR_jrGy50Q11 [elasticsearch@elasticsearch elasticsearch-6.0.0]$
[elasticsearch@elasticsearch elasticsearch-6.0.0]$ curl -XGET-u user01:user01 'http://10.59.30.96:9200/_cat/indices?pretty' { "error" : { "root_cause" : [ { "type" : "security_exception", "reason" : "action [cluster:monitor/state] is unauthorized for user [user01]" } ], "type" : "security_exception", "reason" : "action [cluster:monitor/state] is unauthorized for user [user01]" }, "status" : 403 } [elasticsearch@elasticsearch elasticsearch-6.0.0]$ curl -XGET-u user11:user11 'http://10.59.30.96:9200/_cat/indices?pretty' yellow open .monitoring-es-6-2018.01.10 nND6-i_rR5iLEYVccBGj8w 116178445.9mb 5.9mb yellow open .triggered_watches BtygGZisSDqiL3Y2TaQGqQ110011.7kb 11.7kb green open .security-6QVRL1mcFSAilryHGEhen7Q10 yellow open .watcher-history-6-2018.01.10SBGiHDAnTPiXFoHU65VY_g1177701.1mb 1.1mb yellow open .watches kMzN4j5cQySZQQSDVPww8w 115040.2kb 40.2kb yellow open .monitoring-alerts-6VygY6VN9R3S0PR_jrGy50Q111012.8kb 12.8kb [elasticsearch@elasticsearch elasticsearch-6.0.0]$
常见报错
No subject alternative names matching IP address
1 2 3 4
[2018-01-10T19:19:35,483][WARN ][o.e.x.s.t.n.SecurityNetty4Transport][fzP4t-4] exception caught on transport layer [[id: 0x5d97fe48, L:/0:0:0:0:0:0:0:1:49121 ! R:/0:0:0:0:0:0:0:1:9300]], closing connection io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: General SSLEngine problem ...... Caused by: java.security.cert.CertificateException: No subject alternative names matching IP address0:0:0:0:0:0:0:1 found