[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
Id=1
Timestamp=Mon 2013-09-16 21:11:47 EEST
TimestampMonotonic=13019390
DefaultControlGroup=systemd:/user/1000.user/1.session
VTNr=1
TTY=tty1
Remote=no
Service=login
Leader=130
Audit=1
Type=tty
Class=user
Active=yes
State=active
KillProcesses=no
IdleHint=yes
IdleSinceHint=1379355104466900
IdleSinceHintMonotonic=10330073
Name=aldo
mine.
Last edited by aldoiljazi (2013-09-16 19:47:04)

Similar Messages

  • 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)

  • [SOLVED]Poweroff, shutdown, reboot, ctrl+fx make desktop reboot

    Hi,
    I experiencing some strange issue with my new computer.
    This is some part:
    Gigabyte GeForce GTX 770 (Graphics card)
    Gigabyte GA-H81-D3 ATX (Motherboard)
    Intel Core i5 I5-4460 (proc)
    My screen is connect to HDMI with the gtx
    My laptop work really fine without any issue with bumblebee and other stuff.
    But on the desktop, if I press
    Ctrl+f1 or f2 or f whatever, my screen stop(no input signal) and the desktop reboot and my screen never come back the LCD say no input signal
    Same think if I do a terminal, shutdown, reboot or poweroff.
    When the desktop reboot I listen the bip for motherboard but the LCD always say no input, and my usb keyboard and mouse don't respond (press Num. Lock de nothing).
    I have only one choice is to press the reset button from my case.
    I don't know what append.
    this is a fresh dmesg:
    http://pastebin.com/vmsK9nzz
    this is after a forced reboot, look the same:
    http://pastebin.com/ZKCQeykK
    I try to blacklist uvesafb and vesafb in modprob but the NVRM message stay.
    I boot with uefi.
    there is Xorg.0.log: http://pastebin.com/wkMfHcg4
    the Xorg.0.log.old: http://pastebin.com/gSu2GCTR
    And my journaltl from fresh to a reboot:
    http://pastebin.com/UpPpLL0h
    What do the mess in this desktop?
    I try to find some clue but nothing for now.
    Thanks
    Last edited by Badrocklo (2014-08-08 10:02:22)

    The title has a max char limit, that's why it's appearing to be read only. You'll have to shorten your title to squeeze in the [solved] part. Sometimes I really wish the arch bbs had some more features like labels or polls.
    edit: I see you figured it out
    Last edited by Soukyuu (2014-08-08 10:06:57)

  • Firefox will not boot up. Says "this is embarrassing..." but won't restore or close due to not responding ever. Updated and reboot no help. Cant access options.

    Stopped responding. Updated and rebooted without success. Can not get to "options" due to no response. Keeps getting "This is embarrassing..." but restore or close button ends up making browser non responsive. Closed with Task Mgr also. Can not get to safe mode.
    bp-20b2f065-d592-4b67-8020-7714a2130305

    Certain Firefox problems can be solved by performing a ''Clean reinstall''. This means you remove Firefox program files and then reinstall Firefox. Please follow these steps:
    '''Note:''' You might want to print these steps or view them in another browser.
    #Download the latest Desktop version of Firefox from http://www.mozilla.org and save the setup file to your computer.
    #After the download finishes, close all Firefox windows (click Exit from the Firefox or File menu).
    #Delete the Firefox installation folder, which is located in one of these locations, by default:
    #*'''Windows:'''
    #**C:\Program Files\Mozilla Firefox
    #**C:\Program Files (x86)\Mozilla Firefox
    #*'''Mac:''' Delete Firefox from the Applications folder.
    #*'''Linux:''' If you installed Firefox with the distro-based package manager, you should use the same way to uninstall it - see [[Installing Firefox on Linux]]. If you downloaded and installed the binary package from the [http://www.mozilla.org/firefox#desktop Firefox download page], simply remove the folder ''firefox'' in your home directory.
    #Now, go ahead and reinstall Firefox:
    ##Double-click the downloaded installation file and go through the steps of the installation wizard.
    ##Once the wizard is finished, choose to directly open Firefox after clicking the Finish button.
    Please report back to see if this helped you!

  • OSX reboots without permission on update install

    OS X 10.9.1 (13B42)
    Is there a setting in Mavericks to tell it not to install updates and reboot without permission?
    For many years, one of the reasons I liked Macs was that my Windows PC would often reboot overnight because Microsoft would decide it was a good idea to put out an update, losing me data in the process. That never happened with my Mac.
    Now my Mac does the same thing. Last night there was an update to parts of the system I simply don't use (mostly Mail) and apps were forcibly shut down. My specific beef is that Chrome incongnito tabs can't be restored once closed, and I had a dozen or so open doing various things.
    To cap it all, my Windows PC now asks for permission and gets rebooted once every couple of months.
    Is there a setting in Mavericks to tell it not to do this? (Naturally, I Googled it, but nada...)

    I managed to boot into safe mode (by holding shift), but what should I do now?

  • Lumia 620 randomly freezes and reboots

    I knew a cheap windows phone is too good to be true. I've been getting random freezes and reboots without any reason at all. This is unacceptable, nokia should address this windows 8 issue afflicting wp 8 phones. Please don't tell be to do a soft or hard reset because we already know it won't fix the problem.

    Hi, everyone. I've been having problems with random reboots ever since I bought my Lumia 620 and it was driving me crazy. It freezes up sporadically too, but I think I found a fix for rebooting issues.
    When my cousin bought her Lumia 620 I immediately asked her if hers rebooted sporadically as well. She said it hadn't, not once. Then, one time her battery was dying so I gave her mine, and she left me with her battery and on charger while she went home. Anyway, hers started to reboot frequently, whilst mine was behaving ok.
    When we replaced the batteries again, mine began rebooting again.
    Finally, I checked both our batteries and found out mine was moving around the device more freely than hers. Hers was held firmly in place while mine danced around. Then I tried moderate, yet gentle tap on the side of my device and it rebooted EVERY TIME I tapped it. After I inserted a small, neatly folded piece of paper between the device and the battery, the battery clicked in place tightly and it couldn't move at all. Reboots stopped, no matter how strong I tapped the sides of the device.
    This hasn't resolved any freezes, but at least it's not rebooting all the time. So check your battery, maybe it is a hairline thinner or smaller or whatnot from the rest of them and it can move around. A millisecond is enough for it to lose contact, half a millimeter of movement is enough to cause your phone to reboot. Hope this revelation of mine will help someone

  • [SOLVED]hddtemp without sudo

    Hello!
    Is there anyway of getting hddtemp to work without having to key in the password? I have tried adding
    shylock ALL = NOPASSWD: /usr/sbin/hddtemp
    Also tried:
    %hwmon ALL = NOPASSWD: /usr/sbin/hddtemp
    What I'm trying to do is making an alias like I did with gpu temp
    alias gpu?='nvclock -i | grep temp'
    For Hddtemp as well. Now my only option left is to echo my password and feed it to sudo, which is not a good idea I think. Any help?
    Last edited by sHyLoCk (2009-06-28 02:50:47)

    Thanks for all your replies. Ok I managed to start it ith another reboot after reinstalling netcat.
    nc localhost 7634 shows me :
    |/dev/sda|???|ERR|*
    Yes it's /dev/sda, I'm getting temperature by using sudo hddtemp /dev/sda
    When I try without sudo it says /dev/sda open: Permission Denied.
    Here's mount output:
    $ mount
    /dev/sda5 on / type ext4 (rw)
    none on /dev type ramfs (rw,relatime)
    none on /proc type proc (rw,relatime)
    none on /sys type sysfs (rw,relatime)
    none on /dev/pts type devpts (rw)
    none on /dev/shm type tmpfs (rw)
    /dev/sda1 on /windows type fuseblk (rw,allow_other,blksize=4096)
    /dev/sda6 on /home type ext4 (rw)
    gvfs-fuse-daemon on /home/shylock/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=shylock)
    /dev/sdb3 on /media/Videos type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
    /dev/sdb5 on /media/Misc type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
    /dev/sdb4 on /media/zer0 type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
    /dev/sdb1 on /media/Music type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
    EDIT:  Ok I dont know what happened now i cant even use sudo?
    $ sudo hddtemp /dev/sda
    /dev/sda: Permission denied
    Last edited by sHyLoCk (2009-06-28 01:56:00)

  • AirPort Extreme extends my network and has worked well for three months. Now it can no longer extend the network and flashes Amber. I have restored to factory settings moved it closer to time capsule and rebooted the system without luck

    i have a blinking Amber on my extreme now and it cannot extend the network.  It was working fine and nothing has changed. I have restored to factory settings moved it to another room and rebooted the system without luck. Any suggestions

    What OS are you running?
    Please give me a screenshot of the current AE setup..
    I strongly recommend if you have issues.. take control of all the variables. Apple routers have too much auto..
    Here is a list that I use for setups when using Yosemite.. but it relates to any OS.
    You will need to factory reset again to get going.
    Factory reset universal
    Power off the AE.. ie pull the power cord or power off at the wall.. wait 10sec.. hold in the reset button.. be gentle.. power on again still holding in reset.. and keep holding it in for another 10sec. You may need some help as it is hard to both hold in reset and apply power. It will show success by rapidly blinking the front led. Release the reset.. and wait a couple of min for the AE to reset and come back with factory settings. If the front LED doesn’t blink rapidly you missed it and simply try again. The reset is fairly fragile in these.. press it so you feel it just click and no more.. I have seen people bend the lever or even break it. I use a toothpick as tool.
    Then redo the setup from the computer with Yosemite or whatever you are using.
    1. Use very short names.. NOT APPLE RECOMMENDED names. No spaces and pure alphanumerics.
    eg AEgen5 for basestation.
    Use AE24ghz and AE5ghz for wireless on each band, with fixed channels as this also seems to help stop the nonsense.
    2. Use all passwords that also comply but can be a bit longer. ie 8-20 characters mixed case and numbers.. no non-alphanumerics.
    3. Ensure the AE always takes the same IP address.. this is not a problem for router but if the AE is bridged you can have trouble.. Try using the static IP method or control it via the main router dhcp reservations.
    4. Check your share name on the computer/s is not changing.. make sure it also complies with the above.. short no spaces and pure alphanumeric..
    5. Make sure IPv6 is set to link-local only in the computer. For example wireless open the network preferences, wireless and advanced / TCP/IP.. and fix the IPv6. to link-local only.
    6. Set up the extend to the Express using 2.4ghz and then see how good or bad the connection is.. this is better in the old v5 utility but if you hover your mouse over where it shows connection an extra chunk of info comes up.
    I have specifically used 5ghz to make the extend.. because by testing it works better.. but do not be fooled.. this good connection is poor.. the RSSI.. which is difference signal .. at -79dbm is down the bottom of the stable.. and it drops out on a daily basis.. you want to see that signal around -60dbm at min.
    There is a lot more jiggery pokery you can try but the above is a good start.. if you find it still unreliable.. don't be surprised.

  • 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: http://forum.xfce.org/viewtopic.php?pid=21331 and is very similar to what's in the Arch Wiki, https://wiki.archlinux.org/index.php/Al … 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.

  • Please help me. My YouTube app will not work. Every time I open it says 'cannot connect to youtube'. I have searched for help and tried resetting my settings and rebooting my ipad2 but nothing has solved the issue.

    Please help me. My YouTube app will not work. Every time I open it says 'cannot connect to youtube'. I have searched for help and tried resetting my settings and rebooting my ipad2 but nothing has solved the issue.

    Yes, I am connected to the Internet through my wifi. Everything is working fine with the e  eption of youtube.  I have reset all Internet settings and have tried synching to iTunes followed by rebooting.  This is all the advice I have found although none of it has been helpful.
    Has anyone else encountered this problem?

  • "I did fresh restore, reset all setting and reboot the issue still there. I hope Apple don't forget us to solve this issue soon

    "I did fresh restore, reset all setting and reboot the issue still there. I hope Apple don't forget us to solve this issue soon

    Oh I've found it meanwhile! The is a 2nd post! So never mind this one! I think lawyerhusain understood he has to let Apple know, if he wants them to know and the technical thing will continue with the 2nd post!

  • Shutting down and rebooting from xfce4 (SOLVED)

    I am wanting to shut down and reboot my system via xfce4. right now the two buttons are grayed out. I tried added myself to the power group by doing
    gpasswd -a username power
    That didn't seem to do anything at all. On the wiki, it talks about using dbus and hal (as an alternative to doing the sudo method) but i already have dbus and hal started by default and the two buttons are still grayed out.
    if there is already a message like this please guide me there. Any help would be appreciated.
    CORRECTION: adding myself to the "power" group did work.
    Last edited by theringmaster (2007-09-12 17:49:24)

    zenlord wrote:
    Strange - I used the sudo-hack and it worked for me. But after it stopped working, I saw the new instructions and enabled both hal and dbus and voila, everything worked.
    I did not add myself to the sys-group, so it should be something else. Did you install the whole xfce4-package or did you select certain packages? check if '# /etc/rc.d/hal restart' and '# /etc/rc.d/dbus restart' change anything...
    Zl.
    Fyi: i installed xfce4 and xfce4-goodies. I'll try your codes now.

  • [SOLVED] Run script on systemd shutdown and reboot

    Hello!
    I am trying to log uptime on shutdown and reboot with no success.
    I create the file /usr/lib/systemd/system/uptime.service:
    [Unit]
    Description=/etc/rc.local.shutdown Compatibility
    ConditionFileIsExecutable=/etc/rc.local.shutdown
    DefaultDependencies=no
    After=rc-local.service basic.target
    Before=shutdown.target
    [Service]
    Type=oneshot
    ExecStart=/etc/rc.local.shutdown
    StandardInput=tty
    RemainAfterExit=yes
    [Install]
    WantedBy=shutdown.target
    /etc/rc.local.shutdown:
    [jribeiro@arkosta ~]$ ls -l /etc/rc.local.shutdown
    -rwxr-xr-x 1 root root 107 Out 24 12:42 /etc/rc.local.shutdown
    [jribeiro@arkosta ~]$ 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:
    [jribeiro@arkosta ~]$ cat /usr/lib/systemd/system/uptime.service
    [Unit]
    Description=/etc/rc.local.shutdown Compatibility
    Before=shutdown.target
    [Service]
    ExecStart=/bin/true
    ExecStop=/etc/rc.local.shutdown
    RemainAfterExit=yes
    [Install]
    WantedBy=shutdown.target
    Then I started the uptime service manually:
    [jribeiro@arkosta ~]$ sudo systemctl start uptime
    I checked the 'registo_de_uptime' file:
    [jribeiro@arkosta ~]$ 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:
    [jribeiro@arkosta ~]$ 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:
    [jribeiro@arkosta ~]$ 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:
    [jribeiro@arkosta ~]$ 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:
    [jribeiro@arkosta ~]$ 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)

  • [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
    [1]http://forum.xfce.org/viewtopic.php?id=4781
    Last edited by boriscougar (2012-09-11 21:51:22)

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

  • [SOLVED]Keyboard and touchpad doesn't work after reboot from Arch

    Excuse me, but i'm a newbie. I'm not sure if this is an arch problem, but i will just post it here.
    I've beening using Arch64 and it works just fine. However, every time i reboot from arch into Windows 7 (32bit), the keyboard and touchpad will stop responding just when the Win7 splash screen shows, however the mouse works fine. Then when you shutdown the computer (from win7 now) it will take apparently longer time, and sometimes i have to press the power key 5 seconds to make it shutdown.
    It seems the correct way (to reboot from arch to win7) is to shutdown down the computer first and start it again, and everything will work fine.
    And rebooting from win7 to win7 or arch to arch or win7 to arch will work fine too.
    I'm glad to post extra information, but I've got no clue and i'm not sure what to put here.
    The laptop is a Lenovo Y450 with Intel Core Dual P7540, 4G Memory, NV GT240M. Kernel version of Arch is 3.0.6 (but the problem existed long since earlier versions) I don't have a swap partition. If you need extra information, please mention the item.
    Thanks a lot!
    Last edited by crlf0710 (2011-11-15 10:29:38)

    Hi!
    That is indeed strange. Since your external mouse works fine (which probably is connected via USB, right?) it appears that the problem lies somewhere around the internal keyboard/touchpad access. I'm not sure how this works with a Lenovo Y450, but just try to enter BIOS (in case you have not been there, you probably have to hit F1 or F2 during startup - less likely it would be delete or escape ...) and look for your keyboard/touchpad options.
    You should probably find something like "... legacy support ...". This is a relic from PS/2 times and emulates your internal input devices as PS/2 devices. So - when found, just change the setting (you cannot mess anything up, and both systems will probably not even pop up a message). My guess is it is set to "enabled" and Arch somehow messes with the PS/2 emulation in your case .... so just turn it off.
    good luck

Maybe you are looking for