ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Sudoing a user in centOS

    IT Discussion
    7
    13
    1.5k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      aidan_walsh
      last edited by

      I always use my own account with sudo.

      If anything sudo is safer. You have better accountability as to who made what change in a multi-administrator environment, and you can limit what access a sudo user has (what applications they are able to elevate).

      1 Reply Last reply Reply Quote 3
      • coliverC
        coliver
        last edited by

        Nope, don't use root to do administration. Don't add the user to the sudoers file just add them to the wheel group.

        1 Reply Last reply Reply Quote 3
        • DustinB3403D
          DustinB3403
          last edited by

          @aidan_walsh pretty much answered it, use your own account, and elevate to sudo if you need it.

          Using the "root" account leads to "who did it" questions.

          1 Reply Last reply Reply Quote 2
          • coliverC
            coliver
            last edited by

            If you need root access just do sudo su. That way anything you do in that elevated prompt will be recorded as your user.

            1 Reply Last reply Reply Quote 3
            • AdaministratorA
              Adaministrator
              last edited by

              @aidan_walsh @DustinB3403 Thanks guys

              @coliver thanks, I had been using sudo -i, which doesn't work in centos with no entry in the sudoers file. Any other reasons not to use root if only one admin is managing the box?

              brianlittlejohnB coliverC 2 Replies Last reply Reply Quote 0
              • brianlittlejohnB
                brianlittlejohn @Adaministrator
                last edited by

                @Adaministrator Its just bad practice.

                AdaministratorA 1 Reply Last reply Reply Quote 0
                • coliverC
                  coliver @Adaministrator
                  last edited by

                  @Adaministrator said in Sudoing a user in centOS:

                  @aidan_walsh @DustinB3403 Thanks guys

                  @coliver thanks, I had been using sudo -i, which doesn't work in centos with no entry in the sudoers file. Any other reasons not to use root if only one admin is managing the box?

                  Bad practice. With sudo you often have to confirm your actions. It gives you a chance to change the command if you - a switch or rm -f /.

                  I think @scottalanmiller has an article about the dangers of running as root.

                  1 Reply Last reply Reply Quote 2
                  • coliverC
                    coliver
                    last edited by

                    If you join the wheel group you don't need to make an entry in the sudoers file. Wheel is the administrators/sudo group.

                    1 Reply Last reply Reply Quote 3
                    • AdaministratorA
                      Adaministrator @brianlittlejohn
                      last edited by Adaministrator

                      @brianlittlejohn thanks, yes I have heard this before, but I still don't understand why. Obviously you don't run a machine as root to work on documents and email. Only ever to make administrative changes to it. Never really got or found a direct answer to this question.

                      Edit because I was slower than @coliver: Got it, I will check that out, thanks!

                      1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller
                        last edited by scottalanmiller

                        To use sudo on CentOS you...

                        • Add the appropriate users to the wheel group in /etc/group

                        • Uncomment the following line in /etc/sudoers

                          %wheel ALL=(ALL) NOPASSWD: ALL

                        dafyreD 1 Reply Last reply Reply Quote 2
                        • dafyreD
                          dafyre @scottalanmiller
                          last edited by

                          @scottalanmiller said in Sudoing a user in centOS:

                          To use sudo on CentOS you...

                          • Add the appropriate users to the wheel group in /etc/group

                          • Uncomment the following line in /etc/sudoers

                            %wheel ALL=(ALL) NOPASSWD: ALL

                          Does that allow the user to sudo without having to enter a password?

                          scottalanmillerS 1 Reply Last reply Reply Quote 0
                          • scottalanmillerS
                            scottalanmiller @dafyre
                            last edited by

                            @dafyre said in Sudoing a user in centOS:

                            @scottalanmiller said in Sudoing a user in centOS:

                            To use sudo on CentOS you...

                            • Add the appropriate users to the wheel group in /etc/group

                            • Uncomment the following line in /etc/sudoers

                              %wheel ALL=(ALL) NOPASSWD: ALL

                            Does that allow the user to sudo without having to enter a password?

                            Correct.

                            1 Reply Last reply Reply Quote 0
                            • 1 / 1
                            • First post
                              Last post