Does anyone have component created to replace ec2-user in EC2ImageBuilder

0

I'm trying to replace the default user coming from AMI's(ec2-user/ubuntu) to org specific user.

Sripada
已提问 7 个月前32 查看次数
1 回答
0

Hello. You need to create a custom component that runs during the build phase of your image pipeline. Like so:

name: CreateOrgUser
description: "Create a new organization-specific user"
schemaVersion: 1.0

phases:
  - name: build
    steps:
      - name: CreateUser
        action: ExecuteBash
        inputs:
          commands:
            - "sudo adduser --disabled-password --gecos '' orguser"
            - "sudo usermod -aG sudo orguser"
            - "echo 'orguser ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/orguser"

profile picture
专家
已回答 22 天前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容