How to enable password request for restart and shutdown?

Hi,
I'm neither a Linux nor an Arch Linux newbie, but inexperienced regarding this particular issue.
I want to enable password request for restart and shutdown and want to know if I'm mistaken, because trial and error might become to time-consuming while working on a project.
I read https://wiki.archlinux.org/index.php/Al … o_shutdown.
$ ls -hAl /usr/bin/shutdown
lrwxrwxrwx 1 root root 9 Apr 22 03:02 /usr/bin/shutdown -> systemctl
If I try to run $ shutdown -hP 28 or $ shutdown -c nothings happens, I need to run $ sudo shutdown -hP 28 and $ sudo shutdown -c and type a password. That's the way I want it.
If I e.g. run $ shutdown -r now no password is needed. I want to disable this. It should behave the same way as shutdown -hP/-c behave. I want to type
$ sudo shutdown -r now or $ sudo systemctl reboot etc. and then the password should be required.
$ sudo grep -vn "#" /etc/sudoers | grep [[:blank:]]
72:root ALL=(ALL) ALL
73:rocketmouse ALL=(ALL) ALL
The user "rocketmouse" should have all permissions after typing a password, but not without typing the password.
IIUC what's written at https://wiki.archlinux.org/index.php/Polkit, I need to edit
$ pkaction | grep login
org.freedesktop.accounts.set-login-option
org.freedesktop.login1.attach-device
org.freedesktop.login1.flush-devices
org.freedesktop.login1.hibernate
org.freedesktop.login1.hibernate-ignore-inhibit
org.freedesktop.login1.hibernate-multiple-sessions
org.freedesktop.login1.inhibit-block-idle
org.freedesktop.login1.inhibit-block-shutdown
org.freedesktop.login1.inhibit-block-sleep
org.freedesktop.login1.inhibit-delay-shutdown
org.freedesktop.login1.inhibit-delay-sleep
org.freedesktop.login1.inhibit-handle-hibernate-key
org.freedesktop.login1.inhibit-handle-lid-switch
org.freedesktop.login1.inhibit-handle-power-key
org.freedesktop.login1.inhibit-handle-suspend-key
org.freedesktop.login1.power-off
org.freedesktop.login1.power-off-ignore-inhibit
org.freedesktop.login1.power-off-multiple-sessions
org.freedesktop.login1.reboot
org.freedesktop.login1.reboot-ignore-inhibit
org.freedesktop.login1.reboot-multiple-sessions
org.freedesktop.login1.set-user-linger
org.freedesktop.login1.suspend
org.freedesktop.login1.suspend-ignore-inhibit
org.freedesktop.login1.suspend-multiple-sessions
org.freedesktop.machine1.login
IOW I need to replace every yes and no etc. with auth_admin in $ grep -v lang /usr/share/polkit-1/actions/org.freedesktop.login1.policy.
Am I mistaken?
Regards,
Ralf

You'll need to create a rules file which uses javascript.
https://wiki.archlinux.org/index.php/Po … tion_rules
// /etc/polkit-1/rules.d/10-admin-shutdown-reboot.rules
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.login1.power-off" ||
action.id == "org.freedesktop.login1.power-off-ignore-inhibit" ||
/*...SOME_MORE_IDS_HERE...*/
// return polkit.Result.AUTH_ADMIN_KEEP;
return polkit.Result.AUTH_SELF_KEEP;
Last edited by progandy (2015-06-21 17:42:35)

Similar Messages

  • All of a sudden TWO choices for Restart and Shutdown and other issues...

    I noticed today that there are now TWO choices in the menu for Restarting and Shutting down for my iMac.
    "Restart...
    Restart
    Shutdown...
    Shutdown"
    Nothing new has been installed.
    Also, now there is a black rectangular outline around anthything that is "selected" on the desktop or in a menu.
    My mac mini has also started to act weird all of a sudden. Watching Netflix today, the entire display get s horizontal colored lines and the computer freezes. I have to hold the power switch to turn it off. When trying again, it does the same thing after a few minutes.
    Any ideas?
    Any help would be appreciated.
    Message was edited by: ihans

    The imac problems have been solved.
    The Voice Over Function in the preferences was turned on somehow. This caused the duplicate restart and shutdown issue, and the black box around highlighted items.
    Now If I can figure out the Mac Mini issue. I hope it's not dying on me...
    Message was edited by: ihans

  • Password Requests for Safari and Entourage

    I've been through several forums this week trying to resolve iMac challenges. After all of those fixes were incorporated or tried, I now see dialogue boxes in Safari asking for my keychain password as well as in Entourage. Do I need to change a setting someplace, or is this just to be expected from now on?

    OK; too simply stated. I did find pop.charter.net as an Internet password. I clicked on the "i" and another window with two selections appeared: Attributes//Access Control. When I select Access Control, the new window shows only one button clicked that says, "*Confirm before allowing access*." The sub-level button, saying "Ask for keychain password," is not clicked. Nor is the upper level button, saying "Allow all applications to access this item." In the lower window it says, "Always allow access by...Entourage...." What should I do about this? Do I need to change it, delete it or just punt?

  • Keyboard short-cut for Restart and Shutdown?

    Since recent keyboards and Mac OS X doesnt have keyboard short-cuts for Shutdown and Restart, is it possible to create new ones for these functions?
    Also, why doesnt Mac OS X have these anymore (such as when it had the keyboard with that button you hit to bring up dialog box to shutdown, restart, etc).. that's what I'm looking for...
    As for the reason I want this.. sometimes my display goes blank and I can't see anything and hence since you cant see the screen to mouse over to restart, etc... if I could hit a keyboard combo to bring up the restart dialog box and I then hit Enter, it would execute that action...

    The Shutdown and Restart shortcuts are here
    <http://docs.info.apple.com/article.html?artnum=106567>
    Most shortcuts are here
    <http://docs.info.apple.com/article.html?artnum=75459> with more links at the bottom of the page.

  • How to unlock the request for a report and add the same query to new reques

    hi,
         how to unlock the request for a  and add the same query to new reques

    You can unlock in SE03 tcode.
    Goto tcode SE01, give the transport number --> display --> double click on the transport --> in the next screen select all the elements --> delete --> save.
    To attach it to another transport, In RSA1, click on transport connection> Choose Object types> query elements --> here you can find your query/ or you can search, which you can drag to right and attach to the transport (using truck button).

  • How to enable diagnostics in cloud services and virtual machine

    Hi All,
    I need to enable diagnostics  for cloud services and virtual machine in our
    cloud environment. I referred the below link.
    https://convective.wordpress.com/2014/06/27/using-azure-monitoring-services-api-with-azure-cloud-services/
    Installed azure SDK 2.5 and cloud services instance is not displayed for cloud services in Visual studio 2013. Please provide the steps to enable at run time. 
    1) How to enable this diagnostics at run time.
    2) How to enable event logs for cloud and Virtual machine
    3) How to get the event log data's from REST API.
    Please help to resolve this.
    Thanks.
    Regards,
    Rathidevi

    hi Rathidevi,
    In addition, you could enable diagnostics feature on VM from this blog:
    http://azure.microsoft.com/blog/2014/09/02/windows-azure-virtual-machine-monitoring-with-wad-extension/
    Please refer to it.
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to Enable password saving in SAP Logon for Windows

    how to Enable password saving in SAP Logon for Windows

    Even though password saving, in SAP Logon for Windows is disabled by default, this can be enabled following the steps listed below:
        Open the command prompt by navigating to Start → Run and by typing “cmd”.
        Go to the \SAP\FrontEnd\SAPgui directory (in Program Files), through the command prompt.
        Create the necessary value in Windows registry by typing: sapshcut -register An information message will appear.
        Open the registry editor, in order to access Windows registry, by navigating to Start → Run and by typing “regedit”.
        Go to the HKEY_CURRENT_USER\Software\SAP\SAPShortcut\Security registry key.
        Change the value data of “EnablePassword“ from 0 to 1.
        Close SAP Logon and open it again, in case it was open during the whole process.

  • I have an Ipad My apple ID and password works for Ibooks and Icloud but when I try to get into the app store it doesn't show my entire email address on the account. When I try to get into the app store it tells me my password is incorrect.  How can I corr

    I have an Ipad My apple ID and password works for Ibooks and Icloud but when I try to get into the app store it doesn't show my entire email address on the account. When I try to get into the app store it tells me my password is incorrect.  How can I correct this? I have been emailing support but so far they have been no help

    Open the App Store app, go to the Featured pane, swipe to the bottom, tap the Apple ID and sign out. Tap again and sign in with the Apple ID of your choosing.

  • I have a report with 2 queries and prompts on same object tell me how many times it request for I/P?

    Hi
    i have a report with 2 queries and prompts on same object tell me how many times it request for I/P? can any one please guide me.
    Regards,
    Mahendra

    Is this question related to Dashboards or webi ?

  • TS4006 how can i cancel request for erasing iPhone?? i pressed erase an iphone instead of lost mode or display message =( i want to cancel this operation

    how can i cancel request for erasing iPhone?? i pressed erase an iphone instead of lost mode or display message =( i want to cancel this operation
    my lost iphone is still offline and erasing not started yet and i want to cancel this request!

    You can't, but after the erasure the activation lock will still be in place, so the device will be useless for anyone not knowing your apple-id and password.

  • How to enable remote debugging for a session other than the current one

    Hi all,
    I am trying to figure out how to enable remote debugging for a session other than the one I am currently using.
    More specifically, we have an application that is making database calls to Oracle 11gR2. Something is causing an exception during this invocation. My system is currently not set up to recompile said application, so I can't just add the debug call to the code and recompile. Therefore I would like to be able to log into the database (as sys, if necessary) and invoke dbms_debug_jdwp.connect_tcp on the desired session.
    The docs indicate that I should be able to do so:
    dbms_debug_jdwp.connect_tcp(
    host IN VARCHAR2,
    port IN VARCHAR2,
    session_id IN PLS_INTEGER := NULL,
    session_serial IN PLS_INTEGER := NULL,
    debug_role IN VARCHAR2 := NULL,
    debug_role_pwd IN VARCHAR2 := NULL,
    option_flags IN PLS_INTEGER := 0,
    extensions_cmd_set IN PLS_INTEGER := 128);
    But when I try (even as sys), I get the following:
    exec dbms_debug_jdwp.connect_tcp('1.2.3.4',5678,<session id>,<session serial>);ORA-00022: invalid session ID; access denied
    ORA-06512: at "SYS.DBMS_DEBUG_JDWP", line 68
    ORA-06512: at line 1
    00022. 00000 - "invalid session ID; access denied"
    *Cause:    Either the session specified does not exist or the caller
    does not have the privilege to access it.
    *Action:   Specify a valid session ID that you have privilege to access,
    that is either you own it or you have the CHANGE_USER privilege.
    I've tried granting the 'BECOME USER' privilege for the relevant users, but that didn't help. I read something about having to set some kind of ACL as of 11gR1, but the reference documentation was very confusing.
    Would someone be able to point me in the right direction? Is this even possible, or did I misread the documentation?

    Interesting deduction, that would be very useful indeed. I hate recompiling just to add the debug call, and it can't be done in our production environment. But it seems unlikely to me it would be implemented this way.
    I would cross-post this in the SQL AND PL/SQL forum though, as this is really a database issue, not with the SQL Developer tool. Do add the links to the other posts in each.
    Regards,
    K.

  • How to enable push mail for gmail in iphone 6 plus

    how to enable push mail for gmail in iphone 6 plus

    Tommacgr wrote:
    You can setup gmail account in iphone as exchange so the trick is simple and easy and push notification work after instantly . Just follow this steps http://email.about.com/od/iphonemailtips/ss/Set_Up_Push_Gmail_in_iPhone_Mail_Ste p_by_Step_Screenshots.htm
    You can only set up a Gmail account as an Exchange account if you have a paid account. Google dropped Exchange support for free accounts two years ago. That link is just a bit outdated.

  • How to enable cascade view for sites(iStore) in 11i?

    How to enable cascade view for sites in 11i?

    Hi,
    For this issue, I'm trying to involve someone familiar with this topic to further look at it.
    Thanks,
    Wendy
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback
    for TechNet Subscriber Support, contact [email protected]
    Wendy Li
    TechNet Community Support

  • I have a lock field(boot.efi) in recycle bin how to put it out (for unlock and empty my recycle bin)

    I have a lock field(boot.efi) in recycle bin how to put it out (for unlock and empty my recycle bin)

    Trying logging out/in or a restart.
    If that doesn't allow you to empty the trash:
    Trash – Empty When File is Locked or in Use
    Trash FAQ       
    Maybe this will help:
    https://discussions.apple.com/message/17029415#17029415

  • Guest password request for purplecat website in oakland california 192.168.33.112

    guest password request for purplecat website in oakland california 192.168.33.112

    I have the same errors occurring at an alarming rate. I did isolate it to the App Store. Specifically when checking for an update. I was hoping that you could test this out for me. Go to your console log and select all messages and then check kernel in the sender box (bottom left). I found that now is a good time to insert a marker. Now launch the app store then got to the update section. Select check for update.
    Does this generate a series of the errors? I can reproduce the errors every time I "check for updates". The error would not show up when checking for updates in iTunes.
    I did notice errors in both extending from CFNetwork
    App store:
    2015-01-15 8:40:38.047 AM storeassetd[356]: CFNetwork SSLHandshake failed (-9802)
    iTunes
    2015-01-15 8:53:53.986 AM iTunes[2200]: CFNetwork SSLHandshake failed (-9806)
    Please compare and see if you get the same results.

Maybe you are looking for

  • How to get one year licence for CE

    I received a mail that developers can use CE for one year. The SDN Subscriptions program is happy to announce that the SAP NetWeaver, Composition Subscription is now available for purchase in Germany and the United States. As a developer, now you hav

  • Resume() not working

    Hi everyone, I couldnt find an answer to my problem anywhere, i hope some of you can help me out. I am trying to play a previously recorded video, everything works fine except the resume() method (same with togglePause() - when it's used to resume th

  • How do i get my sopcast to work after downloading crossover

    I have downloaded sopcast and the crossover software and every program i need with it to run sopcast but sopcast keeps giving me a black screen even though it says it is playing. I read about a famous left- icon button. Is it the double square icon c

  • Prime Infrastructure 1.2, 1.3, 2.0 with Citrix Xenserver

    Hello all, i wanted to try Prime NCS with Xenserver but this combination does not work. ncs is not sstarting, it crashes with a java exception. Does anyone know if PI 1.2, 1.3 or 2.0 will work/start with Citrix Xenserver? if there are any experiences

  • How to render best quality video in AE CS5

    Which format is the best quality in export setting? I want render the MTS(AVCHD) fromat video with no wastage, and also keep the video as orignal size.