Skip to content

Commit da74d8a

Browse files
Fix documentation for unprivileged mode with pre-existing user and group
- Add note explaining --password is only required on Windows - Add tabs to display separate examples for Windows vs Linux/macOS - Correct Linux/macOS examples to use --user/--group without --password - Add sudo prefix to Linux/macOS commands - Use .exe extension for Windows examples Fixes elastic/docs-content#5298 Co-authored-by: vishaangelova <91186315+vishaangelova@users.noreply.github.com>
1 parent 93a26b7 commit da74d8a

File tree

1 file changed

+75
-7
lines changed

1 file changed

+75
-7
lines changed

reference/fleet/elastic-agent-unprivileged.md

Lines changed: 75 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,24 +188,92 @@ This functionality is in technical preview and may be changed or removed in a fu
188188

189189
In certain cases you may want to install {{agent}} in `unprivileged` mode, with the agent running as a pre-existing user or as part of a pre-existing group. For example, on a Windows system you may have a service account in Active Directory and you’d like {{agent}} to run under that account.
190190

191-
To install {{agent}} in `unprivileged` mode as a specific user, add the `--user` and `--password` parameters to the install command:
191+
::::{note}
192+
The `--password` parameter is only required on Windows. On Linux and macOS, specifying the `--user` and/or `--group` parameters is sufficient.
193+
::::
194+
195+
To install {{agent}} in `unprivileged` mode as a specific user or group, use the following commands:
196+
197+
:::::{tab-set}
198+
199+
::::{tab-item} Linux/macOS
200+
201+
To install as a specific user:
192202

193203
```shell
194-
elastic-agent install --unprivileged --user="my.path\username" --password="mypassword"
204+
sudo elastic-agent install --unprivileged --user="username"
195205
```
196206

197-
To install {{agent}} in `unprivileged` mode as part of a specific group, add the `--group` and `--password` parameters to the install command:
207+
To install as part of a specific group:
198208

199209
```shell
200-
elastic-agent install --unprivileged --group="my.path\groupname" --password="mypassword"
210+
sudo elastic-agent install --unprivileged --group="groupname"
201211
```
202212

203-
Alternatively, if you have {{agent}} already installed with administrative privileges, you can change the agent to use `unprivileged` mode and to run as a specific user or in a specific group. For example:
213+
To install as a specific user and group:
214+
215+
```shell
216+
sudo elastic-agent install --unprivileged --user="username" --group="groupname"
217+
```
218+
219+
::::
220+
221+
::::{tab-item} Windows
222+
223+
On Windows, the `--password` parameter is required when specifying a custom user account.
224+
225+
To install as a specific user:
204226

205227
```shell
206-
elastic-agent unprivileged --user="my.path\username" --password="mypassword"
228+
elastic-agent.exe install --unprivileged --user="my.domain\username" --password="mypassword"
207229
```
208230

231+
To install as part of a specific group:
232+
209233
```shell
210-
elastic-agent unprivileged --group="my.path\groupname" --password="mypassword"
234+
elastic-agent.exe install --unprivileged --group="my.domain\groupname"
211235
```
236+
237+
::::
238+
239+
:::::
240+
241+
Alternatively, if you have {{agent}} already installed with administrative privileges, you can change the agent to use `unprivileged` mode and to run as a specific user or in a specific group.
242+
243+
:::::{tab-set}
244+
245+
::::{tab-item} Linux/macOS
246+
247+
To change to a specific user:
248+
249+
```shell
250+
sudo elastic-agent unprivileged --user="username"
251+
```
252+
253+
To change to a specific group:
254+
255+
```shell
256+
sudo elastic-agent unprivileged --group="groupname"
257+
```
258+
259+
::::
260+
261+
::::{tab-item} Windows
262+
263+
On Windows, the `--password` parameter is required when specifying a custom user account.
264+
265+
To change to a specific user:
266+
267+
```shell
268+
elastic-agent.exe unprivileged --user="my.domain\username" --password="mypassword"
269+
```
270+
271+
To change to a specific group:
272+
273+
```shell
274+
elastic-agent.exe unprivileged --group="my.domain\groupname"
275+
```
276+
277+
::::
278+
279+
:::::

0 commit comments

Comments
 (0)