Find the answer to your Linux question:
Results 1 to 6 of 6
Can someone explain this to me? I don't understand why any user can manually reboot/shutdown from GUI but terminal requires root privileges. Is this really a safety concern?? Thanks in ...
  1. #1
    Linux Guru jmadero's Avatar
    Join Date
    Jul 2007
    Location
    California
    Posts
    1,958

    Why Terminal Shutdown Requires Root??

    Can someone explain this to me? I don't understand why any user can manually reboot/shutdown from GUI but terminal requires root privileges. Is this really a safety concern?? Thanks in advance
    Bodhi 1.3 & Bodhi 1.4 using E17
    Dell Studio 17, Intel Graphics card, 4 gigs of RAM, E17

    "The beauty in life can only be found by moving past the materialism which defines human nature and into the higher realm of thought and knowledge"

  2. #2
    Linux Guru rokytnji's Avatar
    Join Date
    Jul 2008
    Location
    Pecos, Texas
    Posts
    2,946
    Not sure about Ubuntu. But /etc/sudoers on my AntiX box gets it's shutdown and reboot command from /sbin, which requires root access.

    Probably in Ubuntu. The GUI uses a script that incorporates sudo privileges automatically in the button script for shutdown or reboot also.

    Like a shutdown.sh or reboot.sh script maybe. Mine are in /usr/local/bin.
    Linux Registered User # 475019
    Lead,Follow, or get the heck out of the way
    AntiX,Puppy,Ubuntu,Windows 7=(cuz of scooters)
    Open CourseWare for Linux Geeks

  3. #3
    Just Joined! eldipablo's Avatar
    Join Date
    Oct 2008
    Location
    El Cajon, CA
    Posts
    10
    I think it's by design because you don't want someone accidentally remoting in and shutting down a system. Requiring root adds a little bit of a CYA layer.

  4. #4
    Linux Guru jmadero's Avatar
    Join Date
    Jul 2007
    Location
    California
    Posts
    1,958
    Thanks to both of you. Rokyntji I'm looking for the script but I have nothing in /usr/local/bin, trying to figure out how to give myself the privilege because I do timed shutdowns routinely, having to be root to do it is annoying :-/ I'll have to consider the safety/security issue a bit more but from reading, it seems unlikely that someone would hack my system to shut it down
    Bodhi 1.3 & Bodhi 1.4 using E17
    Dell Studio 17, Intel Graphics card, 4 gigs of RAM, E17

    "The beauty in life can only be found by moving past the materialism which defines human nature and into the higher realm of thought and knowledge"

  5. #5
    Guest
    Join Date
    Feb 2005
    Posts
    314
    Quote Originally Posted by jmadero View Post
    Can someone explain this to me? I don't understand why any user can manually reboot/shutdown from GUI but terminal requires root privileges. Is this really a safety concern?? Thanks in advance
    It's fairly normal behaviour, if the session was launched via a display manager then it's likely that consolekit and dbus handle the shutdown/reboot controls from the gui.

    Issuing e.g. "/usr/bin/shutdown -h now" from a vt bypasses this and thus requires root privileges in order to shutdown.

  6. #6
    Linux Guru rokytnji's Avatar
    Join Date
    Jul 2008
    Location
    Pecos, Texas
    Posts
    2,946
    Looking through Ubuntu 10.04LTS

    http://ompldr.org/vYXdneg/Screenshot-1.p…

    HTH.

    Non gui way

    Code:
    $ locate shutdown
    /sbin/shutdown
    /usr/bin/kdeinit4_shutdown
    /usr/lib/hal/scripts/hal-system-power-shutdown
    /usr/lib/hal/scripts/linux/hal-system-power-shutdown-linux
    /usr/lib/jitsi/sc-bundles/shutdown-timeout.jar
    /usr/share/app-install/desktop/gshutdown.desktop
    /usr/share/app-install/desktop/kde4_kshutdown.desktop
    /usr/share/app-install/icons/_usr_share_pixmaps_gshutdown.png
    /usr/share/app-install/icons/kshutdown.png
    /usr/share/apport/unkillable_shutdown
    /usr/share/doc/libao-dev/html/ao_shutdown.html
    /usr/share/gnome/shutdown
    /usr/share/gnome/shutdown/libcanberra-logout-sound.sh
    /usr/share/icons/Amaranth/scalable/apps/gnome-shutdown.svg
    /usr/share/icons/Breathe/16x16/actions/gnome-shutdown.png
    /usr/share/icons/Breathe/16x16/actions/system-shutdown.png
    /usr/share/icons/Breathe/22x22/actions/gnome-shutdown.png
    /usr/share/icons/Breathe/22x22/actions/system-shutdown.png
    /usr/share/icons/Breathe/24x24/actions/gnome-shutdown.png
    /usr/share/icons/Breathe/24x24/actions/system-shutdown.png
    /usr/share/icons/Breathe/32x32/actions/gnome-shutdown.png
    /usr/share/icons/Breathe/32x32/actions/system-shutdown.png
    /usr/share/icons/Breathe/48x48/actions/gnome-shutdown.png
    /usr/share/icons/Breathe/48x48/actions/system-shutdown.png
    /usr/share/icons/Breathe/scalable/actions/gnome-shutdown.svg
    /usr/share/icons/Breathe/scalable/actions/system-shutdown.svg
    /usr/share/icons/HighContrastLargePrintInverse/48x48/actions/gnome-shutdown.png
    /usr/share/icons/HighContrastLargePrintInverse/48x48/actions/system-shutdown.png
    /usr/share/icons/HumanLoginIcons/apps/22/system-shutdown.png
    /usr/share/icons/HumanLoginIcons/apps/24/system-shutdown.png
    /usr/share/icons/HumanLoginIcons/apps/48/system-shutdown.png
    /usr/share/icons/Humanity/actions/16/system-shutdown-panel-restart.svg
    /usr/share/icons/Humanity/actions/16/system-shutdown-panel.svg
    /usr/share/icons/Humanity/actions/16/system-shutdown-restart-panel.svg
    /usr/share/icons/Humanity/actions/16/system-shutdown.svg
    /usr/share/icons/Humanity/actions/22/system-shutdown.svg
    /usr/share/icons/Humanity/actions/24/system-shutdown.svg
    /usr/share/icons/Humanity/actions/32/system-shutdown.svg
    /usr/share/icons/Humanity/actions/48/system-shutdown.svg
    /usr/share/icons/Humanity/apps/24/gnome-shutdown.svg
    /usr/share/icons/Humanity/apps/24/xfsm-shutdown.svg
    /usr/share/icons/Humanity/apps/32/gnome-shutdown.svg
    /usr/share/icons/Humanity/apps/32/system-shutdown.svg
    /usr/share/icons/Humanity/apps/32/xfsm-shutdown.svg
    /usr/share/icons/Humanity/apps/48/gnome-shutdown.svg
    /usr/share/icons/Humanity/apps/48/system-shutdown.svg
    /usr/share/icons/Humanity/apps/48/xfsm-shutdown.svg
    /usr/share/icons/Humanity-Dark/actions/16/system-shutdown-panel-restart.svg
    /usr/share/icons/Humanity-Dark/actions/16/system-shutdown-panel.svg
    /usr/share/icons/Humanity-Dark/actions/16/system-shutdown-restart-panel.svg
    /usr/share/icons/LoginIcons/apps/22/system-shutdown.svg
    /usr/share/icons/LoginIcons/apps/24/system-shutdown.svg
    /usr/share/icons/LoginIcons/apps/48/system-shutdown.svg
    /usr/share/icons/Lush/scalable/apps/gnome-shutdown.svg
    /usr/share/icons/Neu/128x128/actions/gnome-shutdown.png
    /usr/share/icons/Neu/128x128/actions/system-shutdown.png
    /usr/share/icons/Neu/22x22/actions/gnome-shutdown.png
    /usr/share/icons/Neu/22x22/actions/system-shutdown.png
    /usr/share/icons/Neu/24x24/actions/gnome-shutdown.png
    /usr/share/icons/Neu/24x24/actions/system-shutdown.png
    /usr/share/icons/Neu/48x48/actions/gnome-shutdown.png
    /usr/share/icons/Neu/48x48/actions/system-shutdown.png
    /usr/share/icons/Neu/scalable/actions/gnome-shutdown.svg
    /usr/share/icons/Neu/scalable/actions/system-shutdown.svg
    /usr/share/icons/Nuvola/scalable/apps/gnome-shutdown.svg
    /usr/share/icons/SphereCrystal/scalable/apps/gnome-shutdown.svg
    /usr/share/icons/gnome/16x16/actions/gnome-shutdown.png
    /usr/share/icons/gnome/16x16/actions/system-shutdown.png
    /usr/share/icons/gnome/22x22/actions/gnome-shutdown.png
    /usr/share/icons/gnome/22x22/actions/system-shutdown.png
    /usr/share/icons/gnome/24x24/actions/gnome-shutdown.png
    /usr/share/icons/gnome/24x24/actions/system-shutdown.png
    /usr/share/icons/gnome/scalable/actions/gnome-shutdown.svg
    /usr/share/icons/gnome/scalable/actions/system-shutdown.svg
    /usr/share/icons/oxygen/128x128/actions/system-shutdown.png
    /usr/share/icons/oxygen/16x16/actions/system-shutdown.png
    /usr/share/icons/oxygen/22x22/actions/system-shutdown.png
    /usr/share/icons/oxygen/32x32/actions/system-shutdown.png
    /usr/share/icons/oxygen/48x48/actions/system-shutdown.png
    /usr/share/icons/oxygen/64x64/actions/system-shutdown.png
    /usr/share/icons/ubuntu-mono-dark/actions/16/system-shutdown-panel.svg
    /usr/share/icons/ubuntu-mono-dark/actions/22/system-shutdown-panel.svg
    /usr/share/icons/ubuntu-mono-dark/actions/24/system-shutdown-panel.svg
    /usr/share/icons/ubuntu-mono-dark/apps/16/system-shutdown-panel-restart.svg
    /usr/share/icons/ubuntu-mono-dark/apps/22/system-shutdown-panel-restart.svg
    /usr/share/icons/ubuntu-mono-dark/apps/24/system-shutdown-panel-restart.svg
    /usr/share/icons/ubuntu-mono-light/actions/16/system-shutdown-panel.svg
    /usr/share/icons/ubuntu-mono-light/actions/22/system-shutdown-panel.svg
    /usr/share/icons/ubuntu-mono-light/actions/24/system-shutdown-panel.svg
    /usr/share/icons/ubuntu-mono-light/apps/16/system-shutdown-panel-restart.svg
    /usr/share/icons/ubuntu-mono-light/apps/22/system-shutdown-panel-restart.svg
    /usr/share/icons/ubuntu-mono-light/apps/24/system-shutdown-panel-restart.svg
    /usr/share/kde4/apps/desktoptheme/default/dialogs/shutdowndialog.svgz
    /usr/share/kde4/apps/desktoptheme/default/opaque/dialogs/shutdowndialog.svgz
    /usr/share/kde4/apps/desktoptheme/oxygen/dialogs/shutdowndialog.source.svgz
    /usr/share/kde4/apps/desktoptheme/oxygen/dialogs/shutdowndialog.svgz
    /usr/share/kde4/apps/desktoptheme/oxygen/opaque/dialogs/shutdowndialog.svgz
    /usr/share/libindicator/icons/hicolor/16x16/actions/system-shutdown-panel.png
    /usr/share/libindicator/icons/hicolor/16x16/actions/system-shutdown.png
    /usr/share/libindicator/icons/hicolor/22x22/actions/system-shutdown-panel.png
    /usr/share/libindicator/icons/hicolor/22x22/actions/system-shutdown.png
    /usr/share/libindicator/icons/hicolor/24x24/actions/system-shutdown-panel.png
    /usr/share/libindicator/icons/hicolor/24x24/actions/system-shutdown.png
    /usr/share/libindicator/icons/hicolor/scalable/actions/system-shutdown-panel.svg
    /usr/share/libindicator/icons/hicolor/scalable/actions/system-shutdown.svg
    /usr/share/man/man2/shutdown.2.gz
    /usr/share/man/man8/shutdown.8.gz
    /usr/share/unattended-upgrades/unattended-upgrade-shutdown
    Linux Registered User # 475019
    Lead,Follow, or get the heck out of the way
    AntiX,Puppy,Ubuntu,Windows 7=(cuz of scooters)
    Open CourseWare for Linux Geeks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...