How to set a password for Ubuntu Cloud Images (ie. NOT use ssh)












2















I'm running an OpenStack cloud with a very particular network configuration, that makes it impossible for an instance to communicate with anything in the outside world until after I login into it and set several config files.



As a result of this, I cannot log in to instances using SSH keys. Is there a way to set a default password on an Ubuntu 12.04 (has to be 12.04) cloud image so I can log in to it directly from the Horizon console? I tried using the procedure outlined at https://ask.openstack.org/en/question/5531/defining-default-user-password-for-ubuntu-cloud-image/ but it did not work on Ubuntu 12.04... it did work on 14.04 though.










share|improve this question





























    2















    I'm running an OpenStack cloud with a very particular network configuration, that makes it impossible for an instance to communicate with anything in the outside world until after I login into it and set several config files.



    As a result of this, I cannot log in to instances using SSH keys. Is there a way to set a default password on an Ubuntu 12.04 (has to be 12.04) cloud image so I can log in to it directly from the Horizon console? I tried using the procedure outlined at https://ask.openstack.org/en/question/5531/defining-default-user-password-for-ubuntu-cloud-image/ but it did not work on Ubuntu 12.04... it did work on 14.04 though.










    share|improve this question



























      2












      2








      2








      I'm running an OpenStack cloud with a very particular network configuration, that makes it impossible for an instance to communicate with anything in the outside world until after I login into it and set several config files.



      As a result of this, I cannot log in to instances using SSH keys. Is there a way to set a default password on an Ubuntu 12.04 (has to be 12.04) cloud image so I can log in to it directly from the Horizon console? I tried using the procedure outlined at https://ask.openstack.org/en/question/5531/defining-default-user-password-for-ubuntu-cloud-image/ but it did not work on Ubuntu 12.04... it did work on 14.04 though.










      share|improve this question
















      I'm running an OpenStack cloud with a very particular network configuration, that makes it impossible for an instance to communicate with anything in the outside world until after I login into it and set several config files.



      As a result of this, I cannot log in to instances using SSH keys. Is there a way to set a default password on an Ubuntu 12.04 (has to be 12.04) cloud image so I can log in to it directly from the Horizon console? I tried using the procedure outlined at https://ask.openstack.org/en/question/5531/defining-default-user-password-for-ubuntu-cloud-image/ but it did not work on Ubuntu 12.04... it did work on 14.04 though.







      password cloud






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 6 '18 at 5:32









      meshy

      1277




      1277










      asked Aug 5 '14 at 20:29









      user1072692user1072692

      13315




      13315






















          2 Answers
          2






          active

          oldest

          votes


















          1














          You can first create a Virtual Machine (VM) image from virtualbox or vmware which already has a key pair. as you can control your virtualbox or vmware freely, you can get the key pair from the virtual host.




          1. then import the keypair into your openstack.


          2. upload this virtual machine image


          3. create a instance(A) from this image


          4. create a instance(B) from the cloud image with the keypair(uploaded from step 1) injected


          5. open the console(in horizon) of instance A, now you can connect the instance B from A, because B has injected the public key from A


          6. after logged in, you can set up the environment for instance B & change the configuration







          share|improve this answer

































            0














            18.04 setup step-by-step



            In short you need:



            sudo apt-get install cloud-image-utils

            cat >user-data <<EOF
            #cloud-config
            password: asdfqwer
            chpasswd: { expire: False }
            ssh_pwauth: True
            EOF

            cloud-localds user-data.img user-data

            # user-data.img MUST come after the rootfs.
            qemu-system-x86_64
            -drive file=ubuntu-18.04-server-cloudimg-amd64.img,format=qcow2
            -drive file=user-data.img,format=raw
            ...


            and now you can login with:




            • username: ubuntu

            • password: asdfqwer


            The user-data.img drive must be the second one after the first input image.



            Here I describe a full minimal detailed working QEMU example: Is there any prebuilt QEMU Ubuntu image(32bit) online?






            share|improve this answer

























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "89"
              };
              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',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f507345%2fhow-to-set-a-password-for-ubuntu-cloud-images-ie-not-use-ssh%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              You can first create a Virtual Machine (VM) image from virtualbox or vmware which already has a key pair. as you can control your virtualbox or vmware freely, you can get the key pair from the virtual host.




              1. then import the keypair into your openstack.


              2. upload this virtual machine image


              3. create a instance(A) from this image


              4. create a instance(B) from the cloud image with the keypair(uploaded from step 1) injected


              5. open the console(in horizon) of instance A, now you can connect the instance B from A, because B has injected the public key from A


              6. after logged in, you can set up the environment for instance B & change the configuration







              share|improve this answer






























                1














                You can first create a Virtual Machine (VM) image from virtualbox or vmware which already has a key pair. as you can control your virtualbox or vmware freely, you can get the key pair from the virtual host.




                1. then import the keypair into your openstack.


                2. upload this virtual machine image


                3. create a instance(A) from this image


                4. create a instance(B) from the cloud image with the keypair(uploaded from step 1) injected


                5. open the console(in horizon) of instance A, now you can connect the instance B from A, because B has injected the public key from A


                6. after logged in, you can set up the environment for instance B & change the configuration







                share|improve this answer




























                  1












                  1








                  1







                  You can first create a Virtual Machine (VM) image from virtualbox or vmware which already has a key pair. as you can control your virtualbox or vmware freely, you can get the key pair from the virtual host.




                  1. then import the keypair into your openstack.


                  2. upload this virtual machine image


                  3. create a instance(A) from this image


                  4. create a instance(B) from the cloud image with the keypair(uploaded from step 1) injected


                  5. open the console(in horizon) of instance A, now you can connect the instance B from A, because B has injected the public key from A


                  6. after logged in, you can set up the environment for instance B & change the configuration







                  share|improve this answer















                  You can first create a Virtual Machine (VM) image from virtualbox or vmware which already has a key pair. as you can control your virtualbox or vmware freely, you can get the key pair from the virtual host.




                  1. then import the keypair into your openstack.


                  2. upload this virtual machine image


                  3. create a instance(A) from this image


                  4. create a instance(B) from the cloud image with the keypair(uploaded from step 1) injected


                  5. open the console(in horizon) of instance A, now you can connect the instance B from A, because B has injected the public key from A


                  6. after logged in, you can set up the environment for instance B & change the configuration








                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Aug 12 '14 at 6:22









                  Akiva

                  4,692134397




                  4,692134397










                  answered Aug 12 '14 at 6:13









                  hgfeaonhgfeaon

                  111




                  111

























                      0














                      18.04 setup step-by-step



                      In short you need:



                      sudo apt-get install cloud-image-utils

                      cat >user-data <<EOF
                      #cloud-config
                      password: asdfqwer
                      chpasswd: { expire: False }
                      ssh_pwauth: True
                      EOF

                      cloud-localds user-data.img user-data

                      # user-data.img MUST come after the rootfs.
                      qemu-system-x86_64
                      -drive file=ubuntu-18.04-server-cloudimg-amd64.img,format=qcow2
                      -drive file=user-data.img,format=raw
                      ...


                      and now you can login with:




                      • username: ubuntu

                      • password: asdfqwer


                      The user-data.img drive must be the second one after the first input image.



                      Here I describe a full minimal detailed working QEMU example: Is there any prebuilt QEMU Ubuntu image(32bit) online?






                      share|improve this answer






























                        0














                        18.04 setup step-by-step



                        In short you need:



                        sudo apt-get install cloud-image-utils

                        cat >user-data <<EOF
                        #cloud-config
                        password: asdfqwer
                        chpasswd: { expire: False }
                        ssh_pwauth: True
                        EOF

                        cloud-localds user-data.img user-data

                        # user-data.img MUST come after the rootfs.
                        qemu-system-x86_64
                        -drive file=ubuntu-18.04-server-cloudimg-amd64.img,format=qcow2
                        -drive file=user-data.img,format=raw
                        ...


                        and now you can login with:




                        • username: ubuntu

                        • password: asdfqwer


                        The user-data.img drive must be the second one after the first input image.



                        Here I describe a full minimal detailed working QEMU example: Is there any prebuilt QEMU Ubuntu image(32bit) online?






                        share|improve this answer




























                          0












                          0








                          0







                          18.04 setup step-by-step



                          In short you need:



                          sudo apt-get install cloud-image-utils

                          cat >user-data <<EOF
                          #cloud-config
                          password: asdfqwer
                          chpasswd: { expire: False }
                          ssh_pwauth: True
                          EOF

                          cloud-localds user-data.img user-data

                          # user-data.img MUST come after the rootfs.
                          qemu-system-x86_64
                          -drive file=ubuntu-18.04-server-cloudimg-amd64.img,format=qcow2
                          -drive file=user-data.img,format=raw
                          ...


                          and now you can login with:




                          • username: ubuntu

                          • password: asdfqwer


                          The user-data.img drive must be the second one after the first input image.



                          Here I describe a full minimal detailed working QEMU example: Is there any prebuilt QEMU Ubuntu image(32bit) online?






                          share|improve this answer















                          18.04 setup step-by-step



                          In short you need:



                          sudo apt-get install cloud-image-utils

                          cat >user-data <<EOF
                          #cloud-config
                          password: asdfqwer
                          chpasswd: { expire: False }
                          ssh_pwauth: True
                          EOF

                          cloud-localds user-data.img user-data

                          # user-data.img MUST come after the rootfs.
                          qemu-system-x86_64
                          -drive file=ubuntu-18.04-server-cloudimg-amd64.img,format=qcow2
                          -drive file=user-data.img,format=raw
                          ...


                          and now you can login with:




                          • username: ubuntu

                          • password: asdfqwer


                          The user-data.img drive must be the second one after the first input image.



                          Here I describe a full minimal detailed working QEMU example: Is there any prebuilt QEMU Ubuntu image(32bit) online?







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited 9 hours ago

























                          answered Nov 19 '18 at 11:13









                          Ciro Santilli 新疆改造中心 六四事件 法轮功Ciro Santilli 新疆改造中心 六四事件 法轮功

                          9,36444347




                          9,36444347






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Ask Ubuntu!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f507345%2fhow-to-set-a-password-for-ubuntu-cloud-images-ie-not-use-ssh%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              GameSpot

                              日野市

                              Tu-95轟炸機