cant add user to sudo group in centOS 7 i386(no GUI,Its minimal)












2















I had install centOS 7 minimal version in my virtualbox in Ubuntu mate. It has no GUI. It is totally CLI. My user name is Smit and able to login in to it. But when i type command



sudo yum update


and enter my password, it says



Smit is not in sudoers files. This incident will be reported.


But when I try to add my user to sudo group by command



adduser Smit sudo


gives something like this:



enter image description here



(I am unable to copy-paste via virtual-box. I do this by login in root.)










share|improve this question

























  • i had used the command in both manner.without <> and with <>

    – noone
    Jun 10 '17 at 18:12
















2















I had install centOS 7 minimal version in my virtualbox in Ubuntu mate. It has no GUI. It is totally CLI. My user name is Smit and able to login in to it. But when i type command



sudo yum update


and enter my password, it says



Smit is not in sudoers files. This incident will be reported.


But when I try to add my user to sudo group by command



adduser Smit sudo


gives something like this:



enter image description here



(I am unable to copy-paste via virtual-box. I do this by login in root.)










share|improve this question

























  • i had used the command in both manner.without <> and with <>

    – noone
    Jun 10 '17 at 18:12














2












2








2








I had install centOS 7 minimal version in my virtualbox in Ubuntu mate. It has no GUI. It is totally CLI. My user name is Smit and able to login in to it. But when i type command



sudo yum update


and enter my password, it says



Smit is not in sudoers files. This incident will be reported.


But when I try to add my user to sudo group by command



adduser Smit sudo


gives something like this:



enter image description here



(I am unable to copy-paste via virtual-box. I do this by login in root.)










share|improve this question
















I had install centOS 7 minimal version in my virtualbox in Ubuntu mate. It has no GUI. It is totally CLI. My user name is Smit and able to login in to it. But when i type command



sudo yum update


and enter my password, it says



Smit is not in sudoers files. This incident will be reported.


But when I try to add my user to sudo group by command



adduser Smit sudo


gives something like this:



enter image description here



(I am unable to copy-paste via virtual-box. I do this by login in root.)







centos command-line sudo users privileges






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 10 '17 at 19:17









Tomasz

9,38852965




9,38852965










asked Jun 10 '17 at 17:57









noonenoone

14918




14918













  • i had used the command in both manner.without <> and with <>

    – noone
    Jun 10 '17 at 18:12



















  • i had used the command in both manner.without <> and with <>

    – noone
    Jun 10 '17 at 18:12

















i had used the command in both manner.without <> and with <>

– noone
Jun 10 '17 at 18:12





i had used the command in both manner.without <> and with <>

– noone
Jun 10 '17 at 18:12










3 Answers
3






active

oldest

votes


















6














I don't know why your command doesn't work. It may have to do with either:




  • your CentOS not using sudo by default

  • the way the sudoers file should be edited

  • the syntax of adduser command on that particular machine.


Apparently, and it is my guess, it's first of all a matter of the last point.



Anyhow, the easiest way is to add the user to the wheel group, which should have sudo priviliges on your CentOS. Try out this command:



usermod -aG wheel Smit


This of course has to be done by root. Once successfully executed, change identity to Smit and check if you can sudo.



su - Smit
sudo yum update


As an alternative, you can use visudo. Adding this line should do:



Smit ALL=(ALL) ALL


But here's a guide with a few more details if you're interested.






share|improve this answer































    2














    You just need to add user Smit to group wheel which is have permission to run all commands with sudo command And you can accomplish it by entering the following command




    vim /etc/group




    look for wheel group and add smit to it



    enter image description here



    save and exit and thats it.






    share|improve this answer































      0














      I've run into the exact same situation with OP. Tried the same command and got the same result.



      Then I used



      usermod -aG sudo Smit


      and got the result



      The group "sudo" does not exist.


      I think that is the reason adduser Smit sudo dose not work -- The group "sudo" does not exist yet!



      The following command to add the user to the "wheel" group does work.



      usermod -aG wheel Smit


      But at this point, switching to user Smit and trying sudo still failed! I have to do one more thing. Use visudo to open and edit the /etc/sudoers file. Make sure that the line that starts with %wheel is not commented. It should look exactly like this:



      ## Allows people in group wheel to run all commands
      %wheel ALL=(ALL) ALL


      That is the final step to set up set up the account and now everything is OK.






      share|improve this answer








      New contributor




      Betty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















        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',
        autoActivateHeartbeat: false,
        convertImagesToLinks: false,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        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%2funix.stackexchange.com%2fquestions%2f370400%2fcant-add-user-to-sudo-group-in-centos-7-i386no-gui-its-minimal%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









        6














        I don't know why your command doesn't work. It may have to do with either:




        • your CentOS not using sudo by default

        • the way the sudoers file should be edited

        • the syntax of adduser command on that particular machine.


        Apparently, and it is my guess, it's first of all a matter of the last point.



        Anyhow, the easiest way is to add the user to the wheel group, which should have sudo priviliges on your CentOS. Try out this command:



        usermod -aG wheel Smit


        This of course has to be done by root. Once successfully executed, change identity to Smit and check if you can sudo.



        su - Smit
        sudo yum update


        As an alternative, you can use visudo. Adding this line should do:



        Smit ALL=(ALL) ALL


        But here's a guide with a few more details if you're interested.






        share|improve this answer




























          6














          I don't know why your command doesn't work. It may have to do with either:




          • your CentOS not using sudo by default

          • the way the sudoers file should be edited

          • the syntax of adduser command on that particular machine.


          Apparently, and it is my guess, it's first of all a matter of the last point.



          Anyhow, the easiest way is to add the user to the wheel group, which should have sudo priviliges on your CentOS. Try out this command:



          usermod -aG wheel Smit


          This of course has to be done by root. Once successfully executed, change identity to Smit and check if you can sudo.



          su - Smit
          sudo yum update


          As an alternative, you can use visudo. Adding this line should do:



          Smit ALL=(ALL) ALL


          But here's a guide with a few more details if you're interested.






          share|improve this answer


























            6












            6








            6







            I don't know why your command doesn't work. It may have to do with either:




            • your CentOS not using sudo by default

            • the way the sudoers file should be edited

            • the syntax of adduser command on that particular machine.


            Apparently, and it is my guess, it's first of all a matter of the last point.



            Anyhow, the easiest way is to add the user to the wheel group, which should have sudo priviliges on your CentOS. Try out this command:



            usermod -aG wheel Smit


            This of course has to be done by root. Once successfully executed, change identity to Smit and check if you can sudo.



            su - Smit
            sudo yum update


            As an alternative, you can use visudo. Adding this line should do:



            Smit ALL=(ALL) ALL


            But here's a guide with a few more details if you're interested.






            share|improve this answer













            I don't know why your command doesn't work. It may have to do with either:




            • your CentOS not using sudo by default

            • the way the sudoers file should be edited

            • the syntax of adduser command on that particular machine.


            Apparently, and it is my guess, it's first of all a matter of the last point.



            Anyhow, the easiest way is to add the user to the wheel group, which should have sudo priviliges on your CentOS. Try out this command:



            usermod -aG wheel Smit


            This of course has to be done by root. Once successfully executed, change identity to Smit and check if you can sudo.



            su - Smit
            sudo yum update


            As an alternative, you can use visudo. Adding this line should do:



            Smit ALL=(ALL) ALL


            But here's a guide with a few more details if you're interested.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jun 10 '17 at 19:12









            TomaszTomasz

            9,38852965




            9,38852965

























                2














                You just need to add user Smit to group wheel which is have permission to run all commands with sudo command And you can accomplish it by entering the following command




                vim /etc/group




                look for wheel group and add smit to it



                enter image description here



                save and exit and thats it.






                share|improve this answer




























                  2














                  You just need to add user Smit to group wheel which is have permission to run all commands with sudo command And you can accomplish it by entering the following command




                  vim /etc/group




                  look for wheel group and add smit to it



                  enter image description here



                  save and exit and thats it.






                  share|improve this answer


























                    2












                    2








                    2







                    You just need to add user Smit to group wheel which is have permission to run all commands with sudo command And you can accomplish it by entering the following command




                    vim /etc/group




                    look for wheel group and add smit to it



                    enter image description here



                    save and exit and thats it.






                    share|improve this answer













                    You just need to add user Smit to group wheel which is have permission to run all commands with sudo command And you can accomplish it by entering the following command




                    vim /etc/group




                    look for wheel group and add smit to it



                    enter image description here



                    save and exit and thats it.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jun 10 '17 at 23:23









                    Blacky BirdBlacky Bird

                    1012




                    1012























                        0














                        I've run into the exact same situation with OP. Tried the same command and got the same result.



                        Then I used



                        usermod -aG sudo Smit


                        and got the result



                        The group "sudo" does not exist.


                        I think that is the reason adduser Smit sudo dose not work -- The group "sudo" does not exist yet!



                        The following command to add the user to the "wheel" group does work.



                        usermod -aG wheel Smit


                        But at this point, switching to user Smit and trying sudo still failed! I have to do one more thing. Use visudo to open and edit the /etc/sudoers file. Make sure that the line that starts with %wheel is not commented. It should look exactly like this:



                        ## Allows people in group wheel to run all commands
                        %wheel ALL=(ALL) ALL


                        That is the final step to set up set up the account and now everything is OK.






                        share|improve this answer








                        New contributor




                        Betty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.

























                          0














                          I've run into the exact same situation with OP. Tried the same command and got the same result.



                          Then I used



                          usermod -aG sudo Smit


                          and got the result



                          The group "sudo" does not exist.


                          I think that is the reason adduser Smit sudo dose not work -- The group "sudo" does not exist yet!



                          The following command to add the user to the "wheel" group does work.



                          usermod -aG wheel Smit


                          But at this point, switching to user Smit and trying sudo still failed! I have to do one more thing. Use visudo to open and edit the /etc/sudoers file. Make sure that the line that starts with %wheel is not commented. It should look exactly like this:



                          ## Allows people in group wheel to run all commands
                          %wheel ALL=(ALL) ALL


                          That is the final step to set up set up the account and now everything is OK.






                          share|improve this answer








                          New contributor




                          Betty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.























                            0












                            0








                            0







                            I've run into the exact same situation with OP. Tried the same command and got the same result.



                            Then I used



                            usermod -aG sudo Smit


                            and got the result



                            The group "sudo" does not exist.


                            I think that is the reason adduser Smit sudo dose not work -- The group "sudo" does not exist yet!



                            The following command to add the user to the "wheel" group does work.



                            usermod -aG wheel Smit


                            But at this point, switching to user Smit and trying sudo still failed! I have to do one more thing. Use visudo to open and edit the /etc/sudoers file. Make sure that the line that starts with %wheel is not commented. It should look exactly like this:



                            ## Allows people in group wheel to run all commands
                            %wheel ALL=(ALL) ALL


                            That is the final step to set up set up the account and now everything is OK.






                            share|improve this answer








                            New contributor




                            Betty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.










                            I've run into the exact same situation with OP. Tried the same command and got the same result.



                            Then I used



                            usermod -aG sudo Smit


                            and got the result



                            The group "sudo" does not exist.


                            I think that is the reason adduser Smit sudo dose not work -- The group "sudo" does not exist yet!



                            The following command to add the user to the "wheel" group does work.



                            usermod -aG wheel Smit


                            But at this point, switching to user Smit and trying sudo still failed! I have to do one more thing. Use visudo to open and edit the /etc/sudoers file. Make sure that the line that starts with %wheel is not commented. It should look exactly like this:



                            ## Allows people in group wheel to run all commands
                            %wheel ALL=(ALL) ALL


                            That is the final step to set up set up the account and now everything is OK.







                            share|improve this answer








                            New contributor




                            Betty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.









                            share|improve this answer



                            share|improve this answer






                            New contributor




                            Betty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.









                            answered 21 mins ago









                            BettyBetty

                            1011




                            1011




                            New contributor




                            Betty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.





                            New contributor





                            Betty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.






                            Betty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Unix & Linux Stack Exchange!


                                • 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%2funix.stackexchange.com%2fquestions%2f370400%2fcant-add-user-to-sudo-group-in-centos-7-i386no-gui-its-minimal%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

                                CARDNET

                                Boot-repair Failure: Unable to locate package grub-common:i386

                                Aws NAT - Aws IGW- Aws router