blob: 02eaf83951c3c26c72b0fe439aec563152f4dc6b [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>]
Thomas Draebingd4aecea2021-05-10 17:06:16 +020017 [--clear-http-password]
18 [--delete-external-id <EXTERNALID>] <USER>
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080019--
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +020020
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080021== DESCRIPTION
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +020022Modifies a given user's settings. This command can be useful to
Peter Jönssone402ea72012-09-04 22:09:29 +020023deactivate an account, set HTTP password, add/delete ssh keys without
24going through the UI.
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +020025
26It also allows managing email addresses, which bypasses the
27verification step we force within the UI.
28
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080029== ACCESS
Richard Christie2a298382018-06-28 13:08:44 +010030Users can call this to update their own accounts. To update a different
31account, a caller must be a member of the privileged 'Administrators'
32group, or have been granted
David Ostrovskyaa49e272014-07-22 00:55:47 +020033link:access-control.html#capability_modifyAccount[the 'Modify Account' global capability].
David Ostrovskyc055d462014-08-22 08:20:59 +020034For security reasons only the members of the privileged 'Administrators'
35group can add or delete SSH keys for a user.
David Ostrovskyaa49e272014-07-22 00:55:47 +020036
David Ostrovskydb8dfae2014-07-23 02:38:32 +020037To set the HTTP password for the user account (option --http-password) or
38to clear the HTTP password (option --clear-http-password) caller must be
Khai Docf9bce22014-09-25 13:59:28 -070039a member of the privileged 'Administrators' group.
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +020040
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080041== SCRIPTING
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +020042This command is intended to be used in scripts.
43
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080044== OPTIONS
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +020045<USER>::
46 Required; Full name, email-address, SSH username or account id.
47
48--full-name::
David Pursehouse9c032552014-07-22 16:23:08 +090049 Set the display name for the user account.
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +020050+
51Names containing spaces should be quoted in single quotes (').
52This most likely requires double quoting the value, for example
53`--full-name "'A description string'"`.
54
55--active::
56 Set the account state to be active.
57
58--inactive::
59 Set the account state to be inactive. This prevents the
60 user from logging in.
61
62--add-email::
63 Add another email to the user's account. This doesn't
64 trigger the mail validation and adds the email directly
65 to the user's account.
66 May be supplied more than once to add multiple emails to
67 an account in a single command execution.
68
69--delete-email::
70 Delete an email from this user's account if it exists.
71 If the email provided is 'ALL', all associated emails are
72 deleted from this account.
David Pursehouse34f784a2015-05-12 14:02:41 +090073 May be supplied more than once to remove multiple emails
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +020074 from an account in a single command execution.
75
Khai Do635160f2014-07-23 14:50:49 -070076--preferred-email::
77 Sets the preferred email address for the user's account.
78 The email address must already have been registered
79 with the user's account before it can be set.
80 May be supplied with the delete-email option as long as
81 the emails are not the same.
82
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +020083--add-ssh-key::
84 Content of the public SSH key to add to the account's
85 keyring. If `-` the key is read from stdin, rather than
86 from the command line.
87 May be supplied more than once to add multiple SSH keys
88 in a single command execution.
89
90--delete-ssh-key::
91 Content of the public SSH key to remove from the account's
92 keyring or the comment associated with this key.
93 If `-` the key is read from stdin, rather than from the
94 command line. If the key provided is 'ALL', all
95 associated SSH keys are removed from this account.
96 May be supplied more than once to delete multiple SSH
97 keys in a single command execution.
98
Richard Christieefa38be2018-06-28 12:33:51 +010099--generate-http-password::
100 Generate a new random HTTP password for the user account
101 similar to the web ui. The password will be output to the
102 user on success with a line: `New password: <PASSWORD>`.
103
Peter Jönssone402ea72012-09-04 22:09:29 +0200104--http-password::
105 Set the HTTP password for the user account.
106
David Ostrovskydb8dfae2014-07-23 02:38:32 +0200107--clear-http-password::
108 Clear the HTTP password for the user account.
109
Thomas Draebingd4aecea2021-05-10 17:06:16 +0200110--delete-external-id::
111 Delete an external ID from a user's account if it exists.
112 If the external ID provided is 'ALL', all associated
113 external IDs are deleted from this account.
114 May be supplied more than once to remove multiple external
115 IDs from an account in a single command execution.
116
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800117== EXAMPLES
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +0200118Add an email and SSH key to `watcher`'s account:
119
Michael Ochmannb99feab2016-07-06 14:10:22 +0200120----
David Shevitzc47f2362018-09-27 10:55:35 -0700121$ 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 +0200122----
Deniz Turkoglu2c4bbcf2012-04-13 15:26:01 +0200123
124GERRIT
125------
126Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -0700127
128SEARCHBOX
129---------