Announcement

Collapse
No announcement yet.

Limiting shutdown to root won't allow sudo/admin to authorize shut down? SOLVED

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

    Limiting shutdown to root won't allow sudo/admin to authorize shut down? SOLVED

    So, I'm trying to set my computer up to safely share with other people, and I've encountered one problem. I want to be able to simply lock my session, and allow my programs to keep running (particularly ktorrent, which I've scheduled to start and stop during non-peak usage hours in my house). I don't want to allow anyone else to shut down the computer from the KDM screen, so under the Login Manager, I set it to only allow root to shut the computer down. The trouble with this is I don't have a root password, due to the sudo set up kubuntu uses, and when I tried to use my password instead as if I were using sudo, it said I had the wrong password. Likewise, leaving the password field blank didn't work either.

    Does this mean I have to set a root password, and just use it for shut down? If not, is there any other alternative other than just having to trust whoever I let use my computer that they won't shut it down without my permission?

    Thanks in advance for any help you can offer me.

    #2
    Re: Limiting shutdown to root won't allow sudo/admin to authorize shut down?

    Only the Super User (sudo) can shutdown Kubuntu. If you haven't shared your password, and you are su, then no one else can execute the shutdown command.

    I think.

    You can check it out with a
    Code:
    man shutdown
    in the konsole, and see what it says about the command.

    Comment


      #3
      Re: Limiting shutdown to root won't allow sudo/admin to authorize shut down?

      Before I set it to root only in the Login Manager screen, I'd never been prompted for a password/authorization whenever I've selected shutdown from the menu at the KDM, or from my Kmenu when logged into a KDE session.

      Also, when I looked at the shutdown man page, it looks like it's intended to schedule a shut down time, which isn't exactly what I'm concerned about.

      Also, on the topic of man pages, I get mildly annoyed with reading them in the konsole window and I know I used to be able to read man pages in konqueror, but for some reason I'm either completely forgetting how to do it, kubuntu changed something so it doesn't work now, or I've got something wrong with my system. I'll have to look into that.

      Comment


        #4
        Re: Limiting shutdown to root won't allow sudo/admin to authorize shut down?

        The easy experiment would be to log in with the name of one of your other users, and then try to shut it down. Hopefully, the "log out" screen will only offer to log out your session, not shut down the computer.

        Comment


          #5
          Re: Limiting shutdown to root won't allow sudo/admin to authorize shut down?

          I'll go ahead and try that.

          On the topic of my whining about man pages in konsole: Of course, if I complain about something before Googling it, the first result returned by Google always solves the problem. Well, at least I can read man pages in konqueror again. Sorry about the rant on that topic.

          Comment


            #6
            Re: Limiting shutdown to root won't allow sudo/admin to authorize shut down?

            Okay, I logged out completely and tried the shutdown option in the KDM menu. It let me shut the computer down without asking for a password or any authorization. If anyone can shut down from the KDM menu, it doesn't matter if a user can shut down from a logged in KDE session or not, as they'd only have to log out or lock their session to be able to do so. I'm back at square one here.

            Comment


              #7
              Re: Limiting shutdown to root won't allow sudo/admin to authorize shut down?

              Least technical solution would be to tell everyone to NOT shut the computer down unless there was a very good reason (e.g. thunderstorm and no surge protector).
              For external use only.

              Comment


                #8
                Re: Limiting shutdown to root won't allow sudo/admin to authorize shut down?

                I was hoping for a more technical solution, as I know too many people who believe that the quickest and easiest way to fix a computer is turn it off and back on again. A lot of people would rather ignore my "don't turn off the computer" rule than admit they don't know what they're doing. This is why I'm trying to make it difficult for people to do this to my computer, because I'm sure I'll notice them climbing under my desk to pull the power cord, or opening the front door on my case to get at the power button, but I might not catch them hitting shut down until the process is started and screwing up things for me.

                I suppose I should just say no one else can touch my computer, there is wifi available and they can bring their laptops, but I hate not having an option for people without laptops, and I hate even more having to babysit them so I don't have to worry about egos and ignorance leading to my computer being shut down.

                Comment


                  #9
                  Re: Limiting shutdown to root won't allow sudo/admin to authorize shut down?

                  What happens if you set both local and remote to "only root"? (Test as a sudoer, as a non-sudoer, and logged out.)
                  What about if you set both to "nobody"?
                  For external use only.

                  Comment


                    #10
                    Re: Limiting shutdown to root won't allow sudo/admin to authorize shut down?

                    When I have it set to root only, it doesn't recognize my password from the KDM screen. I could turn that option back on, and see if it'll let me shut down from my KDE session, it might have been confused over my authority to sudo from the KDM screen, since I wasn't logged on at the time. I'll try it out and report back.

                    I would guess that setting it to nobody would mean there would be no way to shutdown, short of taking away power, holding in the reboot button on the tower, or changing the settings in the login manager right before shutting down and changing it back once the computer is turned on again.

                    Comment


                      #11
                      Re: Limiting shutdown to root won't allow sudo/admin to authorize shut down?

                      Okay, the setting I originally thought was a problem is the correct one. If I'm logged into a KDE session as myself, it doesn't prompt me for password. If I try to turn the computer off from the KDM screen, it wants the nonexistent root password and nothing else. If I try to turn the computer off from another user account without admin privileges, it logs out of the KDE session, and then it prompts for root password and leaves the computer at the KDM if no password, or the wrong one, is entered.

                      I feel stupid for not testing the other places I could shut down the computer from before I assumed the setting didn't work like I wanted it to. Thank you for your help.

                      Comment


                        #12
                        Re: Limiting shutdown to root won't allow sudo/admin to authorize shut down? SOLVED

                        Glad we could help.
                        For external use only.

                        Comment


                          #13
                          Re: Limiting shutdown to root won't allow sudo/admin to authorize shut down?

                          Originally posted by DeathKitten
                          If I try to turn the computer off from another user account without admin privileges, it logs out of the KDE session, and then it prompts for root password and leaves the computer at the KDM if no password, or the wrong one, is entered.
                          Yay -- I got one right today -- I'm writing this down ....





                          Now, if you will open your computer case, and pull the "power on" wire off the motherboard header, I think maybe you will have totally fixed 'em!

                          Comment


                            #14
                            Re: Limiting shutdown to root won't allow sudo/admin to authorize shut down?

                            Originally posted by dibl
                            Now, if you will open your computer case, and pull the "power on" wire off the motherboard header, I think maybe you will have totally fixed 'em!
                            I'm hoping that anyone stupid enough to think they should be shutting my computer down even when they're blocked from doing so due to password protection, will be also stupid enough to not think to open the door on the front of my case to find the power switch. Besides, I need that wire connected correctly for when I do need to turn off the computer (i.e. hardware and kernel upgrades, as well as power related reasons).

                            I suppose I could buy myself one of those really spiffy looking switches with the military looking cover on it, and require the switch to be flipped in order for the power button to work, but I think that might be over kill. At least I'll wait until I've got the budget to buy silly switches, extra wire, and that soldering iron I don't own yet because I haven't had a need for it, and I haven't bothered to learn how to use it yet.

                            Comment


                              #15
                              Re: Limiting shutdown to root won't allow sudo/admin to authorize shut down? SOLVED

                              Heh, my computer case actually has a lock on the door, so that all drives, power buttons, etc. can be protected. (It's still got USB ports on the side, though...)

                              Of course, the one time I locked it, I lost the key and opened the lock with a paperclip. (That is, I lifted the latch with a paperclip. It's a cheap plastic thing.)
                              For external use only.

                              Comment

                              Working...
                              X