You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add tabs to `elastic-agent unprivileged` and `elastic-agent privileged` commands
- Add `:group: os` and `:sync:` options to synchronize tabs across page
- Remove `.exe` extension from Windows examples
- Remove extra clarifying text from example descriptions
- Add Windows example for user+group installation
Co-authored-by: vishaangelova <91186315+vishaangelova@users.noreply.github.com>
Copy file name to clipboardExpand all lines: reference/fleet/elastic-agent-unprivileged.md
+59-12Lines changed: 59 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -153,18 +153,56 @@ For any installed {{agent}} you can change the mode that it’s running in by ru
153
153
154
154
Change mode from privileged to unprivileged:
155
155
156
+
:::::{tab-set}
157
+
:group: os
158
+
159
+
::::{tab-item} Linux/macOS
160
+
:sync: linux
161
+
156
162
```shell
157
163
sudo elastic-agent unprivileged
158
164
```
159
165
166
+
::::
167
+
168
+
::::{tab-item} Windows
169
+
:sync: windows
170
+
171
+
```shell
172
+
elastic-agent unprivileged
173
+
```
174
+
175
+
::::
176
+
177
+
:::::
178
+
160
179
Changing to `unprivileged` mode is prevented if the agent is currently enrolled in a policy that includes an integration that requires administrative access, such as the {{elastic-defend}} integration.
161
180
162
181
Change mode from unprivileged to privileged:
163
182
183
+
:::::{tab-set}
184
+
:group: os
185
+
186
+
::::{tab-item} Linux/macOS
187
+
:sync: linux
188
+
164
189
```shell
165
190
sudo elastic-agent privileged
166
191
```
167
192
193
+
::::
194
+
195
+
::::{tab-item} Windows
196
+
:sync: windows
197
+
198
+
```shell
199
+
elastic-agent privileged
200
+
```
201
+
202
+
::::
203
+
204
+
:::::
205
+
168
206
When an agent is running in `unprivileged` mode, if it doesn’t have the right level of privilege to read a data source, you can also adjust the agent’s privileges by adding `elastic-agent-user` to the user group that has privileges to read the data source.
169
207
170
208
As background, when you run {{agent}} in `unprivileged` mode, one user and one group are created on the host. The same names are used for all operating systems:
@@ -189,25 +227,24 @@ This functionality is in technical preview and may be changed or removed in a fu
189
227
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.
190
228
191
229
::::{note}
192
-
The `--password` parameter is only required on Windows. On Linux and macOS, the `--user` and `--group` parameters are optional:
193
-
194
-
* If you omit `--user`, {{agent}} uses (or creates) the default unprivileged user (`elastic-agent-user`).
195
-
* If you specify only `--group`, the agent runs unprivileged under its default user but with the requested group.
230
+
The `--password` parameter is only required on Windows. On Linux and macOS, the `--user` and `--group` parameters are optional. If you omit `--user`, {{agent}} uses (or creates) the default unprivileged user (`elastic-agent-user`). If you specify only `--group`, the agent runs unprivileged under its default user but with the requested group.
196
231
::::
197
232
198
233
To install {{agent}} in `unprivileged` mode as a specific user or group, use the following commands:
199
234
200
235
:::::{tab-set}
236
+
:group: os
201
237
202
238
::::{tab-item} Linux/macOS
239
+
:sync: linux
203
240
204
-
To install with a specific user (optional—if omitted, the default `elastic-agent-user` is used):
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.
245
289
246
290
:::::{tab-set}
291
+
:group: os
247
292
248
293
::::{tab-item} Linux/macOS
294
+
:sync: linux
249
295
250
-
To change to a specific user (optional—if omitted, the default `elastic-agent-user` is used):
296
+
To change to a specific user:
251
297
252
298
```shell
253
299
sudo elastic-agent unprivileged --user="username"
254
300
```
255
301
256
-
To change to a specific group (the agent runs under its default user with the specified group):
0 commit comments