0

Cấu hình store password cho 2 file ssl

Khi bạn chạy các lệnh elasticsearch-certutil, nếu nó yêu cầu tên file và mật khẩu, bạn có thể cung cấp trực tiếp các thông tin này qua dòng lệnh hoặc nhập tương tác khi được hỏi.

Dưới đây là cách thực hiện với tên file và mật khẩu:

Bước 1: Tạo CA với tên file và mật khẩu Chạy lệnh tạo CA và cung cấp tên file cùng mật khẩu:

bin/elasticsearch-certutil ca --out elastic-stack-ca.p12 --pass "your_password"

--out: Đặt tên file xuất ra (ở đây là elastic-stack-ca.p12). --pass: Mật khẩu cho CA. Bước 2: Tạo keystore với CA và mật khẩu Sau khi có CA, bạn có thể tạo keystore với lệnh:

bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12 --ca-pass "your_password" --out elastic-certificates.p12 --pass "keystore_password"

--ca: Đường dẫn tới file CA vừa tạo (elastic-stack-ca.p12). --ca-pass: Mật khẩu của CA (phải khớp với mật khẩu đã đặt ở bước 1). --out: Tên file keystore (ở đây là elastic-certificates.p12). --pass: Mật khẩu cho keystore (mật khẩu mới cho file keystore này). Bước 3: Cấu hình Elasticsearch Sau khi tạo xong keystore, bạn tiếp tục làm theo các bước cấu hình đã hướng dẫn ở trên. Đừng quên cập nhật file elasticsearch.yml để thêm mật khẩu cho keystore nếu bạn đã đặt mật khẩu:

xpack.security.enabled: true
xpack.security.http.ssl.enabled: true
xpack.security.http.ssl.keystore.path: "elastic-certificates.p12"
xpack.security.http.ssl.keystore.password: "keystore_password"
xpack.security.http.ssl.truststore.path: "elastic-certificates.p12"
xpack.security.http.ssl.truststore.password: "keystore_password"

All rights reserved

Viblo
Hãy đăng ký một tài khoản Viblo để nhận được nhiều bài viết thú vị hơn.
Đăng kí