my user account can't restart, shutdown or suspend
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
my user account can't restart, shutdown or suspend
After years of my old desktop computer being unable to suspend to RAM or disk, it was a pleasant surprise to find that my Linux system could do it on this laptop. However, there seems to be a problem initiating suspend within my user account, in the new installation I just made. It's not a problem with the suspend software (e.g. something missing), because I checked the root account and found it's able to suspend; so I think the problem is my user account doesn't have access to suspend. (I also noticed that it currently doesn't have access to restart or shut down, only to log out, further proving this has nothing to do with suspend but is a bigger problem. What do I probably need to change?
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,673
Rep:
I'd have thought that most user accounts don't have the ability to shutdown, reboot or suspend a system. Just imagine what could happen if a Linux system with 100 users had one of them reboot the system at some inopportune moment. The ability to change a machine's run state should always be limited to root. Linux wasn't designed as a one-person OS, it's multiuser.
Would be interesting to know something about your system, like:
- Which distribution in which version?
- How are you trying to suspend, on CLI or from within a DE? If DE, which one? If CLI, which error messages do you get?
I'd have thought that most user accounts don't have the ability to shutdown, reboot or suspend a system. Just imagine what could happen if a Linux system with 100 users had one of them reboot the system at some inopportune moment. The ability to change a machine's run state should always be limited to root. Linux wasn't designed as a one-person OS, it's multiuser.
my
Play Bonny!
Well, until now I've always been able to shut down from my user account. That's probably because the system knew it didn't have one hundred users. Itt always had only one user--me.
Quote:
Originally Posted by TobiSGD
Would be interesting to know something about your system, like:
- Which distribution in which version?
- How are you trying to suspend, on CLI or from within a DE? If DE, which one? If CLI, which error messages do you get?
I'm running antiX 13, with XFCE, trying to suspend through the battery monitor (by right-clicking the icon in the taskbar). I should try to suspend in a terminal and see what it says.
My stock AntiX 11 Base Sid Install /etc/sudoers file that allows
Quote:
Well, until now I've always been able to shut down from my user account.
I can reboot also. Suspend is not a issue because this is a Desktop computer.
From the sounds of it. You have a XFCE battery monitor issue though.
Code:
# cat /etc/sudoers
# sudoers file.
#
# This file MUST be edited with the "visudo" command as root.
#
# See the man page for details on how to write a sudoers file.
#
# Host alias specification
# User alias specification
# Cmnd alias specification
Defaults env_reset
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# User privilege specification
root ALL=(ALL) ALL
%users ALL=(root) NOPASSWD: /sbin/halt
%users ALL=(root) NOPASSWD: /sbin/reboot
%users ALL= /usr/sbin/pppoeconf
%users ALL=(root) NOPASSWD: /sbin/fdisk
##%users ALL=(root) NOPASSWD: /usr/bin/rox
My Wife is running Xfce (well, she really has no clue whet she is running and I keep her box updated over SSH). However, the X start string in her box is ck-launch-session startxfce4, she has the right to suspend and reboot and shut down.
I had somewhat similar problems with xfce4-power-manager (I assume that is what you mean with battery monitor) a few days ago, the power manager couldn't suspend the system on idle, telling me that it is not authorized to do so. The culprit was that newer versions of my login manager (I use SLiM, but others do that also now) automatically start a consolekit session at login, but my xinitrc also contained a ck-launch command, so that I ended up with two sessions. The power manager simply tried to acces the wrong session. You may want to have a look into that. You may also get more info what is going on with starting xfce4-power-manager from the commandline with the --debug option. The --dump option also gives you an overview of the permissions and capabilities.
About the right to shut down when not root: I didn't mention beforehand that I own this computer and the only two user accounts are both mine; but perhaps you could have assumed I wasn't an idiot who thought it was acceptable for one regular user to shut down the computers of many other users.
I have come to expect this attitude every time I post on LQ, and consequently have become more reluctant to post, usually preferring to figure out my own Linux issues or (more often) let them go. Oh, well, at least the person who posted that wasn't rude about it.
Last edited by newbiesforever; 05-29-2014 at 08:36 PM.
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,673
Rep:
I "assume" Post #10 is aimed at me, though I usually find assumptions I make are invariably wrong as in this case.
Quote:
but perhaps you could have assumed I wasn't an idiot who thought it was acceptable for one regular user to shut down the computers of many other users.
My assumption was that all Linux/Unix operating systems didn't allow operations such as shutdown, restart, hibernate, etc to be the preserve of root, not user. My experience has been that I have always had to elevate to root privilege to carry out these commands in whatever *nix operating system I have been using. So you see, I've learned something.
If my post offended you I can only apologise, had I read your original one properly I would have noticed the "Beware of the Dog" message in your signature.
Quote:
The one thing you may not ask Linux users about, especially more experienced ones, is using root.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.