How to change the default user name from ubuntu to something else on EC2 AMI












0















How can I create a new Ubuntu AMI so that when a new instance is created the SSH credentials are copied under a different user than ubuntu (e.g. /home/administrator/.ssh/)?



In short, I need to be able to use username administrator instead of ubuntu.










share|improve this question
















bumped to the homepage by Community 10 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    0















    How can I create a new Ubuntu AMI so that when a new instance is created the SSH credentials are copied under a different user than ubuntu (e.g. /home/administrator/.ssh/)?



    In short, I need to be able to use username administrator instead of ubuntu.










    share|improve this question
















    bumped to the homepage by Community 10 hours ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0


      2






      How can I create a new Ubuntu AMI so that when a new instance is created the SSH credentials are copied under a different user than ubuntu (e.g. /home/administrator/.ssh/)?



      In short, I need to be able to use username administrator instead of ubuntu.










      share|improve this question
















      How can I create a new Ubuntu AMI so that when a new instance is created the SSH credentials are copied under a different user than ubuntu (e.g. /home/administrator/.ssh/)?



      In short, I need to be able to use username administrator instead of ubuntu.







      ssh amazon-ec2 user-management






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 22 '14 at 14:19









      Braiam

      52.1k20136222




      52.1k20136222










      asked Feb 27 '13 at 7:00









      ubunutec2ubunutec2

      111




      111





      bumped to the homepage by Community 10 hours ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 10 hours ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          3 Answers
          3






          active

          oldest

          votes


















          0














          I Believe this will work for you:



          usermod -l new_name old_name





          share|improve this answer
























          • I need to have a new instance launched with this new user instead of ubuntu.

            – ubunutec2
            Feb 27 '13 at 7:26











          • type su new_name and enter the chosen password

            – fromnaboo
            Feb 27 '13 at 8:25





















          0














          Launch an instance with the 'ubuntu' username, change the user name as indicated by Nathan Cazell then create a new AMI from that instance and launch that.






          share|improve this answer



















          • 2





            I figured it out - you would have to set the user attribute to the username you want in the /etc/cloud/cloud.cfg file.

            – ubunutec2
            Feb 27 '13 at 8:19



















          0














          You can use the EC2 user data to do so. Simply launch an AWS instance and place the following in the user data field:



          #cloud-config
          system_info:
          default_user:
          name: my_user_name


          I wrote a detailed article on this process and it is available at https://emagalha.es/blog/2018/01/21/customizing-the-default-user-of-an-ubuntu-ami/






          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%2f261824%2fhow-to-change-the-default-user-name-from-ubuntu-to-something-else-on-ec2-ami%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I Believe this will work for you:



            usermod -l new_name old_name





            share|improve this answer
























            • I need to have a new instance launched with this new user instead of ubuntu.

              – ubunutec2
              Feb 27 '13 at 7:26











            • type su new_name and enter the chosen password

              – fromnaboo
              Feb 27 '13 at 8:25


















            0














            I Believe this will work for you:



            usermod -l new_name old_name





            share|improve this answer
























            • I need to have a new instance launched with this new user instead of ubuntu.

              – ubunutec2
              Feb 27 '13 at 7:26











            • type su new_name and enter the chosen password

              – fromnaboo
              Feb 27 '13 at 8:25
















            0












            0








            0







            I Believe this will work for you:



            usermod -l new_name old_name





            share|improve this answer













            I Believe this will work for you:



            usermod -l new_name old_name






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Feb 27 '13 at 7:22









            NtcNtc

            4312610




            4312610













            • I need to have a new instance launched with this new user instead of ubuntu.

              – ubunutec2
              Feb 27 '13 at 7:26











            • type su new_name and enter the chosen password

              – fromnaboo
              Feb 27 '13 at 8:25





















            • I need to have a new instance launched with this new user instead of ubuntu.

              – ubunutec2
              Feb 27 '13 at 7:26











            • type su new_name and enter the chosen password

              – fromnaboo
              Feb 27 '13 at 8:25



















            I need to have a new instance launched with this new user instead of ubuntu.

            – ubunutec2
            Feb 27 '13 at 7:26





            I need to have a new instance launched with this new user instead of ubuntu.

            – ubunutec2
            Feb 27 '13 at 7:26













            type su new_name and enter the chosen password

            – fromnaboo
            Feb 27 '13 at 8:25







            type su new_name and enter the chosen password

            – fromnaboo
            Feb 27 '13 at 8:25















            0














            Launch an instance with the 'ubuntu' username, change the user name as indicated by Nathan Cazell then create a new AMI from that instance and launch that.






            share|improve this answer



















            • 2





              I figured it out - you would have to set the user attribute to the username you want in the /etc/cloud/cloud.cfg file.

              – ubunutec2
              Feb 27 '13 at 8:19
















            0














            Launch an instance with the 'ubuntu' username, change the user name as indicated by Nathan Cazell then create a new AMI from that instance and launch that.






            share|improve this answer



















            • 2





              I figured it out - you would have to set the user attribute to the username you want in the /etc/cloud/cloud.cfg file.

              – ubunutec2
              Feb 27 '13 at 8:19














            0












            0








            0







            Launch an instance with the 'ubuntu' username, change the user name as indicated by Nathan Cazell then create a new AMI from that instance and launch that.






            share|improve this answer













            Launch an instance with the 'ubuntu' username, change the user name as indicated by Nathan Cazell then create a new AMI from that instance and launch that.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Feb 27 '13 at 8:03









            Clive van HiltenClive van Hilten

            1,268812




            1,268812








            • 2





              I figured it out - you would have to set the user attribute to the username you want in the /etc/cloud/cloud.cfg file.

              – ubunutec2
              Feb 27 '13 at 8:19














            • 2





              I figured it out - you would have to set the user attribute to the username you want in the /etc/cloud/cloud.cfg file.

              – ubunutec2
              Feb 27 '13 at 8:19








            2




            2





            I figured it out - you would have to set the user attribute to the username you want in the /etc/cloud/cloud.cfg file.

            – ubunutec2
            Feb 27 '13 at 8:19





            I figured it out - you would have to set the user attribute to the username you want in the /etc/cloud/cloud.cfg file.

            – ubunutec2
            Feb 27 '13 at 8:19











            0














            You can use the EC2 user data to do so. Simply launch an AWS instance and place the following in the user data field:



            #cloud-config
            system_info:
            default_user:
            name: my_user_name


            I wrote a detailed article on this process and it is available at https://emagalha.es/blog/2018/01/21/customizing-the-default-user-of-an-ubuntu-ami/






            share|improve this answer




























              0














              You can use the EC2 user data to do so. Simply launch an AWS instance and place the following in the user data field:



              #cloud-config
              system_info:
              default_user:
              name: my_user_name


              I wrote a detailed article on this process and it is available at https://emagalha.es/blog/2018/01/21/customizing-the-default-user-of-an-ubuntu-ami/






              share|improve this answer


























                0












                0








                0







                You can use the EC2 user data to do so. Simply launch an AWS instance and place the following in the user data field:



                #cloud-config
                system_info:
                default_user:
                name: my_user_name


                I wrote a detailed article on this process and it is available at https://emagalha.es/blog/2018/01/21/customizing-the-default-user-of-an-ubuntu-ami/






                share|improve this answer













                You can use the EC2 user data to do so. Simply launch an AWS instance and place the following in the user data field:



                #cloud-config
                system_info:
                default_user:
                name: my_user_name


                I wrote a detailed article on this process and it is available at https://emagalha.es/blog/2018/01/21/customizing-the-default-user-of-an-ubuntu-ami/







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 13 '18 at 18:30









                Eric MagalhãesEric Magalhães

                1




                1






























                    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%2f261824%2fhow-to-change-the-default-user-name-from-ubuntu-to-something-else-on-ec2-ami%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

                    數位音樂下載

                    When can things happen in Etherscan, such as the picture below?

                    格利澤436b