blob: 6808e017d66aff098e5b01ef2674b352c18468ef [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= gerrit set-account
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +02002
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003== NAME
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +02004gerrit set-account - Change an account's settings.
5
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006== SYNOPSIS
Michael Ochmanne2d76a12016-06-23 17:07:37 +02007[verse]
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08008--
Michael Ochmanne2d76a12016-06-23 17:07:37 +02009_ssh_ -p <port> <host> _gerrit set-account_
10 [--full-name <FULLNAME>] [--active|--inactive]
11 [--add-email <EMAIL>] [--delete-email <EMAIL> | ALL]
12 [--preferred-email <EMAIL>]
13 [--add-ssh-key - | <KEY>]
14 [--delete-ssh-key - | <KEY> | ALL]
Richard Christieefa38be2018-06-28 12:33:51 +010015 [--generate-http-password]
Michael Ochmanne2d76a12016-06-23 17:07:37 +020016 [--http-password <PASSWORD>]
17 [--clear-http-password] <USER>
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080018--
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +020019
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080020== DESCRIPTION
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +020021Modifies a given user's settings. This command can be useful to
Peter Jönssone402ea72012-09-04 22:09:29 +020022deactivate an account, set HTTP password, add/delete ssh keys without
23going through the UI.
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +020024
25It also allows managing email addresses, which bypasses the
26verification step we force within the UI.
27
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080028== ACCESS
Richard Christie2a298382018-06-28 13:08:44 +010029Users can call this to update their own accounts. To update a different
30account, a caller must be a member of the privileged 'Administrators'
31group, or have been granted
David Ostrovskyaa49e272014-07-22 00:55:47 +020032link:access-control.html#capability_modifyAccount[the 'Modify Account' global capability].
David Ostrovskyc055d462014-08-22 08:20:59 +020033For security reasons only the members of the privileged 'Administrators'
34group can add or delete SSH keys for a user.
David Ostrovskyaa49e272014-07-22 00:55:47 +020035
David Ostrovskydb8dfae2014-07-23 02:38:32 +020036To set the HTTP password for the user account (option --http-password) or
37to clear the HTTP password (option --clear-http-password) caller must be
Khai Docf9bce22014-09-25 13:59:28 -070038a member of the privileged 'Administrators' group.
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +020039
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080040== SCRIPTING
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +020041This command is intended to be used in scripts.
42
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080043== OPTIONS
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +020044<USER>::
45 Required; Full name, email-address, SSH username or account id.
46
47--full-name::
David Pursehouse9c032552014-07-22 16:23:08 +090048 Set the display name for the user account.
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +020049+
50Names containing spaces should be quoted in single quotes (').
51This most likely requires double quoting the value, for example
52`--full-name "'A description string'"`.
53
54--active::
55 Set the account state to be active.
56
57--inactive::
58 Set the account state to be inactive. This prevents the
59 user from logging in.
60
61--add-email::
62 Add another email to the user's account. This doesn't
63 trigger the mail validation and adds the email directly
64 to the user's account.
65 May be supplied more than once to add multiple emails to
66 an account in a single command execution.
67
68--delete-email::
69 Delete an email from this user's account if it exists.
70 If the email provided is 'ALL', all associated emails are
71 deleted from this account.
David Pursehouse34f784a2015-05-12 14:02:41 +090072 May be supplied more than once to remove multiple emails
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +020073 from an account in a single command execution.
74
Khai Do635160f2014-07-23 14:50:49 -070075--preferred-email::
76 Sets the preferred email address for the user's account.
77 The email address must already have been registered
78 with the user's account before it can be set.
79 May be supplied with the delete-email option as long as
80 the emails are not the same.
81
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +020082--add-ssh-key::
83 Content of the public SSH key to add to the account's
84 keyring. If `-` the key is read from stdin, rather than
85 from the command line.
86 May be supplied more than once to add multiple SSH keys
87 in a single command execution.
88
89--delete-ssh-key::
90 Content of the public SSH key to remove from the account's
91 keyring or the comment associated with this key.
92 If `-` the key is read from stdin, rather than from the
93 command line. If the key provided is 'ALL', all
94 associated SSH keys are removed from this account.
95 May be supplied more than once to delete multiple SSH
96 keys in a single command execution.
97
Richard Christieefa38be2018-06-28 12:33:51 +010098--generate-http-password::
99 Generate a new random HTTP password for the user account
100 similar to the web ui. The password will be output to the
101 user on success with a line: `New password: <PASSWORD>`.
102
Peter Jönssone402ea72012-09-04 22:09:29 +0200103--http-password::
104 Set the HTTP password for the user account.
105
David Ostrovskydb8dfae2014-07-23 02:38:32 +0200106--clear-http-password::
107 Clear the HTTP password for the user account.
108
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800109== EXAMPLES
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +0200110Add an email and SSH key to `watcher`'s account:
111
Michael Ochmannb99feab2016-07-06 14:10:22 +0200112----
David Shevitzc47f2362018-09-27 10:55:35 -0700113$ cat ~/.ssh/id_watcher.pub | ssh -p 29418 review.example.com gerrit set-account --add-ssh-key - --add-email mail@example.com watcher
Michael Ochmannb99feab2016-07-06 14:10:22 +0200114----
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +0200115
116GERRIT
117------
118Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -0700119
120SEARCHBOX
121---------