I've a group of Ubuntu Trusty desktop PCs in my office, and usually I ssh to them and install updates remotely from the command line. Unfortunately, sometimes local users decide to shutdown those PCs, breaking the update process.
I'd like to prevent those users to shutdown, reboot or suspend their PCs when there's an SSH session active. How can I do it?
I've tried molly-guard
, but doesn't prevent GUI users from shutting down the system (it doesn't seem to affect GUI users).
I've seen also this question, but didn't understand if it's applicable also to Ubuntu 14.04 LTS or not (and I'm not sure how to apply it):
disable shutdown/suspend if there is other user logged in via ssh
sudo shutdown
? – muru Jan 07 '15 at 15:56no
, if you useauth_admin
, do you get a password prompt? – muru Jan 07 '15 at 16:12auth_admin
nothing warns my privileged user about other users connected neither asks for a password. Only regular users get a warning and a prompt for an administrative password to continue. – gerlos Jan 07 '15 at 16:33sudo reboot
, even withmolly-guard
installed (not sure if this is intended or not, molly-guard works fine when trying to reboot from ssh sessions). – gerlos Jan 07 '15 at 16:37/etc/polkit-1/localauthority/50-local.d/restrict-shutdown.pkla
are exactly what you have there, logged in via SSH, can still shut down via LightDM. Are there permissions I need to set on this file, or packages I need to install? – detly May 24 '15 at 05:54