Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 25, 2025

Summary

Resolves #2808

The use of the --password parameter in the documentation was incorrect—it's only required on Windows, not Linux/macOS. The existing examples incorrectly showed --password for all platforms.

Changes:

  • Added note clarifying that on Windows, the --password parameter is required when specifying a custom user account
  • Clarified that on Linux/macOS, the --user and --group parameters are optional—if --user is omitted, the default elastic-agent-user is used; if only --group is specified, the agent runs unprivileged with the requested group using the default user
  • Split all examples into platform-specific tabs (Linux/macOS vs Windows) with synchronized tab groups using :group: os and :sync: options
  • Corrected Linux/macOS examples to use only --user/--group without --password
  • Added sudo prefix to Linux/macOS commands
  • Updated elastic-agent install, elastic-agent unprivileged, and elastic-agent privileged command examples with tabs
  • Added tabs to the initial install example in the "Run {{agent}} in unprivileged mode" section
  • Fixed nested bullet point formatting in the important note section—converted nested bullets to paragraphs under their respective list items

Before (incorrect):

elastic-agent install --unprivileged --user="my.path\username" --password="mypassword"

After (Linux/macOS):

sudo elastic-agent install --unprivileged --user="username" --group="groupname"

After (Windows, from PowerShell):

elastic-agent install --unprivileged --user="my.domain\username" --password="mypassword" --group="my.domain\groupname"

Generative AI disclosure

  1. Did you use a generative AI (GenAI) tool to assist in creating this contribution?
  • Yes
  • No

Tool(s) and model(s) used: GitHub Copilot (Claude)

Preview

reference/fleet/elastic-agent-unprivileged.md


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

- 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 <[email protected]>
Copilot AI changed the title [WIP] Fix documentation for unprivileged mode command Fix documentation for unprivileged mode with pre-existing user and group Nov 25, 2025
Copilot AI requested a review from vishaangelova November 25, 2025 09:18
Copilot finished work on behalf of vishaangelova November 25, 2025 09:18
@vishaangelova
Copy link
Contributor

@copilot the changes should be made to the elastic-agent unprivileged command as well. Also, on Linux/macOS, --user is optional when you install or switch to unprivileged mode.
If you omit --user, Elastic Agent will use (or create) the default unprivileged user.
If you specify only a group, the agent will still run unprivileged under its default user but with the group that was requested. Make changes to the examples and text accordingly.

- Update note to explain --user and --group are optional on Linux/macOS
- Clarify that if --user is omitted, default elastic-agent-user is used
- Clarify that if only --group is specified, agent runs under default user
- Update example text in both install and unprivileged command tabs

Co-authored-by: vishaangelova <[email protected]>
Copy link
Contributor Author

Copilot AI commented Nov 25, 2025

@copilot the changes should be made to the elastic-agent unprivileged command as well. Also, on Linux/macOS, --user is optional when you install or switch to unprivileged mode.
If you omit `--use...

Updated in f35413c. The documentation now clarifies that on Linux/macOS, --user and --group are optional—if --user is omitted, the default elastic-agent-user is used, and if only --group is specified, the agent runs under its default user with the requested group. Both the elastic-agent install and elastic-agent unprivileged command examples have been updated with this context.

Copilot finished work on behalf of vishaangelova November 25, 2025 09:37
@vishaangelova
Copy link
Contributor

@copilot Update the two other examples in the doc (sudo elastic-agent unprivileged and sudo elastic-agent privileged) with tabs that show the command example separately for Windows and Linux/macOS. Use a a group and sync option for all tabs to synchronize the tabs across the page. Remove the .exe extension from the Windows example. Remove the "(the agent runs under its default user with the specified group)” and "(optional—if omitted, the default elastic-agent-user is used)” parts from your changes. Include an example for installing Agent with a specific user and group for Windows as well.

- 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 <[email protected]>
Copy link
Contributor Author

Copilot AI commented Nov 25, 2025

@copilot Update the two other examples in the doc (sudo elastic-agent unprivileged and sudo elastic-agent privileged) with tabs that show the command example separately for Windows and Linux/macOS...

Updated in 9cdf6d9:

  • Added tabs with :group: os and :sync: linux/:sync: windows to synchronize tabs across the page
  • Added tabs for elastic-agent unprivileged and elastic-agent privileged commands
  • Removed .exe extension from Windows examples
  • Removed the extra clarifying text from example descriptions
  • Added Windows example for installing with both user and group

Copilot finished work on behalf of vishaangelova November 25, 2025 10:24
@vishaangelova
Copy link
Contributor

@copilot update the code example in line 31-36 and use tabs to show an example command for the different operating systems. Synchronize the tabs with the rest.

- Add synchronized tabs for Linux/macOS and Windows install commands
- Add sudo prefix to Linux/macOS example (required for service installation)
- Use PowerShell backtick line continuation for Windows example

Co-authored-by: vishaangelova <[email protected]>
Copy link
Contributor Author

Copilot AI commented Nov 25, 2025

@copilot update the code example in line 31-36 and use tabs to show an example command for the different operating systems. Synchronize the tabs with the rest.

Updated in 534d8e7. Added tabs with :group: os and :sync: linux/:sync: windows to the initial install example, synchronizing it with the rest of the page.

Copilot finished work on behalf of vishaangelova November 25, 2025 10:43
Copilot AI requested a review from vishaangelova November 25, 2025 10:52
Copilot finished work on behalf of vishaangelova November 25, 2025 10:52
@vishaangelova
Copy link
Contributor

@copilot Continue but with the following changes:

  • In the note, fix the formatting to: On Windows, the --password parameter is required when specifying a custom user account.

Copy link
Contributor Author

Copilot AI commented Nov 25, 2025

@copilot Continue but with the following changes:

  • In the note, fix the formatting to: On Windows, the --password parameter is required when specifying a custom user account.

Fixed the note formatting in cfee58d. The text now reads: "On Windows, the --password parameter is required when specifying a custom user account."

Copilot finished work on behalf of vishaangelova November 25, 2025 11:25
@vishaangelova vishaangelova marked this pull request as ready for review November 25, 2025 11:29
@vishaangelova vishaangelova requested a review from a team as a code owner November 25, 2025 11:29
@github-actions
Copy link

github-actions bot commented Nov 25, 2025

🔍 Preview links for changed docs

@vishaangelova vishaangelova changed the title Fix documentation for unprivileged mode with pre-existing user and group Fix code examples in doc for running Elastic Agent unprivileged Nov 25, 2025
@vishaangelova
Copy link
Contributor

@blakerouse, as Eric’s on PTO this week, and I’m not sure whom to ask for a review -- could you take a look at this PR, or maybe direct me to someone else from your team?


* On Linux systems, after {{agent}} has been installed with the `--unprivileged` flag, all {{agent}} commands can be run without being the root user.

* The `sudo` option is still required for the `elastic-agent install` command. Only `root` can install new services. The installed service will not run as the root user.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this is indented? Seems random to me 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this was in the original text, and I hadn’t noticed it. It’s currently an unonrdered list in the unordered list, but I think it should just be a separate paragraph as part of the unordered list item.

@copilot on line 67 and 73, remove the * to format those paragraphs as new paragraphs under their respective unordered list item.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the * from lines 67 and 73, formatting them as paragraphs under their respective list items in f9da888.

@github-actions
Copy link

github-actions bot commented Nov 28, 2025

Vale Linting Results

Summary: 1 suggestion found

💡 Suggestions (1)
File Line Rule Message
reference/fleet/elastic-agent-unprivileged.md 67 Elastic.FutureTense 'will not' might be in future tense. Write in the present tense to describe the state of the product as it is now.

- Changed lines 67 and 73 from nested bullet points (*) to regular
  paragraphs indented under their respective list items

Co-authored-by: vishaangelova <[email protected]>
Copy link

@michel-laterman michel-laterman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@vishaangelova vishaangelova requested review from a team and alexandra5000 November 28, 2025 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Website]: Doc bug for "Using unprivileged mode with a pre-existing user and group"

4 participants