Announcement

Collapse
No announcement yet.

1-click shutdown - security issue

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

    1-click shutdown - security issue

    I have managed to get a 'shutdown' and 'reboot' icon on my desktop by editing /etc/sudoers and adding:

    [my user name] ALL=(ALL) ALL

    and also commenting out

    %sudo ALL=NOPASSWD: ALL

    The shutdown icon has the command 'sudo halt' and the working path is /sbin/
    The Reboot icon has the command 'sudo reboot' and same work path.
    Both work perfectly for 1-click shutdown or reboot.
    My concern is security by allowing 'NOPASSWD: ALL'.
    Is there a better way to edit sudoers to allow NOPASSWD for just these 2 actions?
    This is on a laptop with only myself having access.
    I am running Gutsy.

    #2
    Re: 1-click shutdown - security issue

    a simpler way:
    the dcop call for reboot
    Code:
    dcop ksmserver ksmserver logout 0 1 0
    while the one for shutdown
    Code:
    dcop ksmserver ksmserver logout 0 2 0
    if you still want to use sudoers all you have to do is to add as a last line:
    Code:
     username ALL=NOPASSWD: command1, command2, etc
    with the required switches for every command
    make sure you edit sudoers correctly!



    Comment


      #3
      Re: 1-click shutdown - security issue

      musta, brilliant! I did not know about the dcop commands. Works perfectly.
      Should I return sudoers to default (original) settings?
      Many thanks.

      Comment


        #4
        Re: 1-click shutdown - security issue

        Originally posted by phatsteve
        Should I return sudoers to default (original) settings?
        it would be best to.

        Comment


          #5
          Re: 1-click shutdown - security issue

          To edit /etc/sudoers, use the command (as root or via sudo) visudo, which will check your edits and refuse to save a broken file (since that can prevent sudo working at all and leave you 'locked out' of your system.
          I am running Ubuntu 8.10 (yes Gnome) with upgrades applied daily about 0900 UK time. Hardware is Dell Precision 420, 2x 800 MHz PIII, 512 MB RDRAM, nVidia GeForce 6800 128 MB AGP graphics, 18GB SCSI and 500GB IDE HDDs, DVD burner, Hauppage TV card.

          Comment

          Working...
          X