Why does systemctl halt asks for password but systemctl reboot and systemctl poweroff not?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
2
down vote

favorite
1












I am using Debian 9.5. From terminal whenever I type the command systemctl halt, it will say:




Authentication is required to start halt.target




and it will ask for password. But I can use commands systemctl reboot and systemctl poweroff and they will not ask for password and will execute successfully.I think if it asks for password for halt then it should also ask for poweroff.







share|improve this question

















  • 2




    I guess there are polkit actions/policies for the convenience of being able to reboot/poweroff as a normal user (without administrative privileges). halt was probably not considered a command that would be used by "normal" users, so there was no policy added.
    – danzel
    2 days ago
















up vote
2
down vote

favorite
1












I am using Debian 9.5. From terminal whenever I type the command systemctl halt, it will say:




Authentication is required to start halt.target




and it will ask for password. But I can use commands systemctl reboot and systemctl poweroff and they will not ask for password and will execute successfully.I think if it asks for password for halt then it should also ask for poweroff.







share|improve this question

















  • 2




    I guess there are polkit actions/policies for the convenience of being able to reboot/poweroff as a normal user (without administrative privileges). halt was probably not considered a command that would be used by "normal" users, so there was no policy added.
    – danzel
    2 days ago












up vote
2
down vote

favorite
1









up vote
2
down vote

favorite
1






1





I am using Debian 9.5. From terminal whenever I type the command systemctl halt, it will say:




Authentication is required to start halt.target




and it will ask for password. But I can use commands systemctl reboot and systemctl poweroff and they will not ask for password and will execute successfully.I think if it asks for password for halt then it should also ask for poweroff.







share|improve this question













I am using Debian 9.5. From terminal whenever I type the command systemctl halt, it will say:




Authentication is required to start halt.target




and it will ask for password. But I can use commands systemctl reboot and systemctl poweroff and they will not ask for password and will execute successfully.I think if it asks for password for halt then it should also ask for poweroff.









share|improve this question












share|improve this question




share|improve this question








edited yesterday
























asked 2 days ago









Debian_yadav

8272522




8272522







  • 2




    I guess there are polkit actions/policies for the convenience of being able to reboot/poweroff as a normal user (without administrative privileges). halt was probably not considered a command that would be used by "normal" users, so there was no policy added.
    – danzel
    2 days ago












  • 2




    I guess there are polkit actions/policies for the convenience of being able to reboot/poweroff as a normal user (without administrative privileges). halt was probably not considered a command that would be used by "normal" users, so there was no policy added.
    – danzel
    2 days ago







2




2




I guess there are polkit actions/policies for the convenience of being able to reboot/poweroff as a normal user (without administrative privileges). halt was probably not considered a command that would be used by "normal" users, so there was no policy added.
– danzel
2 days ago




I guess there are polkit actions/policies for the convenience of being able to reboot/poweroff as a normal user (without administrative privileges). halt was probably not considered a command that would be used by "normal" users, so there was no policy added.
– danzel
2 days ago










1 Answer
1






active

oldest

votes

















up vote
2
down vote



accepted










In a later version, systemd v235, halt could be allowed without a password. In order to make it allowed, you would have to edit some polkit configuration file.



The description on the commit which added this feature for halt, says "the whole concept of halting isn't really too useful".[1] I think this point of view explains the difference v.s. poweroff/reboot :-).



Another way to look at it, is that poweroff/reboot buttons are provided in common GUIs, and we expect them to work without needing a password. The systemd project is providing a way to implement this. But the user does not normally want a separate button to "halt".



I reviewed this commit and helped approve it. I felt it was generally safer for systemd not to change this behaviour, and there wasn't a clear reason for change.



The original behaviour might have been considered simpler... maintaining code and documentation for an API if we didn't actually expect it to be used can be positively undesirable. Or it might have been a way to block users from doing something they didn't actually want to do. I'm not sure. I very vaguely imagined one other concern. "halt" is defined to enter the ROM Monitor, if there is one. If there was some hypothetical ROM Monitor which required a password at boot time, I am not certain that it would prompt for the password again when the OS handed back control.




Adding polkit support in v235 was a side-benefit of making logind support halt. This was implemented to make systemctl behave consistently for halt, but the polkit support wasn't really the reason.



[1] PR #6944 - "systemctl reboot/suspend tweaks" - commit 36b69c313120 - "logind: add Halt() and CanHalt() APIs"



Link: https://github.com/systemd/systemd/pull/6944/commits/36b69c31312007f522a2a7ae5087ae90bd7867cc



polkit hints



You can see the polkit default settings in /usr/share/polkit-1/actions/org.freedesktop.login1.policy. You can search for similar entries for power-off and reboot, and look at their <defaults> element. And in v235 and above, there will be an entry for halt which you can compare.



You may notice some additional details. Like, if you have logged in over the network, the system will require an admin password to power off.



If you know the right incantation, you can create a file somewhere under /etc/polkit-1 which provides a different setting from the default. My guess is you have to define a "rule".






share|improve this answer























    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f460481%2fwhy-does-systemctl-halt-asks-for-password-but-systemctl-reboot-and-systemctl-pow%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote



    accepted










    In a later version, systemd v235, halt could be allowed without a password. In order to make it allowed, you would have to edit some polkit configuration file.



    The description on the commit which added this feature for halt, says "the whole concept of halting isn't really too useful".[1] I think this point of view explains the difference v.s. poweroff/reboot :-).



    Another way to look at it, is that poweroff/reboot buttons are provided in common GUIs, and we expect them to work without needing a password. The systemd project is providing a way to implement this. But the user does not normally want a separate button to "halt".



    I reviewed this commit and helped approve it. I felt it was generally safer for systemd not to change this behaviour, and there wasn't a clear reason for change.



    The original behaviour might have been considered simpler... maintaining code and documentation for an API if we didn't actually expect it to be used can be positively undesirable. Or it might have been a way to block users from doing something they didn't actually want to do. I'm not sure. I very vaguely imagined one other concern. "halt" is defined to enter the ROM Monitor, if there is one. If there was some hypothetical ROM Monitor which required a password at boot time, I am not certain that it would prompt for the password again when the OS handed back control.




    Adding polkit support in v235 was a side-benefit of making logind support halt. This was implemented to make systemctl behave consistently for halt, but the polkit support wasn't really the reason.



    [1] PR #6944 - "systemctl reboot/suspend tweaks" - commit 36b69c313120 - "logind: add Halt() and CanHalt() APIs"



    Link: https://github.com/systemd/systemd/pull/6944/commits/36b69c31312007f522a2a7ae5087ae90bd7867cc



    polkit hints



    You can see the polkit default settings in /usr/share/polkit-1/actions/org.freedesktop.login1.policy. You can search for similar entries for power-off and reboot, and look at their <defaults> element. And in v235 and above, there will be an entry for halt which you can compare.



    You may notice some additional details. Like, if you have logged in over the network, the system will require an admin password to power off.



    If you know the right incantation, you can create a file somewhere under /etc/polkit-1 which provides a different setting from the default. My guess is you have to define a "rule".






    share|improve this answer



























      up vote
      2
      down vote



      accepted










      In a later version, systemd v235, halt could be allowed without a password. In order to make it allowed, you would have to edit some polkit configuration file.



      The description on the commit which added this feature for halt, says "the whole concept of halting isn't really too useful".[1] I think this point of view explains the difference v.s. poweroff/reboot :-).



      Another way to look at it, is that poweroff/reboot buttons are provided in common GUIs, and we expect them to work without needing a password. The systemd project is providing a way to implement this. But the user does not normally want a separate button to "halt".



      I reviewed this commit and helped approve it. I felt it was generally safer for systemd not to change this behaviour, and there wasn't a clear reason for change.



      The original behaviour might have been considered simpler... maintaining code and documentation for an API if we didn't actually expect it to be used can be positively undesirable. Or it might have been a way to block users from doing something they didn't actually want to do. I'm not sure. I very vaguely imagined one other concern. "halt" is defined to enter the ROM Monitor, if there is one. If there was some hypothetical ROM Monitor which required a password at boot time, I am not certain that it would prompt for the password again when the OS handed back control.




      Adding polkit support in v235 was a side-benefit of making logind support halt. This was implemented to make systemctl behave consistently for halt, but the polkit support wasn't really the reason.



      [1] PR #6944 - "systemctl reboot/suspend tweaks" - commit 36b69c313120 - "logind: add Halt() and CanHalt() APIs"



      Link: https://github.com/systemd/systemd/pull/6944/commits/36b69c31312007f522a2a7ae5087ae90bd7867cc



      polkit hints



      You can see the polkit default settings in /usr/share/polkit-1/actions/org.freedesktop.login1.policy. You can search for similar entries for power-off and reboot, and look at their <defaults> element. And in v235 and above, there will be an entry for halt which you can compare.



      You may notice some additional details. Like, if you have logged in over the network, the system will require an admin password to power off.



      If you know the right incantation, you can create a file somewhere under /etc/polkit-1 which provides a different setting from the default. My guess is you have to define a "rule".






      share|improve this answer

























        up vote
        2
        down vote



        accepted







        up vote
        2
        down vote



        accepted






        In a later version, systemd v235, halt could be allowed without a password. In order to make it allowed, you would have to edit some polkit configuration file.



        The description on the commit which added this feature for halt, says "the whole concept of halting isn't really too useful".[1] I think this point of view explains the difference v.s. poweroff/reboot :-).



        Another way to look at it, is that poweroff/reboot buttons are provided in common GUIs, and we expect them to work without needing a password. The systemd project is providing a way to implement this. But the user does not normally want a separate button to "halt".



        I reviewed this commit and helped approve it. I felt it was generally safer for systemd not to change this behaviour, and there wasn't a clear reason for change.



        The original behaviour might have been considered simpler... maintaining code and documentation for an API if we didn't actually expect it to be used can be positively undesirable. Or it might have been a way to block users from doing something they didn't actually want to do. I'm not sure. I very vaguely imagined one other concern. "halt" is defined to enter the ROM Monitor, if there is one. If there was some hypothetical ROM Monitor which required a password at boot time, I am not certain that it would prompt for the password again when the OS handed back control.




        Adding polkit support in v235 was a side-benefit of making logind support halt. This was implemented to make systemctl behave consistently for halt, but the polkit support wasn't really the reason.



        [1] PR #6944 - "systemctl reboot/suspend tweaks" - commit 36b69c313120 - "logind: add Halt() and CanHalt() APIs"



        Link: https://github.com/systemd/systemd/pull/6944/commits/36b69c31312007f522a2a7ae5087ae90bd7867cc



        polkit hints



        You can see the polkit default settings in /usr/share/polkit-1/actions/org.freedesktop.login1.policy. You can search for similar entries for power-off and reboot, and look at their <defaults> element. And in v235 and above, there will be an entry for halt which you can compare.



        You may notice some additional details. Like, if you have logged in over the network, the system will require an admin password to power off.



        If you know the right incantation, you can create a file somewhere under /etc/polkit-1 which provides a different setting from the default. My guess is you have to define a "rule".






        share|improve this answer















        In a later version, systemd v235, halt could be allowed without a password. In order to make it allowed, you would have to edit some polkit configuration file.



        The description on the commit which added this feature for halt, says "the whole concept of halting isn't really too useful".[1] I think this point of view explains the difference v.s. poweroff/reboot :-).



        Another way to look at it, is that poweroff/reboot buttons are provided in common GUIs, and we expect them to work without needing a password. The systemd project is providing a way to implement this. But the user does not normally want a separate button to "halt".



        I reviewed this commit and helped approve it. I felt it was generally safer for systemd not to change this behaviour, and there wasn't a clear reason for change.



        The original behaviour might have been considered simpler... maintaining code and documentation for an API if we didn't actually expect it to be used can be positively undesirable. Or it might have been a way to block users from doing something they didn't actually want to do. I'm not sure. I very vaguely imagined one other concern. "halt" is defined to enter the ROM Monitor, if there is one. If there was some hypothetical ROM Monitor which required a password at boot time, I am not certain that it would prompt for the password again when the OS handed back control.




        Adding polkit support in v235 was a side-benefit of making logind support halt. This was implemented to make systemctl behave consistently for halt, but the polkit support wasn't really the reason.



        [1] PR #6944 - "systemctl reboot/suspend tweaks" - commit 36b69c313120 - "logind: add Halt() and CanHalt() APIs"



        Link: https://github.com/systemd/systemd/pull/6944/commits/36b69c31312007f522a2a7ae5087ae90bd7867cc



        polkit hints



        You can see the polkit default settings in /usr/share/polkit-1/actions/org.freedesktop.login1.policy. You can search for similar entries for power-off and reboot, and look at their <defaults> element. And in v235 and above, there will be an entry for halt which you can compare.



        You may notice some additional details. Like, if you have logged in over the network, the system will require an admin password to power off.



        If you know the right incantation, you can create a file somewhere under /etc/polkit-1 which provides a different setting from the default. My guess is you have to define a "rule".







        share|improve this answer















        share|improve this answer



        share|improve this answer








        edited 2 days ago


























        answered 2 days ago









        sourcejedi

        18k22375




        18k22375






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f460481%2fwhy-does-systemctl-halt-asks-for-password-but-systemctl-reboot-and-systemctl-pow%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?