Shutdown and Reboot without going root

Is there a way I can use the reboot or poweroff commands without using sudo or root?  Or is this a bad idea?
Last edited by Falcata (2008-09-04 00:19:30)

mcmillan wrote:
My question:  What is the difference between 'chmod +s halt' and NOPASSWD for shutdown as you suggested?  I am not familiar with NOPASSWD.
NOPASSWD is specified when you configure sudo, so some commands will be executed without asking for your users password. This is probably why it wasn't working for your menu, the computer was waiting for a password but there wasn't a way to display that request or enter it in.
That makes sense, and is in line with what I figured was going on.  With NOPASSWD which commands would be executed w/out asking for a password?  How would this be more "secure" than using chmod +s on halt and reboot?  It seems that both ways accomplish the same thing in the end, I am just trying to understand why one is better than the other.
moljac024 wrote:
mcmillan wrote:
My question:  What is the difference between 'chmod +s halt' and NOPASSWD for shutdown as you suggested?  I am not familiar with NOPASSWD.
NOPASSWD is specified when you configure sudo, so some commands will be executed without asking for your users password. This is probably why it wasn't working for your menu, the computer was waiting for a password but there wasn't a way to display that request or enter it in.
Exaclty. So you could specify the NOPASSWD parameter for the shutdown command and sudo will just do it without asking for the password. You should have an example of how to use that in your sudoers file. If not, then
man sudo
Please excuse my ignorance, but how is this better than chmod +s, which allows my user to use it w/out sudo?  It seems as though one lets ME use sudo w/out a password, the other lets ME use the command w/out sudo.  What is the benefit to using sudo without a password, other than not having to physically type the password?
Last edited by monstermudder78 (2008-09-04 23:13:40)

Similar Messages

  • XFCE - Shutdown and Reboot buttons greyed-out (SOLVED)

    This issue cropped up for me a couple of weeks ago.  Just sat down to try and find a solution.  Followed several suggestions from several posts to no avail.
    Finally discovered that the syntax for achieving this in "/etc/sudoers" has evidently changed.
    This is what I got from the XFCE site: and is very similar to what's in the Arch Wiki, … o_Shutdown. So I had been using the following line in /etc/sudoers and it had been working:
    %users mylaptopname=NOPASSWD: /usr/lib/xfce4/xfsm-shutdown-helper
    At some point in an XFCE upgrade the path to "xfsm-shutdown-helper" changed to "/usr/lib/xfce4/session/xfsm-shutdown-helper"
    I changed the path to "xfsm-shutdown-helper" but that didn't solve the problem.
    Finally I tried this in /etc/sudoers:
    %users  ALL=(ALL)       NOPASSWD: /sbin/shutdown -h now,/sbin/reboot
    And all the usual options in the shutdown menu re-appeared.
    Hope this helps someone.
    (Edited to show the link to the the XFCE forums and the Wiki.)
    Last edited by whatshisname (2011-11-25 16:09:31)

    Replying to my own post because of what I've discovered since I first posted this.
    Most importantly, the fix which I thought had fixed this problem didn't really work.  I was snookered into thinking it had.  But I've found another solution which appears to be working now, thus this post.
    Here's what I've found.
    I had no login/display manager on my laptop.  I was auto-logging into my desktop with this setting in /etc/inittab:
    x:5:once:/bin/su myusername -l -c '/usr/bin/startx >/dev/null 2>&1'
    The snooker alluded to above was this:  If I booted to a command line and issued "startx" to start XFCE, I would have the shutdown and reboot buttons available on the logout dialog.
    But if I booted directly into the desktop, I didn't.  It's taken me a while to figure out that this is what was going on.
    Even though my old setup had worked for the almost 2 years I've been using Arch and XFCE, some upgrade somewhere in  recent months prevented it from working any longer.
    My final fix was to install a login manager, in my case, lxdm.  And set it to auto log me into my desktop.
    I now have the expected reboot and logout menus.
    Hope this helps someone.  This has been a bear to figure out.

  • [SOLVED] Run script on systemd shutdown and reboot

    I am trying to log uptime on shutdown and reboot with no success.
    I create the file /usr/lib/systemd/system/uptime.service:
    Description=/etc/rc.local.shutdown Compatibility
    [[email protected] ~]$ ls -l /etc/rc.local.shutdown
    -rwxr-xr-x 1 root root 107 Out 24 12:42 /etc/rc.local.shutdown
    [[email protected] ~]$ cat /etc/rc.local.shutdown
    echo "$(date) - $(/usr/bin/uptime | sed 's/.*up \([^,]*\), .*/\1/')" >> /home/jribeiro/registo_de_uptime
    Any ideas?
    Last edited by joseribeiro (2014-10-25 19:57:59)

    I altered the uptime unit file:
    [[email protected] ~]$ cat /usr/lib/systemd/system/uptime.service
    Description=/etc/rc.local.shutdown Compatibility
    Then I started the uptime service manually:
    [[email protected] ~]$ sudo systemctl start uptime
    I checked the 'registo_de_uptime' file:
    [[email protected] ~]$ cat /home/jribeiro/registo_de_uptime
    Sáb Out 25 19:43:31 WEST 2014 - 2 min
    After that I rebooted my system.
    I checked the 'registo_de_uptime' file, again:
    [[email protected] ~]$ cat /home/jribeiro/registo_de_uptime
    Sáb Out 25 19:43:31 WEST 2014 - 2 min
    Sáb Out 25 19:44:27 WEST 2014 - 3 min
    Everything seems to be alright. I wanted to make the ultimate test.
    With that in mind I rebooted the system.
    I checked the 'registo_de_uptime' file, once more:
    [[email protected] ~]$ cat /home/jribeiro/registo_de_uptime
    Sáb Out 25 19:43:31 WEST 2014 - 2 min
    Sáb Out 25 19:44:27 WEST 2014 - 3 min
    No success...
    It works when I start the service manually and in the right next reboot, after that it won't work.
    Here is the journal's ouput:
    [[email protected] ~]$ sudo journalctl -b -0 -u uptime
    -- Logs begin at Sex 2014-10-24 22:02:03 WEST, end at Sáb 2014-10-25 20:05:29 WEST. --
    By the way:
    [[email protected] ~]$ sudo systemctl status uptime
    ● uptime.service - /etc/rc.local.shutdown Compatibility
    Loaded: loaded (/usr/lib/systemd/system/uptime.service; enabled)
    Active: inactive (dead)
    Last edited by joseribeiro (2014-10-25 19:07:32)

  • Shutdown and reboot logging

    Is there any file that keeps shutdowns and reboots track? or
    i should use wtmpx?

    Unia wrote:
    Which one did you install? You have to run it before you can see the icon:
    $ gnome-power-manager
    $ xfce4-power-manager
    Add it to whatever startup script you use to have it launch at boot.
    Note: a power manager won't give you a shutdown dialog AFAIK. At least gnome-power-manager doesn't.
    ...Y'know, I really should've actually tried adding it to my xinitrc! I stupidly assumed that because running it via gmrun or a shell didn't bring up an icon, that adding it to my xinitrc wouldn't make any difference! Thanks a lot Unia
    EDIT: Okay... so I jumped the gun a bit, I tried adding gnome-power-manager and xfce4-power-manager to my xinitrc and both did nothing
    Last edited by Starfall (2011-05-26 18:18:04)

  • Systemd - kdm - xfce session: shutdown and reboot disappears randomly

    I use systemd and kdm as login manager; my desktop is XFCE.
    Immediately after login, if I click the logout button applet in the xfce panel, I can access all the options (shutdown, reboot, etc).
    But sometimes, after a while during the session, the shutdown and reboot option simply disappear - only logout works. If I log out to KDM and then again log in, they reappear.
    Does anyone have a clue about this?

    Just FYI the wikis were updated:
    Note: slim is ConsoleKit capable since version 1.3.3. Unless you happen to run an old version, you must no longer include ck-launch-session in your .xinitrc or slim.conf login_cmd. … vironments
    SLiM is also ConsoleKit capable since version 1.3.3. Unless you happen to run an old version, you must not use --with-ck-launch from your .xinitrc or slim.conf login_cmd.

  • HT5390 have a Mac mini server in the data center no physical access. Is it possible to configure a remote "console" that allows shutdown  and reboot remotely ?

    A mini mac used for building sits in the data center normally we access via VNC network connection.
    I want to have "console" access to shutdown and reboot system.
    Reason. Updated to Mountain Lion OS X from 10.7.x and lost VNC connections, now host is down with no physical access.
    Alternate is to call data center and see if someone can cycls the power ?

    As mentioned by Linc there is no 'lights out' management for the Mac mini (or any current Mac). If the Mac is still running you can initiate a reboot via the GUI or commandline. If however it is completely crashed then there is a solution you could consider which is to get a managed power distribution strip. With this the power strip has its own network connection and lets you remotely turn off (and on) individual power sockets. This would then let you 'hard reboot' the Mac mini even if crashed.
    See tab=features

  • Nano 7 auto shutdown and reboots after playing videos?

    Hello,my nano 7 is very new, and i just tried to sync videos into it today. when i tried to play them, it would automatically shutdown and reboot.Anyone know how to solve this or have similar problems?

    Okydoky a new fascinating bug has been found!
    I now relabeld all songs with no album with a "no album" tag. I thought I could handle that way the problem with the "no album bug", well I thought. Now all the songs are shown in the display but I can't play all songs through because the player hangs up. When I select just one album to play through it works fine.
    *thumbs up* great mp3 player Apple! *thumbs up*
    Windows XP Pro

  • [SOLVED]Disable Shutdown and Reboot from XFCE

    Hi all
    I would like to disable the shutdown and reboot buttons from XFCE (4.10) or to do disable shutdown/reboot systemwide.
    I searched for specific xfce instructions and all i could find was using xfconf-query[1] and afaik it can only disable hibernate and suspend buttons
    Last edited by boriscougar (2012-09-11 21:51:22)

    it had no change to remove my users from the power group
    Creating that file (/etc/xdg/xfce4/kiosk/kioskrc) and setting which users could shutdown solved the problem
    Thanks for your time

  • [SOLVED] XFCE shutdown and reboot buttons only dump out to prompt

    Recently, after an update, the XFCE shutdown and reboot buttons began not working as expected.  Both are present, and I can click them.   They seem to try to do what they should, XFCE does terminate, but I am dumped out to a shell prompt rather than the shutdown or reboot happening.   What might be a possible cause of this behaviour that I can check and correct?
    Last edited by wallenpb (2012-11-20 21:00:19)

    Are you running systemd or still a sysv/initscript setup?
    If it is the latter take into account that consolekit has been dropped. Therefore, as far as I understand it, you are not 'authenticated' and thus not allowed to either shutdown or reboot.
    Consider switching to systemd and a good start would be to comply with the 1st step of the systemd installation featured in the wiki to regain control of shutdown/reboot. Afterwards start investigating for the rest as initscripts support has ended.

  • Xfce shutdown and reboot disabled with startxfce4

    I try to fix twinview with my nvidia xorg.conf .And run over this kind of issue.
    From the beginning with xfce i only have a logout button no shutdown and reboot.(i can live with that)
    I start with startxfce4.
    In my xinitrc from wiki    exec ck-launch-session startxfce4  and i have dbus in /etc/rc.conf
    But when i start with startx instead all the buttons are there. I can live with that to .
    An explaination why startx working and startxfce4 not ?? Can it be a bug somewhere?
    Last edited by freddie (2011-02-20 10:01:23)

    lockheed  you could always shutdown like this from wiki, thats what i do. … o_Shutdown
    I have all suggestions from from this thread. And i not use any display manager.
    That was more of a surprice that i got shutdown, restart, hibernate, sleep with startx instead of startxfce4. I dont know if more xfce users can do this.
    And for me i dont need to have shutdown, restart, hibernate, sleep in the panel.More curious why startx works and startxfce4 not like i say in my first post.
    Last edited by freddie (2011-02-20 12:36:17)

  • I am using Mountain Lion on a Macbook Pro and for some stupid reason it decides to shutdown and reboot randomly. I have tried reinstalling it, thought it might be some software, so I uninstalled the software. There is no application or particulaerr task c

    Hi All.
    Mountain Lion for some stupid reason keeps shutting down and rebooting on me. It is random and not associated with any particular task or program/software. I tried reinstalling Mountain Lion but the f'n thing still keeps doing it. I am trying to write a thesis and I have lost work because of this. If I can't get this sorted I am going to go back to using Lion.
    Thanks for any help you can provide.

    I'm having the same problem at least once a day! This is the latest panic log,  any help is appreciated, thanks!
    Wed Sep 12 08:59:28 2012
    panic(cpu 0 caller 0xffffff7f8fb9ec85): NVRM[0/1:0:0]: Read Error 0x00000100: CFG 0xffffffff 0xffffffff 0xffffffff, BAR0 0xc0000000 0xffffff80aeb35000 0x0a5480a2, D0, P2/4
    Backtrace (CPU 0), Frame : Return Address
    0xffffff808afa32d0 : 0xffffff800f41d5f6
    0xffffff808afa3340 : 0xffffff7f8fb9ec85
    0xffffff808afa33d0 : 0xffffff7f8fc985b7
    0xffffff808afa3430 : 0xffffff7f8fc9862b
    0xffffff808afa34a0 : 0xffffff7f8ffad883
    0xffffff808afa35e0 : 0xffffff7f8fcbe75d
    0xffffff808afa3610 : 0xffffff7f8fba89e6
    0xffffff808afa36c0 : 0xffffff7f8fba40b8
    0xffffff808afa38b0 : 0xffffff7f8fba5b4d
    0xffffff808afa3980 : 0xffffff7f90c2043c
    0xffffff808afa39b0 : 0xffffff7f90c2073c
    0xffffff808afa39d0 : 0xffffff7f90c213ae
    0xffffff808afa39f0 : 0xffffff7f90c1d5e6
    0xffffff808afa3a20 : 0xffffff7f90bfadc0
    0xffffff808afa3a50 : 0xffffff7f90be76f3
    0xffffff808afa3aa0 : 0xffffff7f90be76ab
    0xffffff808afa3af0 : 0xffffff7f90be60f1
    0xffffff808afa3b10 : 0xffffff7f90c09f80
    0xffffff808afa3b40 : 0xffffff800f863e8b
    0xffffff808afa3bc0 : 0xffffff800f865eb3
    0xffffff808afa3c20 : 0xffffff800f8638ef
    0xffffff808afa3d70 : 0xffffff800f4981a1
    0xffffff808afa3e80 : 0xffffff800f420abd
    0xffffff808afa3eb0 : 0xffffff800f410448
    0xffffff808afa3f00 : 0xffffff800f4195fb
    0xffffff808afa3f70 : 0xffffff800f4a5ad6
    0xffffff808afa3fb0 : 0xffffff800f4ced13
          Kernel Extensions in backtrace:
   [6A699209-FB98-316B-A3C0-DCA82AA8C86B]@0xffffff7f8fb37 000->0xffffff7f8fe39fff
                dependency:[8C9E06A4-13D0-33F5-A377-9E36F0ECC229]@0xffffff 7f8faac000
                dependency:[99CA4184-8D92-31B2-8726-46139E8E3DFF]@0xff ffff7f8fb23000
                dependency:[2600903C-EEDE-321B-A023-169DC9B26EA6]@0 xffffff7f8fae0000
   [9CD95A4A-FD94-349E-A4B6-FC3B74E197F5]@0xffffff7f8 fe47000->0xffffff7f90169fff
                dependency:[6A699209-FB98-316B-A3C0-DCA82AA8C86B]@0xffffff7f8fb 37000
                dependency:[8C9E06A4-13D0-33F5-A377-9E36F0ECC229]@0xffffff 7f8faac000
   [4B9BE287-5251-398E-96B0-BB16C9BFB2D9]@0xffffff7f90bc6000 ->0xffffff7f90c88fff
                dependency:[6A699209-FB98-316B-A3C0-DCA82AA8C86B]@0xffffff7f8fb 37000
                dependency:[99CA4184-8D92-31B2-8726-46139E8E3DFF]@0xff ffff7f8fb23000
                dependency:[8C9E06A4-13D0-33F5-A377-9E36F0ECC229]@0xffffff 7f8faac000
                dependency:[2600903C-EEDE-321B-A023-169DC9B26EA6]@0 xffffff7f8fae0000
    BSD process name corresponding to current thread: firefox
    Mac OS version:
    Kernel version:
    Darwin Kernel Version 12.1.0: Tue Aug 14 13:29:55 PDT 2012; root:xnu-2050.9.2~1/RELEASE_X86_64
    Kernel UUID: 3005059E-270B-3B9F-940D-7A66C05DDC9D
    Kernel slide:     0x000000000f200000
    Kernel text base: 0xffffff800f400000
    System model name: MacBookPro6,2 (Mac-F22586C8)
    System uptime in nanoseconds: 366852391265
    last loaded kext at 182698949955:          1.8 (addr 0xffffff7f8fa16000, size 229376)
    last unloaded kext at 221779684551:          5.1.5 (addr 0xffffff7f90429000, size 65536)
    loaded kexts:          1.8          1.9.5d0          1.60          100.12.69          3.0          122          2.3.0f2          1.6.0          2.3.0f2          3.5.10          4.0.9f8          1.0.0          2.0.2d0          1.0.0          3.2.6          1.0.33          8.0.0          8.0.0          8.0.0          1.0.0d1          4.0.9f8          7.0.0          3.2.6          3.0.2d6          235.4          235.4          1.0.0d1          1.0.0d1          34          3.1.0          320.15          3.5.1          404          5.1.6          2.2.1          601.15.21          4.9.5          5.1.5          2.4.0          3.2.5b3          1.6.1          161.0.0          1.6          1.5          1.7          1.9          1.6          1.6          196.0.0          4.0.39          2          196.0.0          1.0          2.3.0f2          1.8.9fc9          1.6          4.0.9f8          2.2.5          2.3.0f2          2.3.0f2          1.0.0          5.2.0d16          1.0.10d0          1.0.4          1.0.10d0          8.0.0          8.0.0          86.0.2          10.0.6          4.0.9f8          3.2.6          2.3.4          2.3.4          3.1.3d11          235.7          3.5.1          3.5.0          5.0.0          5.1.5          5.0.0          3.5.1          1.7          1.7.1          1.7.1          2.5.0          3.5.1          5.0.0          500.15          4.5.5          2.2.0          5.1.6          1.0.2b1          3.0          1.6.1          1.8.0          1.1          220          1.0.0d1          7          344          1.8          28.18          1.6          2.7          1.4          1.0

  • [SOLVED] Poweroff and Reboot without Sudo

    How can I Poweroff and Reboot my system without using sudo?
    Last edited by aldoiljazi (2013-09-18 06:52:28)

    Stebalien wrote:
    @karol: systemd assumes that anyone with console access can shutdown/reboot the computer anyway (as they are sitting at the computer). Therefore, he should be able to issue `systemctl poweroff` etc. iff his session is setup correctly.
    What is the output of `loginctl show-session $XDG_SESSION_ID`?
    $ loginctl show-session $XDG_SESSION_ID
    Timestamp=Mon 2013-09-16 21:11:47 EEST
    Last edited by aldoiljazi (2013-09-16 19:47:04)

  • HP pavilion DV6 1030us shutdown and reboot spontaneously

    I bought a HP pavilion DV6 1030us in June 2009, and the Bios was updated to the latest version F24A.
    However, during the notebook running, it will sunddenly shutdown and restart again.
    Such unexpected shutdown just looks like loss of power suddenly, and happens randomly, at least I can not find a rule.
    For most cases, such shutdown comes  without blue screen, and it is operating system- independant.  I tried to install windows 7 64bit, windows 7 32bit, vista 64 bit, xp 32bit, all OS has such problem.
    I dont know whether other users with this model has such problem. I tired everything I can do, still can not solve the problem.
    I suspect the Bios has some problem. I hope HP will release a new one quite soon.
    btw, if I update the BIOS, will it erase the old BIOS completely first, then write into the new one?
    Thanks for all your attention!
    This question was solved.
    View Solution.

    Same issue here

  • Iphone 4s frequent shutdown and rebooting issue

    My iphone 4s goes looses network then restarts or shutdown and start heating up. Requires hardboot to make it functional again. Frequency of restart and shutdown are multiple times a day. Submitted the phone to apple support and they says there is no issue in the phone.  Please help

    did you take it to an Apple Store? Also, are you seeing any of the symptoms in this article?  Not sure where you are physically located, but I've had trouble with mine if I leave it in a hot car during the described in this article

  • Kernel Power - Event ID 41 - Task Category 63 (spontaneous improper shutdowns and reboots)

    I have been having consistent power offs/reboots lately, and im at my wits end about how to fix them.
    It always seems to happen when im playing a high end game (Guild Wars 2, Mirrors Edge, etc.). 
    I havent experienced it while just browsing or doing basic work, or while playing lower intensity games that hog less resources.
    The computer screen goes black, it reboots and i get the "windows has had an improper shutdown" kind of message.
    Usually after playing the game for an hour at the least, though its happened 2-3 hours into the game as well.
    I checked temps, and they are all normal,
    Ive also attempted updating drivers, and downgrading from any beta drivers i was using, and none of that seemed to affect it.
    I checked event viewer,
    And right before this shutdown i get the critical error "Kernel-Power" "Event ID 41" Task Category 63"
    this is the XML given to me in the details:
    - <Event xmlns="">
    - <System>
    Name="Microsoft-Windows-Kernel-Power" Guid="{331C3B3A-2005-44C2-AC5E-77220C37D6B4}" />
    SystemTime="2012-09-02T04:55:51.116009800Z" />
    ProcessID="4" ThreadID="8" />
    UserID="S-1-5-18" />
    - <EventData>
    <Data Name="BugcheckCode">0</Data>
    <Data Name="BugcheckParameter1">0x0</Data>
    <Data Name="BugcheckParameter2">0x0</Data>
    <Data Name="BugcheckParameter3">0x0</Data>
    <Data Name="BugcheckParameter4">0x0</Data>
    <Data Name="SleepInProgress">false</Data>
    <Data Name="PowerButtonTimestamp">0</Data>
    If anyone has any suggestions as to what could be going wrong, or things to check it would be greatly appreciated.
    Ive looked around at others solutions and tried whats helped others and it hasnt done much so far.
    it seems like this is a very broad problem, with no unspecific fix in most cases.

    This scenario usually indicates a problem with the hardware. Or, the driver can cause this problem. To help isolate the problem, check the following items: 
    1. Overclocking: Disable overclocking to see whether the issue occurs when the system is run at the correct speed.
    2. Check the memory: Verify the memory by using a memory checker. Verify that each memory chip is
    the same speed and that it is configured correctly in the system.
    3. Power supply: Make sure that the power supply has enough wattage to appropriately handle the
    installed devices. If you added memory, installed a newer processor, installed additional drives, or added external devices, such devices can require more energy than the current power supply can provide consistently.
    4. Overheating: Check whether the system is overheating by examining the internal temperature of
    the hardware.
    5. Defaults: Use system defaults, and run the system. 
    If you see that the computer generates a Stop error that contains a BugcheckCode value that is not reported in an event ID 41, change the restart behavior for the computer. To do this, follow these steps:
    1. Right-click My Computer, and then click Properties.
    2. Click Advanced system settings.
    3. Click the Advanced tab.
    4. In the Startup and Recovery section, click Settings.
    5. Click to clear the Automatically restart check box.
    For more information, please refer to this.
    Kim Zhou
    TechNet Community Support

Maybe you are looking for

  • MIME type settings for browser are IGNORED

    I have the following problem since Quicktime 7 Preview 2: Quicktime by default has many mime types associated which I don't want to be played by quicktime in my browser. For example .mp3 So I deselected everything but Quicktime movies in the mime typ

  • Satellite Pro A200 - need Win7 drivers & FN buttons functionality

    Hi, i have little problem with my Satellite Pro A200-29N. I installed on him win7 and now i can't find drivers (only finded ValueAddedPackage). The second are FN buttons they doesn't works :( befor i have WinVista

  • NW2004s MCOD install not detecting existing Oracle instance

    We are attempting to perform a distributed database installation for NW2004s AS-JAVA. We wish to use an existing SAP/Oracle database called "JB1" running on Oracle/HP-UX using MCOD. The JB1 database instance already contains a functioning NW2004s SAP

  • Implementing ODCIAggregate*

    I have implemented ODCIAggregate function called rsi using Java with the help of the example in the Data Cartridge. However, the query gives a 1 to 2 seconds pause for every 15 rows (exactly) returned. Everything resumes normal (no pause) for PL/SQL.

  • Expot alv into excel

    hi , i have develped one ALV report on the i made one button i want when user click that button all the data which is in alv should export into excel. please give me code for exporting this data into excel.