blob: f6ee753cc604adbb00519a13809ce70ee197cc47 [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
Nasser Grainawi21f8fb42010-04-14 16:55:18 -06004suexec - Execute a command as any registered user account
5
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006== SYNOPSIS
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08007--
Shawn O. Pearce47769242011-06-14 16:40:48 -07008'ssh' -p <port>
9 -i SITE_PATH/etc/ssh_host_rsa_key
10 '"Gerrit Code Review@localhost"'
11 'suexec'
12 --as <EMAIL>
13 [--from HOST:PORT]
14 [--]
15 [COMMAND]
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080016--
Nasser Grainawi21f8fb42010-04-14 16:55:18 -060017
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080018== DESCRIPTION
Shawn Pearce08ae5772013-06-11 13:47:21 -070019The suexec command permits executing any other command as any other
Shawn O. Pearce47769242011-06-14 16:40:48 -070020registered user account.
Nasser Grainawi21f8fb42010-04-14 16:55:18 -060021
Shawn Pearce08ae5772013-06-11 13:47:21 -070022suexec can only be invoked by the magic user `Gerrit Code Review`,
23or any user granted granted the link:access-control.html#capability_runAs[Run As]
24capability. The run as capability is permitted to be used only if
25link:config-gerrit.html[auth.enableRunAs] is true.
26
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080027== OPTIONS
Nasser Grainawi21f8fb42010-04-14 16:55:18 -060028
Shawn O. Pearce47769242011-06-14 16:40:48 -070029--as::
Nasser Grainawi21f8fb42010-04-14 16:55:18 -060030 Email address of the user you want to impersonate.
Shawn O. Pearce47769242011-06-14 16:40:48 -070031
32--from::
33 Hostname and port of the machine you want to impersonate
34 the command coming from.
35
Nasser Grainawi21f8fb42010-04-14 16:55:18 -060036COMMAND::
37 Gerrit command you want to run.
38
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080039== ACCESS
Shawn O. Pearce47769242011-06-14 16:40:48 -070040Caller must be the magic user Gerrit Code Review using the SSH
Shawn Pearce08ae5772013-06-11 13:47:21 -070041daemon's host key, or a key on this daemon's peer host key ring,
42or a user granted the Run As capability.
Nasser Grainawi21f8fb42010-04-14 16:55:18 -060043
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080044== SCRIPTING
Nasser Grainawi21f8fb42010-04-14 16:55:18 -060045This command is intended to be used in scripts.
46
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080047== EXAMPLES
Nasser Grainawi21f8fb42010-04-14 16:55:18 -060048
49Approve the change with commit c0ff33 as "Verified +1" as user bob@example.com
50=====
Shawn O. Pearce47769242011-06-14 16:40:48 -070051 $ sudo -u gerrit ssh -p 29418 \
52 -i site_path/etc/ssh_host_rsa_key \
53 "Gerrit Code Review@localhost" \
54 suexec \
55 --as bob@example.com \
56 -- \
57 gerrit approve --verified +1 c0ff33
Nasser Grainawi21f8fb42010-04-14 16:55:18 -060058=====
59
60GERRIT
61------
62Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -070063
64SEARCHBOX
65---------