Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Disabale 'Turn Off' option for users

  1. #1
    Join Date
    Oct 2011
    Beans
    5

    Disabale 'Turn Off' option for users

    I'd like to deny to turn off or restart the workstation for regular users. I read many solutions but non of them the right one for me. It is an Ubuntu desktop 20.04, and the users are AD users they will use this via xrdp.
    Thank's for your help

  2. #2
    Join Date
    Oct 2006
    Beans
    56,757

    Re: Disabale 'Turn Off' option for users

    Support thread, so moved to the "General Help" forum.

  3. #3
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    15,246
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: Disabale 'Turn Off' option for users

    You could try disabling /sbin/shutdown by renaming it (as root with sudo) to something like /sbin/shutdown.disabled. You'd also have to deal with the programs /usr/sbin/halt, /usr/sbin/poweroff, and /usr/sbin/reboot. I don't know which of these programs are run when you hit the shutdown or reboot button in an Ubuntu distribution, but these seem the most likely candidates.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  4. #4
    Join Date
    Oct 2011
    Beans
    5

    Disabale 'Turn Off' option for users

    I'd like to deny to turn off or restart the workstation for regular users. I read many solutions but non of them the right one for me. It is an Ubuntu desktop 20.04, and the users are AD users they will use this via xrdp.
    Thank's for your help

  5. #5
    Join Date
    May 2013
    Location
    Galiza
    Beans
    2,393
    Distro
    Ubuntu

    Re: Disabale 'Turn Off' option for users

    Please post the solutions that aren't right for you and why in order to avoid getting replies with those solutions.

  6. #6
    Join Date
    Feb 2008
    Location
    Texas
    Beans
    28,906
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Disabale 'Turn Off' option for users

    Threads merged. Please do not post duplicates, it dilutes community effort.

  7. #7
    Join Date
    Oct 2011
    Beans
    5

    Re: Disabale 'Turn Off' option for users

    @SeijiSensei sadly it is not working I renamed shutdown, power off, halt and reboot but it didn't matter. Sorry about the post duplication.

  8. #8
    Join Date
    Jun 2019
    Location
    Dirndl-land
    Beans
    487
    Distro
    Lubuntu 20.04 Focal Fossa

    Re: Disabale 'Turn Off' option for users

    In Lubuntu/LXQt this is pretty easy, as you can remove those items (shutdown, reboot, logout etc.) from the application menu.
    I have no experience with Ubuntu/Gnome, sorry.

  9. #9
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    15,246
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: Disabale 'Turn Off' option for users

    I couldn't figure out how to edit the menus, so I suggested a more brute force approach. Apparently the GUI runs a program not among those I listed earlier (shutdown, poweroff, halt, reboot). Wonder what it could be, unless the GUI button sends the signal directly to the kernel rather than invoking one of these programs.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  10. #10
    Join Date
    Jun 2019
    Location
    Dirndl-land
    Beans
    487
    Distro
    Lubuntu 20.04 Focal Fossa

    Re: Disabale 'Turn Off' option for users

    Quote Originally Posted by SeijiSensei View Post
    I couldn't figure out how to edit the menus, so I suggested a more brute force approach. Apparently the GUI runs a program not among those I listed earlier (shutdown, poweroff, halt, reboot). Wonder what it could be, unless the GUI button sends the signal directly to the kernel rather than invoking one of these programs.
    My suggestion is just about hiding the menu items in the Application Menu. It's in no way bullet-proof, I'm sure a smart user could get around this, eg, using Ctrl+Alt+T. And I've only done this in Lubuntu/LXQt.

    In LXQt, there's no menu file as such, every menu item is a file. The Application Menu is built from collecting these files during login.

    The menu item files can be found under:
    Code:
    /usr/share/applications
    (for the admin user)

    or:
    Code:
    ~/.local/share/applications
    (for a normal user)

    For each menu item you want to suppress, use a text editor and add the following line anywhere in the file:
    Code:
    NoDisplay=true
    Repeat until the Applications Menu contains only the items you want.

    You'll need to this with sudo permissions, of course. And you need to logout/login before the changes take effect.

    Whether this will work under Gnome? I don't know.



    EDIT: according to this, it should work in Gnome as well: https://developer.gnome.org/integrat...-files.html.en
    Last edited by ml9104; June 10th, 2020 at 10:11 PM.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •