The device command can be used to connect to, disconnect from, and view the connection status of naisdevice.
Currently, the command requires the processes
naisdevice-helper to run, both of which can be run by starting naisdevice.
Requests a connection and waits for success. The expected result is "Connected".
nais device connect
Requests a disconnection and waits for success. The expected result is "Disconnected".
nais device disconnect
Prints the current connection status of
This includes connection status, as well as gateways and their current statuses.
nais device status
|quiet||No||-q||false||Only print connection status.|
|output||No||-o||''||Specify output format. (yaml|
If the output format and quiet flags are specified, output takes precedence.
Starts the just-in-time access flow for a named gateway. This should redirect you to a browser to submit a request for just-in-time access.
nais device jita my-privileged-access-gateway
|gateway||Yes||The desired gateway to establish a connection to.|
Which gateways require just-in-time access?
You can view gateways and their JITA requirement with
nais device status.
This snippet explicitly shows the names of gateways with that requirement.
nais device status -ojson | jq -r '.Gateways | select(.requiresPrivilegedAccess == true) | .name'
Shows and adjusts the naisdevice-agent configuration.
Shows the current naisdevice-agent configuration.
Currently, there are only to config fields:
nais device config get
Sets a naisdevice-agent configuration field to a desired value.
nais device config set AutoConnect true
|setting||Yes||The setting to adjust. Must be one of
|value||Yes||The value to set. Must be one of