User
Manage a user in the Opal internal user directory.
opal user <CREDENTIALS> [OPTIONS] [EXTRAS]
Options
Option |
Description |
---|---|
|
User name |
|
Fetch a user (all users are returned if no option –name is given) |
|
Delete the user specified by the –name option |
|
Add a user specified by the –name option |
|
Update user password/certificate, status (enable/disable) and groups |
|
User password of at least six characters. |
|
User certificate (public key) file |
|
Disable user account (if omitted the user is enabled by default). |
|
User groups (separated by space) |
Credentials
Authentication can be done by username/password credentials OR by personal access token OR by certificate/private key pair (two-way SSL authentication).
Option |
Description |
---|---|
|
Opal server base url |
|
Credentials auth: user name (requires a password) |
|
Credentials auth: user password (requires a user name) |
|
Token auth: user’s personal access token |
|
Two-way SSL auth: certificate/public key file (requires a private key) |
|
Two-way SSL auth: private key file (requires a certificate) |
Extras
Option |
Description |
---|---|
|
Show the command help’s message. |
|
Verbose output. |
|
Output pretty-print JSON |
Example
Get the list of users with associated groups
opal user --opal https://opal-demo.obiba.org --user administrator --password password --fetch
Get a specific user with associated groups
opal user --opal https://opal-demo.obiba.org --user administrator --password password --fetch --name user1
Create the user user2
opal user --opal https://opal-demo.obiba.org --user administrator --password password --add --name user2 --upassword 123456
Create the user user3 with a certificate
opal user --opal https://opal-demo.obiba.org --user administrator --ucertificate /path/to/certifcate.pem --add --name user3
Create the user (disabled) user4 with groups group1, group2 and group3
opal user --opal https://opal-demo.obiba.org --user administrator --password password --add --name user4 --disabled --upassword 123456 --groups group1 group2 group3
Update user2’s password
opal user --opal https://opal-demo.obiba.org --user administrator --password password --update --name user2 --upassword 987654
Update user2’s status, set to disabled
opal user --opal https://opal-demo.obiba.org --user administrator --password password --update --name user2 --disabled
Update user2’s status, set to enabled
opal user --opal https://opal-demo.obiba.org --user administrator --password password --update --name user2
Update user2’s groups
opal user --opal https://opal-demo.obiba.org --user administrator --password password --update --name user2 --groups group1 group2
Delete the user user3
opal user --opal https://opal-demo.obiba.org --user administrator --password password --delete --name user2