Skip to main content

Create

Make a user and a random password for each osapi role.

It makes a user for each osapi role (setup, controller, agent and join), each with a random password and the least permissions of its role. It writes osapi-nats.yaml, the part of osapi.yaml with the users of the embedded server and the auth of the controller and the agent, and nats-server.conf, the authorization block of a NATS server that osapi does not run. Each file is mode 0600, and no password is on the command line. --print also prints the server's block.

osapi nats auth password create [flags]

Examples​

osapi nats auth password create --out /etc/osapi/nats

Result​

The command prints:

$ osapi nats auth password create --out /etc/osapi/nats
NATS auth:

Files (2):
  ROLE    PATH
  osapi   /etc/osapi/nats/osapi-nats.yaml
  server  /etc/osapi/nats/nats-server.conf

With --json, the command prints:

{
"files": [
{
"role": "osapi",
"path": "/etc/osapi/nats/osapi-nats.yaml"
},
{
"role": "server",
"path": "/etc/osapi/nats/nats-server.conf"
}
]
}

Flags​

FlagDescriptionDefault
--outThe directory that the files go to. It is made, mode 0700, when it is not there (required)
--printAlso print the server's part: its authorization block, or its resolver file

Global flags​

FlagDescriptionDefault
-d, --debugEnable or disable debug mode
-j, --jsonEnable JSON output
-f, --osapi-filePath to config file; without one at the default path, osapi runs on the defaults/etc/osapi/osapi.yaml

Output tells how the result is printed, and what --json gives.