Skip to main content

disabling suspend/hibernate/shutdown for all users but root

my situation:

we have a screen along with a keyboard and mouse in a scrum room at work. the computer is in a locked rack closet on the other end of the floor. i do not have direct access to this room. this computer serves as a portal for internet access and conference calling. i installed fedora linux on the system.

because of the remoteness about it, the keyboard was one that had a power button on it. occasionally, it would get bumped and shutdown the system. this meant we had to find someone to unlock the door to physically power the computer back up. we were successful in disabling the power button on the keyboard, but we still had a problem with being able to shutdown the machine from the gnome interface.

my solution:

i probed in #fedora on freenode and was pointed to using a policykit policy to limit suspend/hibernate/shutdown access to root only. the first link i found was this one:

http://superuser.com/questions/453002/how-to-achieve-users-are-no-longer-allowed-to-shutdown-the-computer-in-gnome-3

the syntax for the first response was for an older version of policykit. a little further investigation led me to this link:

https://bbs.archlinux.org/viewtopic.php?pid=1274130

the reference in the last post indicated this file has the control i needed:

/usr/share/polkit-1/actions/org.freedesktop.login1.policy

using the values in the first link, i plugged them into that policy file and was able to get it working.

i didn’t adjust the media seating or flushing, but all the power controls were set for allow_any to be “auth_admin,” and the allow_active and allow_inactive to “no.”





Comments

Popular posts from this blog

reliable routers?

these are the horror stories you only hear about in other blogs but your own.

i have an asus rt-ac87u router which i have been mostly happy with for over a year now. middle to late last year, the firmware update on the router caused it to just drop the internet connection randomly. not the whole network or a restart, but just the connection to my internet modem.
last night (or early this morning, rather), i woke up for other reasons, but i watched as i was browsing on my phone the network switch from my 5GHz network to LTE. ugh! but i'll deal with it in the morning. 
i woke up and started a few things around the house. i rebooted the router to find no restoration of that band. (the 2.4GHz band was fine.) i didn't have time to deal with it then, so i set aside for when i got home. i was thinking it was the radio for 5GHz.
and upon entering my house, i started the effort to replace the router with a backup device of exactly the same make and model. needless to say, the results w…

bad routers continued

after last night's rant which included a few frustrated posts on twitter, i received a reply from linksys's support account, @linksyscares. i responded with some information but never really heard back from them.
in the course of my checking, i realized that v1 firmware on my v2 wrt-1900acs router. i had never used a file to flash the firmware. i opted for the automatic stuff. so, this v1 firmware was on it out of the box. hope, maybe!
i got home, downloaded the v2 firmware, and did the hard reset on the router to dump the dd-wrt. i got the firmware installed after a little bit of wrestling and proceeded to start the configuration. this is where things got bad again.
the wrt-1900acs with the right firmware continued it pattern of restarting every few minutes. i never actually got the setup completed because the restarts would stymie my attempts to adjust any settings. after spending yet another hour of this repeated madness, i shut down the linksys, powered up the asus, and wi…

south africa: seaview

don’t let the name fool you. although it was set with a great view of the ocean, this park housed big cats and other animals. but before i mention them, duncan and family and i found a reptile and raptor rescue at the place we stayed overnight after visiting addo.



duncan’s girls were considering getting a snake, and he thought this might be a good trial run to see if they would really enjoy having such a pet. we saw some rather interesting snakes (especially the black mamba), a few of which i was glad to have run across in a controlled environment rather than randomly in the wild. interestingly, they had some snakes local to my home town in the states too (copperhead, rattlesnake, and cottonmouth). some interesting birds including the large falcon were also part of the tour. (see how big this bird is.)

after leaving the rescue, we headed to the other side of port elizabeth to visit seaview. it was here that we were able to get very close to the lions. we arrived just in time to see t…