blob: 9808edcb0887f3727f2772791569c1ff3cb0a2cc [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= suexec
Nasser Grainawi21f8fb42010-04-14 16:55:18 -06002
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003== NAME
David Shevitzc47f2362018-09-27 10:55:35 -07004suexec - Execute a command as any registered user account.
Nasser Grainawi21f8fb42010-04-14 16:55:18 -06005
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>
Shawn O. Pearce47769242011-06-14 16:40:48 -070010 -i SITE_PATH/etc/ssh_host_rsa_key
Michael Ochmanne2d76a12016-06-23 17:07:37 +020011 "Gerrit Code Review@localhost"
12 _suexec_
Shawn O. Pearce47769242011-06-14 16:40:48 -070013 --as <EMAIL>
14 [--from HOST:PORT]
15 [--]
16 [COMMAND]
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080017--
Nasser Grainawi21f8fb42010-04-14 16:55:18 -060018
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080019== DESCRIPTION
Shawn Pearce08ae5772013-06-11 13:47:21 -070020The suexec command permits executing any other command as any other
Shawn O. Pearce47769242011-06-14 16:40:48 -070021registered user account.
Nasser Grainawi21f8fb42010-04-14 16:55:18 -060022
Shawn Pearce08ae5772013-06-11 13:47:21 -070023suexec can only be invoked by the magic user `Gerrit Code Review`,
24or any user granted granted the link:access-control.html#capability_runAs[Run As]
25capability. The run as capability is permitted to be used only if
26link:config-gerrit.html[auth.enableRunAs] is true.
27
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080028== OPTIONS
Nasser Grainawi21f8fb42010-04-14 16:55:18 -060029
Shawn O. Pearce47769242011-06-14 16:40:48 -070030--as::
Nasser Grainawi21f8fb42010-04-14 16:55:18 -060031 Email address of the user you want to impersonate.
Shawn O. Pearce47769242011-06-14 16:40:48 -070032
33--from::
34 Hostname and port of the machine you want to impersonate
35 the command coming from.
36
Nasser Grainawi21f8fb42010-04-14 16:55:18 -060037COMMAND::
38 Gerrit command you want to run.
39
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080040== ACCESS
Shawn O. Pearce47769242011-06-14 16:40:48 -070041Caller must be the magic user Gerrit Code Review using the SSH
Shawn Pearce08ae5772013-06-11 13:47:21 -070042daemon's host key, or a key on this daemon's peer host key ring,
43or a user granted the Run As capability.
Nasser Grainawi21f8fb42010-04-14 16:55:18 -060044
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080045== SCRIPTING
Nasser Grainawi21f8fb42010-04-14 16:55:18 -060046This command is intended to be used in scripts.
47
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080048== EXAMPLES
Nasser Grainawi21f8fb42010-04-14 16:55:18 -060049
50Approve the change with commit c0ff33 as "Verified +1" as user bob@example.com
Michael Ochmannb99feab2016-07-06 14:10:22 +020051----
David Shevitzc47f2362018-09-27 10:55:35 -070052$ 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 Ochmannb99feab2016-07-06 14:10:22 +020059----
Nasser Grainawi21f8fb42010-04-14 16:55:18 -060060
61GERRIT
62------
63Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -070064
65SEARCHBOX
66---------