When using cloud-init, what order are the users created in?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I am using cloud-init to initialize a RHEL Atomic Host VM.



I have the following as my user-data file:



#cloud-config
groups:
- ourgroup
users:
- name: muser
primary_group: ourgroup
lock_passwd: false
sudo: ALL=(ALL) NOPASSWD:ALL
ssh_authorized_keys:
- ssh-rsa [REDACTED]
- name: auser
primary_group: ourgroup
passwd: [REDACTED]
lock_passwd: false
sudo: ALL=(ALL) NOPASSWD:ALL
ssh_pwauth: True


When the VM boots up for the first time using an ISO file generated from that user-data file, the users are created. From what I see in /etc/passwd, the auser user is created with UID 1000, and the muser user is created with UID 1001.



We are deploying some software on this VM that needs to know the UID of muser in advance prior to installation. Whenever a VM is deployed using that ISO file, will muser always be created after auser (and therefore muser will always have UID 1001)?



I thought maybe the users were created in either alphabetical order or in the reverse order in which they are listed in the user-data file, so I created another user-data file with 4 users to test that theory. But that theory failed, and I could not tell in what order cloud-init creates the users.



If no one knows what order the users are created in, can I at least assume that muser will always have a UID of 1001?









share

























    up vote
    0
    down vote

    favorite












    I am using cloud-init to initialize a RHEL Atomic Host VM.



    I have the following as my user-data file:



    #cloud-config
    groups:
    - ourgroup
    users:
    - name: muser
    primary_group: ourgroup
    lock_passwd: false
    sudo: ALL=(ALL) NOPASSWD:ALL
    ssh_authorized_keys:
    - ssh-rsa [REDACTED]
    - name: auser
    primary_group: ourgroup
    passwd: [REDACTED]
    lock_passwd: false
    sudo: ALL=(ALL) NOPASSWD:ALL
    ssh_pwauth: True


    When the VM boots up for the first time using an ISO file generated from that user-data file, the users are created. From what I see in /etc/passwd, the auser user is created with UID 1000, and the muser user is created with UID 1001.



    We are deploying some software on this VM that needs to know the UID of muser in advance prior to installation. Whenever a VM is deployed using that ISO file, will muser always be created after auser (and therefore muser will always have UID 1001)?



    I thought maybe the users were created in either alphabetical order or in the reverse order in which they are listed in the user-data file, so I created another user-data file with 4 users to test that theory. But that theory failed, and I could not tell in what order cloud-init creates the users.



    If no one knows what order the users are created in, can I at least assume that muser will always have a UID of 1001?









    share























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am using cloud-init to initialize a RHEL Atomic Host VM.



      I have the following as my user-data file:



      #cloud-config
      groups:
      - ourgroup
      users:
      - name: muser
      primary_group: ourgroup
      lock_passwd: false
      sudo: ALL=(ALL) NOPASSWD:ALL
      ssh_authorized_keys:
      - ssh-rsa [REDACTED]
      - name: auser
      primary_group: ourgroup
      passwd: [REDACTED]
      lock_passwd: false
      sudo: ALL=(ALL) NOPASSWD:ALL
      ssh_pwauth: True


      When the VM boots up for the first time using an ISO file generated from that user-data file, the users are created. From what I see in /etc/passwd, the auser user is created with UID 1000, and the muser user is created with UID 1001.



      We are deploying some software on this VM that needs to know the UID of muser in advance prior to installation. Whenever a VM is deployed using that ISO file, will muser always be created after auser (and therefore muser will always have UID 1001)?



      I thought maybe the users were created in either alphabetical order or in the reverse order in which they are listed in the user-data file, so I created another user-data file with 4 users to test that theory. But that theory failed, and I could not tell in what order cloud-init creates the users.



      If no one knows what order the users are created in, can I at least assume that muser will always have a UID of 1001?









      share













      I am using cloud-init to initialize a RHEL Atomic Host VM.



      I have the following as my user-data file:



      #cloud-config
      groups:
      - ourgroup
      users:
      - name: muser
      primary_group: ourgroup
      lock_passwd: false
      sudo: ALL=(ALL) NOPASSWD:ALL
      ssh_authorized_keys:
      - ssh-rsa [REDACTED]
      - name: auser
      primary_group: ourgroup
      passwd: [REDACTED]
      lock_passwd: false
      sudo: ALL=(ALL) NOPASSWD:ALL
      ssh_pwauth: True


      When the VM boots up for the first time using an ISO file generated from that user-data file, the users are created. From what I see in /etc/passwd, the auser user is created with UID 1000, and the muser user is created with UID 1001.



      We are deploying some software on this VM that needs to know the UID of muser in advance prior to installation. Whenever a VM is deployed using that ISO file, will muser always be created after auser (and therefore muser will always have UID 1001)?



      I thought maybe the users were created in either alphabetical order or in the reverse order in which they are listed in the user-data file, so I created another user-data file with 4 users to test that theory. But that theory failed, and I could not tell in what order cloud-init creates the users.



      If no one knows what order the users are created in, can I at least assume that muser will always have a UID of 1001?







      rhel users virtual-machine cloud-init





      share












      share










      share



      share










      asked 5 mins ago









      pacoverflow

      1013




      1013

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f478553%2fwhen-using-cloud-init-what-order-are-the-users-created-in%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f478553%2fwhen-using-cloud-init-what-order-are-the-users-created-in%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay