Announcement

Collapse
No announcement yet.

Broke sudo permission

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

    Broke sudo permission

    I have been trying to get skype to work. I was following some instructions on their forums and now I am unable to use sudo. My machine doesn't recognise me anymore.
    I think I was trying to to enable read/write on dev/dsp using chown or something.
    When I try to use a sudo,now, I get this: (e.g.)

    garylowe@ubuntu:~$ sudo /etc/apt/sources.list
    Password:
    garylowe is not in the sudoers file. This incident will be reported.
    garylowe@ubuntu:~$

    Does someone have an idea how I can fix this, please. I should know better by now than to fiddle with things that I don't properly understand, but, you know how it is...

    Thanks in advance for your help.

    Lowey
    I wish I was the man my dog thinks I am.<br /><br />Registered Linux User No. 402825

    #2
    Re: Broke sudo permission

    You can try booting into recovery mode.
    You should be logged in as root, then.
    Type
    Code:
    nano /etc/passwd
    and/or
    Code:
    nano /etc/group
    and make sure your user is in the admin group. You may also want to
    Code:
    nano /etc/sudoers
    to make sure that admin can do stuff.

    By the way, what instructions did you follow to get Skype installed?
    Linux is ready for the desktop--but whose desktop?<br />How to install software in Kubuntu

    Comment


      #3
      Re: Broke sudo permission

      Check out https://wiki.ubuntu.com/RootSudo If you followed some instructions that were not designed for debian style distributions, in general, or (K)Ubuntu specifically, you might have left your system in a confused state.

      Comment


        #4
        Re: Broke sudo permission

        Thank you very much for your prompt replies.
        aysiu, I think you are on the money, but unfortunately I don't understand even how to boot into recovery mode. I think I need a disc to do that? I originally installed Hoary from disc then upgraded to Breezy with a dist-upgrade,(following your instructions, if I remember rightly) so that is the only disc I have. I tried the nano /etc/group but got scared to do anything in case I broke something else. Would it be possible for some very slow, deliberate instructions that an old newbie might follow?
        I installed Skype from a link I found in these forums. Added to sources.list and it installed. I couldn't get the mike to work, though, and was trying a couple of suggestions when....
        When I can get sudo going again I will add the link to this post if you like.
        Thanks again
        Lowey
        I wish I was the man my dog thinks I am.<br /><br />Registered Linux User No. 402825

        Comment


          #5
          Re: Broke sudo permission

          Recovery mode should be one your options in the boot menu. It should be something like:

          1. Ubuntu
          2. Ubuntu (recovery mode)
          3. memtest

          You don't have those choices in your boot menu?

          Your /etc/group should look like this:
          Code:
          root:x:0:
          daemon:x:1:
          bin:x:2:
          sys:x:3:
          adm:x:4:lowey
          tty:x:5:
          disk:x:6:
          lp:x:7:cupsys
          mail:x:8:
          news:x:9:
          uucp:x:10:
          man:x:12:
          proxy:x:13:
          kmem:x:15:
          dialout:x:20:cupsys,lowey
          fax:x:21:
          voice:x:22:
          cdrom:x:24:hal,lowey
          floppy:x:25:hal,lowey
          tape:x:26:
          sudo:x:27:
          audio:x:29:lowey
          dip:x:30:lowey
          www-data:x:33:
          backup:x:34:
          operator:x:37:
          list:x:38:
          irc:x:39:
          src:x:40:
          gnats:x:41:
          shadow:x:42:
          utmp:x:43:
          video:x:44:lowey
          sasl:x:45:
          plugdev:x:46:hal,lowey
          staff:x:50:
          games:x:60:
          users:x:100:
          nogroup:x:65534:
          dhcp:x:101:
          syslog:x:102:
          klog:x:103:
          lowey:x:1000:
          lpadmin:x:104:lowey
          scanner:x:105:lowey
          admin:x:106:lowey
          crontab:x:107:
          ssh:x:108:
          slocate:x:109:
          messagebus:x:110:
          hal:x:111:
          saned:x:112:
          Your /etc/sudoers file should look like this:
          Code:
          # /etc/sudoers
          #
          # This file MUST be edited with the 'visudo' command as root.
          #
          # See the man page for details on how to write a sudoers file.
          #
          
          # Host alias specification
          
          # User alias specification
          
          # Cmnd alias specification
          
          # Defaults
          
          Defaults    !lecture,tty_tickets,!fqdn
          
          # User privilege specification
          root  ALL=(ALL) ALL
          
          # Members of the admin group may gain root privileges
          %admin ALL=(ALL) ALL
          Linux is ready for the desktop--but whose desktop?<br />How to install software in Kubuntu

          Comment


            #6
            Re: Broke sudo permission

            Thanks for the reply, aysiu

            I don't have a boot menu. When I restart, it just boots up without asking me anything.

            I did the nano etc/group command and found that the differences between mine and the one you posted are:-

            My username is not at the end of these
            adm:4:
            dialout:20:cupsys
            cdrom:24:hal
            floppy:25:hal
            dip:30
            video:44
            plugdev:46:hal

            also, my entries after the nogroup line are

            crontab:101
            ssh:102
            postfix:103
            postdrop:104
            syslog:105
            klog:106
            garylowe:1000
            lpadmin:107
            scanner:108
            admin:109

            When I tried nano /etc/sudoers I got "error reading/etc/sudoersermission denied.

            So I gather that I have to work out how to get into recovery mode and edit the files to look as you posted? I read on a forum somewhere I could press escape during boot to enable this but I'm not sure exactly when during boot and if this is a good way or not.

            Thanks for your patience

            Lowey
            I wish I was the man my dog thinks I am.<br /><br />Registered Linux User No. 402825

            Comment


              #7
              Re: Broke sudo permission

              I'll let Aysiu do the heavy lifting but I will say that to get into rescue mode you will probably have to hit Esc as soon as the boot process starts. A standard (K)Ubuntu install can give you as little as 3 seconds to change the boot. So hit Esc as soon as possible and then hit the down arrow key. This will stop the machine from doing a normal boot. Then look at the screen and use the up or down arrow keys as needed to get the choice that says "Rescue mode" after the name and number of the kernel to light up. At that point, hit enter.

              Comment


                #8
                Re: Broke sudo permission

                If you can't manage to get into recovery mode, do you happen to have a live CD handy (Ubuntu live or, better yet, Knoppix)?
                Linux is ready for the desktop--but whose desktop?<br />How to install software in Kubuntu

                Comment


                  #9
                  Re: Broke sudo permission

                  I have the ubuntu hoary live cd. (but running breezy).
                  I wish I was the man my dog thinks I am.<br /><br />Registered Linux User No. 402825

                  Comment


                    #10
                    Re: Broke sudo permission

                    I am not well versed yet, still a lot of fumbling around, but did you try switching to root or logging in as root:

                    su
                    root
                    (root passwd)
                    then use the apt-get or whatever straight up.

                    Somehow I disabled the sudo crud, didnt like it much.
                    I think to be added to the sudo group you would have to do it with root permissions or a login that has them.

                    Comment


                      #11
                      Re: Broke sudo permission

                      Lowey: A hoary live-cd will be fine. You're only going to use it to mount your Kubuntu partition, so you can change the /etc/group and /etc/sudoers files. I don't think the mount command or the nano editor has changed since Hoary. My only problem is that I don't have an Ubuntu live CD of any kind so I can't talk you through it.

                      Bighom: Please read the wiki page at https/wiki.ubuntu.org/RootSudo Sudo is the Ubuntu Way to handle administrative tasks. It takes a little bit of getting used to, but you might find that you like it better than su if you give it a chance.

                      Comment


                        #12
                        Re: Broke sudo permission

                        Thanks for the replies all,
                        I think that is what I need, someone to talk me through it. I've only broken that one bit, so far, and I really don't want to do any more damage. I like my little Kubuntu system, even if my kids keep telling me "just use windows, dad". Ummmmmmm......no.
                        Cheers
                        Lowey
                        I wish I was the man my dog thinks I am.<br /><br />Registered Linux User No. 402825

                        Comment


                          #13
                          Re: Broke sudo permission

                          Did the recovery mode at restart.
                          Added my username in /etc/group where it was missing.
                          Rebooted and all is well again.
                          Did short (but nonetheless spectacular) happy dance.

                          Thank you so much aysiu and askrieger for your patience and advice, and to Bighom for your input.

                          While I'm still very much in the dark with a lot of these things, I am gaining confidence (and dare I say it, even a little expertise) in using Linux. It is because of the wonderful, expert advice I have received from fellow Kubuntu users in these forums.

                          Aysiu, if you are still wondering, this is what I added to my sources.list to get Skype-

                          deb http://download.skype.com/linux/repos/debian/ stable non-free

                          I'll be a little more careful trying to repair it, next time.

                          Thanks again, all, for the input.

                          Cheers

                          Lowey
                          I wish I was the man my dog thinks I am.<br /><br />Registered Linux User No. 402825

                          Comment

                          Working...
                          X