Announcement

Collapse
No announcement yet.

Locked out of sudo

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Locked out of sudo

    When I sudo anything, response is "erwin is not in the sudoers file".

    erwin was in the sudoers file yesterday.

    How is it possible that this disappears ?

    And is it possible to recover ?

    #2
    imposable to know without knowing what you have been doing .

    type
    Code:
    groups
    in a terminal and see what it spits out.

    Code:
            [FONT=monospace][COLOR=#000000]vinny@vinny-Bonobo-Extreme:~$ groups [/COLOR]
    vinny adm cdrom sudo dip plugdev lpadmin sambashare
    [/FONT]
    you want to make sure you are in the "adm" group .

    if not we can tell you how to get back in.

    VINNY
    i7 4core HT 8MB L3 2.9GHz
    16GB RAM
    Nvidia GTX 860M 4GB RAM 1152 cuda cores

    Comment


      #3
      Originally posted by vinnywright View Post
      you want to make sure you are in the "adm" group .
      I don't think the adm group is very important actually, as I understand it it's mainly used for read access to log files without using sudo (very handy on a server, but not essential on a desktop)... or is it used for other things too?

      The sudo group is the important one.
      samhobbs.co.uk

      Comment


        #4
        groups output

        Originally posted by vinnywright View Post
        imposable to know without knowing what you have been doing .

        type
        Code:
        groups
        in a terminal and see what it spits out.

        Code:
                [FONT=monospace][COLOR=#000000]vinny@vinny-Bonobo-Extreme:~$ groups [/COLOR]
        vinny adm cdrom sudo dip plugdev lpadmin sambashare
        [/FONT]
        you want to make sure you are in the "adm" group .

        if not we can tell you how to get back in.

        VINNY
        spits out "erwin svn".
        I installed SVN yesterday, created a user and group for it, and added my user to the group.
        Seems like I erased all the other groups the user participated in.

        Comment


          #5
          You probably did this:

          Code:
          sudo usermod -G svn erwin
          Whereas you wanted to do this:

          Code:
          sudo usermod -a -G svn erwin
          The -a appends the group you're adding to the existing list of groups.

          Assuming you're using grub, this link should help you boot to a root shell:

          http://askubuntu.com/questions/92556...o-a-root-shell

          Then as root, you should run something like this:

          Code:
          usermod -a -G erwin,adm,cdrom,sudo,dip,plugdev,lpadmin,sambashare erwin
          (based on the groups my user is in).
          samhobbs.co.uk

          Comment


            #6
            Originally posted by Feathers McGraw View Post
            I don't think the adm group is very important actually, as I understand it it's mainly used for read access to log files without using sudo (very handy on a server, but not essential on a desktop)... or is it used for other things too?

            The sudo group is the important one.
            Humm seams you may be correct ,,,,,,,,,,,,
            Code:
                    [FONT=monospace][COLOR=#000000]# [/COLOR]
            # This file MUST be edited with the 'visudo' command as root. 
            # 
            # Please consider adding local content in /etc/sudoers.d/ instead of 
            # directly modifying this file. 
            # 
            # See the man page for details on how to write a sudoers file. 
            # 
            Defaults        env_reset 
            Defaults        mail_badpass 
            Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 
            
            # Host alias specification 
            
            # User alias specification 
            
            # Cmnd alias specification 
            
            # User privilege specification 
            root    ALL=(ALL:ALL) ALL 
            
            # Members of the admin group may gain root privileges 
            %admin ALL=(ALL) ALL 
            
            # Allow members of group sudo to execute any command 
            %sudo   ALL=(ALL:ALL) ALL 
            
            # See sudoers(5) for more information on "#include" directives: 
            
            #includedir /etc/sudoers.d
            
            [/FONT]
            it used to be "adm" and or "admin" seems sudo group is back as well but I would check the sudoers file on your system (I am on 15.04)to be sure as it has changed through the years .

            any way ,,,,,,,,,@erwin you will nead to boot into recovery mode from grub menu and chose root shell then do
            Code:
            mount -o --remount rw /
            then
            Code:
            useradd -G adm,sudo,cdrom,dip,plugdev,lpadmin,sambashare,admin erwin
            note the space between the last group and your user name.

            VINNY

            EDIT: Humm the feathery one beet me to it
            i7 4core HT 8MB L3 2.9GHz
            16GB RAM
            Nvidia GTX 860M 4GB RAM 1152 cuda cores

            Comment


              #7
              Originally posted by Feathers McGraw View Post
              Code:
              usermod -a -G erwin,adm,cdrom,sudo,dip,plugdev,lpadmin,sambashare erwin
              (based on the groups my user is in).
              You'll probably want to also restore group erwin as the primary group of user erwin
              Code:
              usermod -g erwin erwin
              Originally posted by vinnywright View Post
              it used to be "adm" and or "admin" seems sudo group is back as well but I would check the sudoers file on your system
              Old releases of *buntu used the "admin" as the group ("adm" group has always served a different purpose), but they changed it to the "sudo" group a while back...the "admin" group was kept in sudoers for backwards compatibility.
              Last edited by kubicle; Apr 12, 2015, 01:07 PM.

              Comment


                #8
                Originally posted by vinnywright View Post
                it used to be "adm" and or "admin" seems sudo group is back as well but I would check the sudoers file on your system (I am on 15.04)to be sure as it has changed through the years
                I see! You've been doing this for a lot longer than I have. Possibly there was adm and admin, and admin was deprecated because it was confusing to have two groups with very similar names?

                EDIT: Humm the feathery one beet me to it
                Well I do have the advantage of a pair of robotic trousers
                samhobbs.co.uk

                Comment


                  #9
                  Originally posted by Feathers McGraw View Post



                  Well I do have the advantage of a pair of robotic trousers
                  + I cant type fast or spell ,,,,,so am forced to spell check my hole post

                  VINNY
                  i7 4core HT 8MB L3 2.9GHz
                  16GB RAM
                  Nvidia GTX 860M 4GB RAM 1152 cuda cores

                  Comment


                    #10
                    Originally posted by kubicle View Post

                    Old releases of *buntu used the "admin" as the group ("adm" group has always served a different purpose), but they changed it to the "sudo" group a while back...the "admin" group was kept in sudoers for backwards compatibility.
                    yes , yes ,,,,,,that was it

                    VINNY
                    i7 4core HT 8MB L3 2.9GHz
                    16GB RAM
                    Nvidia GTX 860M 4GB RAM 1152 cuda cores

                    Comment


                      #11
                      Originally posted by Feathers McGraw View Post
                      You probably did this:

                      Code:
                      sudo usermod -G svn erwin
                      Whereas you wanted to do this:

                      Code:
                      sudo usermod -a -G svn erwin
                      The -a appends the group you're adding to the existing list of groups.

                      Assuming you're using grub, this link should help you boot to a root shell:

                      http://askubuntu.com/questions/92556...o-a-root-shell

                      Then as root, you should run something like this:

                      Code:
                      usermod -a -G erwin,adm,cdrom,sudo,dip,plugdev,lpadmin,sambashare erwin
                      (based on the groups my user is in).
                      OK Thnx will try that tomorrow evening (sleep time now).

                      Comment

                      Working...
                      X