Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1 | = suexec |
Nasser Grainawi | 21f8fb4 | 2010-04-14 16:55:18 -0600 | [diff] [blame] | 2 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3 | == NAME |
David Shevitz | c47f236 | 2018-09-27 10:55:35 -0700 | [diff] [blame] | 4 | suexec - Execute a command as any registered user account. |
Nasser Grainawi | 21f8fb4 | 2010-04-14 16:55:18 -0600 | [diff] [blame] | 5 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6 | == SYNOPSIS |
Michael Ochmann | e2d76a1 | 2016-06-23 17:07:37 +0200 | [diff] [blame] | 7 | [verse] |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 8 | -- |
Michael Ochmann | e2d76a1 | 2016-06-23 17:07:37 +0200 | [diff] [blame] | 9 | _ssh_ -p <port> |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 10 | -i SITE_PATH/etc/ssh_host_rsa_key |
Michael Ochmann | e2d76a1 | 2016-06-23 17:07:37 +0200 | [diff] [blame] | 11 | "Gerrit Code Review@localhost" |
| 12 | _suexec_ |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 13 | --as <EMAIL> |
| 14 | [--from HOST:PORT] |
| 15 | [--] |
| 16 | [COMMAND] |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 17 | -- |
Nasser Grainawi | 21f8fb4 | 2010-04-14 16:55:18 -0600 | [diff] [blame] | 18 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 19 | == DESCRIPTION |
Shawn Pearce | 08ae577 | 2013-06-11 13:47:21 -0700 | [diff] [blame] | 20 | The suexec command permits executing any other command as any other |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 21 | registered user account. |
Nasser Grainawi | 21f8fb4 | 2010-04-14 16:55:18 -0600 | [diff] [blame] | 22 | |
Shawn Pearce | 08ae577 | 2013-06-11 13:47:21 -0700 | [diff] [blame] | 23 | suexec can only be invoked by the magic user `Gerrit Code Review`, |
| 24 | or any user granted granted the link:access-control.html#capability_runAs[Run As] |
| 25 | capability. The run as capability is permitted to be used only if |
| 26 | link:config-gerrit.html[auth.enableRunAs] is true. |
| 27 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 28 | == OPTIONS |
Nasser Grainawi | 21f8fb4 | 2010-04-14 16:55:18 -0600 | [diff] [blame] | 29 | |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 30 | --as:: |
Nasser Grainawi | 21f8fb4 | 2010-04-14 16:55:18 -0600 | [diff] [blame] | 31 | Email address of the user you want to impersonate. |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 32 | |
| 33 | --from:: |
| 34 | Hostname and port of the machine you want to impersonate |
| 35 | the command coming from. |
| 36 | |
Nasser Grainawi | 21f8fb4 | 2010-04-14 16:55:18 -0600 | [diff] [blame] | 37 | COMMAND:: |
| 38 | Gerrit command you want to run. |
| 39 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 40 | == ACCESS |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 41 | Caller must be the magic user Gerrit Code Review using the SSH |
Shawn Pearce | 08ae577 | 2013-06-11 13:47:21 -0700 | [diff] [blame] | 42 | daemon's host key, or a key on this daemon's peer host key ring, |
| 43 | or a user granted the Run As capability. |
Nasser Grainawi | 21f8fb4 | 2010-04-14 16:55:18 -0600 | [diff] [blame] | 44 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 45 | == SCRIPTING |
Nasser Grainawi | 21f8fb4 | 2010-04-14 16:55:18 -0600 | [diff] [blame] | 46 | This command is intended to be used in scripts. |
| 47 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 48 | == EXAMPLES |
Nasser Grainawi | 21f8fb4 | 2010-04-14 16:55:18 -0600 | [diff] [blame] | 49 | |
| 50 | Approve the change with commit c0ff33 as "Verified +1" as user bob@example.com |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 51 | ---- |
David Shevitz | c47f236 | 2018-09-27 10:55:35 -0700 | [diff] [blame] | 52 | $ sudo -u gerrit ssh -p 29418 \ |
| 53 | -i site_path/etc/ssh_host_rsa_key \ |
| 54 | "Gerrit Code Review@localhost" \ |
| 55 | suexec \ |
| 56 | --as bob@example.com \ |
| 57 | -- \ |
| 58 | gerrit approve --verified +1 c0ff33 |
Michael Ochmann | b99feab | 2016-07-06 14:10:22 +0200 | [diff] [blame] | 59 | ---- |
Nasser Grainawi | 21f8fb4 | 2010-04-14 16:55:18 -0600 | [diff] [blame] | 60 | |
| 61 | GERRIT |
| 62 | ------ |
| 63 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 64 | |
| 65 | SEARCHBOX |
| 66 | --------- |