mirror of
https://github.com/taigrr/nats.docs
synced 2025-01-18 04:03:23 -08:00
Replace mkpasswd with natscli (#223)
With mkpasswd now gone from nats-server, this change replaces instances of mkpasswd with the new official natscli tool.
This commit is contained in:
@@ -29,12 +29,14 @@ Listening on [>]
|
||||
|
||||
Tokens can be bcrypted enabling an additional layer of security, as the clear-text version of the token would not be persisted on the server configuration file.
|
||||
|
||||
You can generate bcrypted tokens and passwords using the [`mkpasswd`](../../../../nats-tools/mkpasswd.md) tool:
|
||||
You can generate bcrypted tokens and passwords using the [`nats`](../../../../nats-tools/natscli.md) tool:
|
||||
|
||||
```text
|
||||
> mkpasswd
|
||||
pass: dag0HTXl4RGg7dXdaJwbC8
|
||||
bcrypt hash: $2a$11$PWIFAL8RsWyGI3jVZtO9Nu8.6jOxzxfZo7c/W0eLk017hjgUKWrhy
|
||||
> nats server passwd
|
||||
? Enter password [? for help] **********************
|
||||
? Reenter password [? for help] **********************
|
||||
|
||||
$2a$11$PWIFAL8RsWyGI3jVZtO9Nu8.6jOxzxfZo7c/W0eLk017hjgUKWrhy
|
||||
```
|
||||
|
||||
Here's a simple configuration file:
|
||||
|
||||
@@ -30,12 +30,14 @@ authorization: {
|
||||
|
||||
## Bcrypted Passwords
|
||||
|
||||
Username/password also supports bcrypted passwords using the [`mkpasswd`](../../../../nats-tools/mkpasswd.md) tool. Simply replace the clear text password with the bcrypted entries:
|
||||
Username/password also supports bcrypted passwords using the [`nats`](../../../../nats-tools/natscli.md) tool. Simply replace the clear text password with the bcrypted entries:
|
||||
|
||||
```text
|
||||
> mkpasswd
|
||||
pass: (Uffs#rG42PAu#Oxi^BNng
|
||||
bcrypt hash: $2a$11$V1qrpBt8/SLfEBr4NJq4T.2mg8chx8.MTblUiTBOLV3MKDeAy.f7u
|
||||
> nats server passwd
|
||||
? Enter password [? for help] **********************
|
||||
? Reenter password [? for help] **********************
|
||||
|
||||
$2a$11$V1qrpBt8/SLfEBr4NJq4T.2mg8chx8.MTblUiTBOLV3MKDeAy.f7u
|
||||
```
|
||||
|
||||
And on the configuration file:
|
||||
@@ -44,7 +46,7 @@ And on the configuration file:
|
||||
authorization: {
|
||||
users: [
|
||||
{user: a, password: "$2a$11$V1qrpBt8/SLfEBr4NJq4T.2mg8chx8.MTblUiTBOLV3MKDeAy.f7u"},
|
||||
...
|
||||
...
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user