4 title: User management at the CLI
7 Copyright (C) The Arvados Authors. All rights reserved.
9 SPDX-License-Identifier: CC-BY-SA-3.0
15 ARVADOS_API_HOST={{ site.arvados_api_host }}
16 ARVADOS_API_TOKEN=1234567890qwertyuiopasdfghjklzxcvbnm1234567890zzzz
19 In these examples, @zzzzz-tpzed-3kz0nwtjehhl0u4@ is the sample user account. Replace with the uuid of the user you wish to manipulate.
21 See "user management":{{site.baseurl}}/admin/activation.html for an overview of how to use these commands.
25 This creates a default git repository and VM login. Enables user to self-activate using Workbench.
28 <pre><code>$ <span class="userinput">arv user setup --uuid zzzzz-tpzed-3kz0nwtjehhl0u4</span>
36 <pre><code>$ <span class="userinput">arv user unsetup --uuid zzzzz-tpzed-3kz0nwtjehhl0u4</span>
41 When deactivating a user, you may also want to "reassign ownership of their data":{{site.baseurl}}/admin/reassign-ownership.html .
43 h3. Directly activate user
46 <pre><code>$ <span class="userinput">arv user update --uuid "zzzzz-tpzed-3kz0nwtjehhl0u4" --user '{"is_active":true}'</span>
50 Note: this bypasses user agreements checks, and does not set up the user with a default git repository or VM login.
52 h3(#create-token). Create a token for a user
54 As an admin, you can create tokens for other users.
57 <pre><code>$ <span class="userinput">arv api_client_authorization create --api-client-authorization '{"owner_uuid": "zzzzz-tpzed-fr97h9t4m5jffxs"}'</span>
59 "href":"/api_client_authorizations/zzzzz-gj3su-yyyyyyyyyyyyyyy",
60 "kind":"arvados#apiClientAuthorization",
61 "etag":"9yk144t0v6cvyp0342exoh2vq",
62 "uuid":"zzzzz-gj3su-yyyyyyyyyyyyyyy",
63 "owner_uuid":"zzzzz-tpzed-fr97h9t4m5jffxs",
64 "created_at":"2020-03-12T20:36:12.517375422Z",
65 "modified_by_client_uuid":null,
66 "modified_by_user_uuid":null,
70 "api_token":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
71 "created_by_ip_address":null,
72 "default_owner_uuid":null,
75 "last_used_by_ip_address":null,
82 To get the token string, combine the values of @uuid@ and @api_token@ in the form "v2/$uuid/$api_token". In this example the string that goes in @ARVADOS_API_TOKEN@ would be:
85 ARVADOS_API_TOKEN=v2/zzzzz-gj3su-yyyyyyyyyyyyyyy/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
88 h2. Adding Permissions
92 Give @$user_uuid@ permission to log in to @$vm_uuid@ as @$target_username@
95 user_uuid=xxxxxxxchangeme
96 vm_uuid=xxxxxxxchangeme
97 target_username=xxxxxxxchangeme
99 read -rd $'\000' newlink <<EOF; arv link create --link "$newlink"
101 "tail_uuid":"$user_uuid",
102 "head_uuid":"$vm_uuid",
103 "link_class":"permission",
105 "properties":{"username":"$target_username"}
112 Give @$user_uuid@ permission to commit to @$repo_uuid@ as @$repo_username@
115 user_uuid=xxxxxxxchangeme
116 repo_uuid=xxxxxxxchangeme
117 repo_username=xxxxxxxchangeme
119 read -rd $'\000' newlink <<EOF; arv link create --link "$newlink"
121 "tail_uuid":"$user_uuid",
122 "head_uuid":"$repo_uuid",
123 "link_class":"permission",
125 "properties":{"username":"$repo_username"}