amazon-ssm-agent icon indicating copy to clipboard operation
amazon-ssm-agent copied to clipboard

ssmuser gid and uid

Open fragglerocker opened this issue 8 years ago • 6 comments

There should be a configuration option to set uid/gid of ssmuser, as well as simply not create it.

There is potential for conflict with systems that use ldap/AD auth (or simply have users/groups created later via configuration management tools) and join at a later stage of build.

fragglerocker avatar Sep 27 '18 09:09 fragglerocker

This just broke my baking process. Easy enough to work around, but bothersome.

mikelindsey-okta avatar Nov 22 '18 00:11 mikelindsey-okta

Thank you for the feedback! We will look into this.

munindradas avatar Dec 12 '18 22:12 munindradas

Still not quite worked around. "easy" was.. hahaha.

mikelindsey-okta avatar Dec 19 '18 00:12 mikelindsey-okta

here's an ansible snippet that changes uid/gid if the ssm-user exists, it "works" for my use case running on a schedule in session-manager as part of a larger playbook `

  • name: "set ssm agent ssm-user uid and gid" block:
    • name: check user ssm-user exists getent: database: passwd key: ssm-user ignore_errors: true register: ssmuserentry

    • name: change uid user: name: ssm-user uid: when: ssmuserentry is succeeded

    • name: group group: name: ssm-user gid: when: ssmuserentry is succeeded `

fragglerocker avatar Dec 19 '18 09:12 fragglerocker

Just a little bit more on this, to resolve this you need to pre-create the user and group entries on the host prior to installing the SSM Agent package.

On my test environment, I found that the /etc/sudoers.d/ssm-agent-users file wasn't being populated with the required entries, so you may need to populate that yourself and test accordingly.

ssm-user ALL=(ALL) NOPASSWD:ALL

keirans avatar Jan 29 '19 23:01 keirans

Thank you for the feedback! Session Manager recently released a feature to support operating system user account, please refer to the public documentation for more details. https://aws.amazon.com/about-aws/whats-new/2019/07/session-manager-launches-run-as-to-start-interactive-sessions-with-your-own-operating-system-user-account/

YujiaozhAws avatar Jul 10 '19 23:07 YujiaozhAws